source("http://www.openintro.org/stat/data/present.R")
head(present)
##   year    boys   girls
## 1 1940 1211684 1148715
## 2 1941 1289734 1223693
## 3 1942 1444365 1364631
## 4 1943 1508959 1427901
## 5 1944 1435301 1359499
## 6 1945 1404587 1330869
source("http://www.openintro.org/stat/data/arbuthnot.R")

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

min(present$year)
## [1] 1940
max(present$year)
## [1] 2002
dim(present)
## [1] 63  3

Q 2. How do these counts compare to Arbuthnot’s? Are they on a similar scale? A: The scale of present day birth records is orders of magnitude greater than Arbuthnot’s counts. Present day in the US there are millions born each year compared to tens of thousands when Arbuthnot’s data was collected. This can be seen in the scale of their plots or easily by comparing their means.

plot(arbuthnot$year, arbuthnot$boys + arbuthnot$girls, type = "l")

plot(present$year, present$boys + present$girls, type ="l")

mean(present$boys + present$girls)
## [1] 3679515
mean(arbuthnot$boys + arbuthnot$girls)
## [1] 11441.74

Q 3. 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. A: The ratio of boys to girls in the present data is just above 1.0, similar to Arbuthnot’s observations, although there is less of difference between boys and girls in the present data than Arbuthnot’s.

plot(arbuthnot$year, (arbuthnot$boys/arbuthnot$girls), type = 'l')

plot(present$year, present$boys/present$girls, type = 'l')

Q 4. In what year did we see the most total number of births in the U.S.? A:

present$year[which.max(present$boys + present$girls)]
## [1] 1961