This assignment comes from the openintro practice exercises, you can find the instructions by pasting this link into your web browser: https://nulib.github.io/kuyper-stat202/introduction-to-r-and-rstudio.html#on-your-own

Complete the steps that you went through using Dr. Arbuthnot’s Baptism Records and answer the questions below. Any code you produce should be entered below the corresponding question.

1.3 On Your Own

Q1. What years are included in this data set? What are the dimensions of the data frame and what are the variable or column names?

Arbuthnot’s data set is 82 rows by 3 columns, years 1629-1710. The present data set is 63 rows by 3 columbs, years 1940-2002. Each set has columns by year, boy births, and girl births.

Q2. How do these counts compare to Arbuthnot’s? Are they on a similar scale?

The present counts are vastly larger than Arbuthnot’s table. The scales are similar, with boy births outnumbering girl births by approximately 5% each year.

Q3. Make a plot that displays the boy-to-girl ratio for every year in the data set. What do you see? Does Arbuthnot’s observation about boys being born in greater proportion than girls hold up in the U.S.? Include the plot in your response.

plot(present\(boys / present\)girls) http://127.0.0.1:31246/graphics/e5c307d2-3a10-4557-b385-f7e20e04d171.png

Arbuthnot’s dataset has an approximate range of 5-15% more boys than girls. The present dataset has an approximate range of 4.8-5.4% more boys than girls. This does confirm the observation that in the US more boys are born than girls.

Q4. In what year did we see the most total number of births in the U.S.? You can refer to the help files or the R reference card http://cran.r-project.org/doc/contrib/Short-refcard.pdf to find helpful commands.

max(present\(boys + present\)girls) data.set(present\(boys + present\)girls)

1959, 4,268,326


Reminder:

  • For a new code chunk, press CTRL + ALT + I (Windows), OPT + COMMAND + I (Mac).

  • To run a line of code, press CTRL + ENTER (Windows), COMMAND + RETURN (Mac)

  • Use # to make a comment (this lets R know the line shouldn’t be run as code and helps you stay organized)

  • To name an object, we using the assignment operator <-

  • Save all R assignments using this naming convention: 314_AssignmentTitle_YourLastName (for example, I would save my file as 314_Hwk2_Miller)