Question 1

The data.frame present contains the birth records from 1940-2002. The three variables are the year, the number of boys born, and the number of girls born. The number of boys ranges from approximately 1.2 million to 2.2 million, the number of girls ranges from approximately 1.1 million to 2.1 million.

min(present$year)
## [1] 1940
max(present$year)
## [1] 2002
min(present$boys)
## [1] 1211684
max(present$boys)
## [1] 2186274
min(present$girls)
## [1] 1148715
max(present$girls)
## [1] 2082052

Question 2

The counts of boys and girls are several hundred times more for present than for the arbuthnot data set.

mean(present$girls+present$boys)/mean(arbuthnot$girls+arbuthnot$boys)
## [1] 321.5869
(max(present$girls)+max(present$boys))/(max(arbuthnot$girls)+max(arbuthnot$boys))
## [1] 263.3956
(min(present$girls)+min(present$boys))/(min(arbuthnot$girls)+min(arbuthnot$boys))
## [1] 420.5985

Question 3

The ratio of boys to girls in the present data.frame is greater than 1 for every year. The ratio is much closer to 1.05 than Arbuthnot’s data.

ratio <- (present$boys/present$girls)
present <- cbind(present,ratio)
plot(present$year,present$ratio, type="l")

max(present$ratio)
## [1] 1.058698
min(present$ratio)
## [1] 1.045686

Question 4

The greatest number of births was in 1961.

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