source("http://www.openintro.org/stat/data/arbuthnot.R")
source("http://www.openintro.org/stat/data/present.R")
# enter R code for exercise 1 below
arbuthnot$girls
## [1] 4683 4457 4102 4590 4839 4820 4928 4605 4457 4952 4784 5332 5200 4910
## [15] 4617 3997 3919 3395 3536 3181 2746 2722 2840 2908 2959 3179 3349 3382
## [29] 3289 3013 2781 3247 4107 4803 4881 5681 4858 4319 5322 5560 5829 5719
## [43] 6061 6120 5822 5738 5717 5847 6203 6033 6041 6299 6533 6744 7158 7127
## [57] 7246 7119 7214 7101 7167 7302 7392 7316 7483 6647 6713 7229 7767 7626
## [71] 7452 7061 7514 7656 7683 5738 7779 7417 7687 7623 7380 7288
After a brief drop from 1640-1660, there is generaly a climb in the births of baptised females in the saple population observed.
# enter R code for exercise 3 in the line below, before the line with ```
# which ends the R code
plot(arbuthnot$year, arbuthnot$boys/(arbuthnot$boys + arbuthnot$girls), type = "l")
years 1940-2002 63 observation, 3 variables variables: year, boys, girls
The variables are the same. However, the number of observations is less than that of Arbuthnot by 19 observations.
# enter R code for question 3 below
plot(present$year, present$boys/present$girls, type = "l")
Arbuthnot's observations do not comply with this new data showing the ratio of boy to girl births generaly decreasing over time.
# enter R code for question 4 below
present$year[which.max(present$boys + present$girls)]
## [1] 1961
1631- 1648-Civil War in England 1650-Battle of Dunbar 1659-Restoration of England 1675-Great Fire 1679- 1694- 1704-
# enter R code for question 4 below
arbuthnot$year[0:10][which.min(boysandgirls[0:10])]
## Error: object 'boysandgirls' not found