source("http://www.openintro.org/stat/data/arbuthnot.R")
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
plot(x = arbuthnot$year, y = arbuthnot$girls, type = "l")
The number of girls baptized sharply increased after 1660. The minimum number of of girls baptized was in 1650 (roughly).
plot(x = arbuthnot$year, y = arbuthnot$boys / (arbuthnot$boys + arbuthnot$girls), type = "l")
The proportion decreases over time. The minimum proportion of boys was in 1704 (roughly).
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/present.R")
present$year
## [1] 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953
## [15] 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967
## [29] 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
## [43] 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995
## [57] 1996 1997 1998 1999 2000 2001 2002
dim(present)
## [1] 63 3
3 columns and 63 rows
names(arbuthnot)
## [1] "year" "boys" "girls"
summary(present$boys)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1211684 1799857 1924868 1885600 2058524 2186274
summary(arbuthnot$boys)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2890 4759 6073 5907 7576 8426
summary(present$girls)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1148715 1711404 1831679 1793915 1965538 2082052
summary(arbuthnot$girls)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2722 4457 5718 5535 7150 7779
They are not on the similar scale as we see big difference in the summary results.
plot(x = present$year, y = present$boys/present$girls, type = "l", main = "Ratio of Boy-to-Girl Birthrates in the USA (1940 to 2002)" ,xlab = "Year", ylab = "boy-to-girl ratio")
plot(x = arbuthnot$year, y = arbuthnot$boys/arbuthnot$girls, type = "l", main = "Ratio of Boy-to-Girl Birthrates in London (1629 to 1710)" ,xlab = "Year", ylab = "boy-to-girl ratio")
Arbuthnot’s observation does not hold up as the proportion of boys decrease over time in the US.
present$year[(present$boys + present$girls) == max(present$boys + present$girls)]
## [1] 1961