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
The trend in girls baptized does not show one apparent trend; rather, the counts decreased from from 1629 until a minimum of 2722 in 1650, and then gradually increased thereafter.
# 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")
There are 63 rows and 3 columns. It includes the years from 1940 to 2002. The columns are titled year, boys, and girls.
The counts include a lot more data than Arbuthnot's records. There are over 200 times more boys and girls per year in the present data.
# enter R code for question 3 below
plot(present$year, present$boys/present$girls, type = "l")
Yes, this agrees with Arbuthnot's data that boys are born in a greater proportion because the proportion of boys to girls born is greater than 1 for every year in the data set.
# enter R code for question 4 below
present$year[which.max(present$boys + present$girls)]
## [1] 1961
present$boys[which.max(present$boys + present$girls)] + present$girls[which.max(present$boys +
present$girls)]
## [1] 4268326
The most total births occurred in 1961, where there were 4268326 births.
arbuthnottotal = arbuthnot$boys + arbuthnot$girls
arbuthnotshifted = arbuthnottotal[-(1:1)]
arbuthnotshifted = c(arbuthnotshifted, 0)
Adrop = arbuthnotshifted/arbuthnottotal
indices = which(Adrop < 0.95)
arbuthnot$year[c(indices + 1)]
## [1] 1630 1631 1636 1643 1644 1646 1648 1649 1657 1658 1665 1666 1673 1694
## [15] 1704 NA
Here's the following list of years with a significant population drop 1630 1631 - beginning of the data set, data is highly variable
1636 Pequot War
1643 1644 1646 1648 1649 - War between the natives and the Dutch, known as Kieft's War or the Wappinger War
1657 1658 Can't find anything. Some sources report on high incidence of the Beriberi disease. Drop was of a high proportion but not very much by the numbers and variable conflicts with indians could've caused this drop.
1665 1666 Second Anglo-Dutch War
1673 Third Anglo-Dutch War
1694 Salem Witch Trials
1704 Queen Anne's War