In the previous few pages, you recreated some of the displays and preliminary analysis of Arbuthnot’s baptism data. Your assignment involves repeating these steps, but for present day birth records in the United States. Load up the present day data with the following command.
source("more/present.R")
source("more/arbuthnot.R")
The data are stored in a data frame called present.
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
names(present)
## [1] "year" "boys" "girls"
dim(arbuthnot) - dim(present)
## [1] 19 0
print("Arbuthnot includes data covering 19 more years")
## [1] "Arbuthnot includes data covering 19 more years"
mean(arbuthnot$boys + arbuthnot$girls)/mean(present$boys + present$girls)
## [1] 0.00310958
print("However on average the Arbuthnot data contains only 0.3% the counts as the Present data")
## [1] "However on average the Arbuthnot data contains only 0.3% the counts as the Present data"
plot(x = present$year, y = present$boys/(present$girls + present$boys),type = "l")
present$boys > present$girls
## [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [15] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [29] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [43] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [57] TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Yes, the data does generally match up, including boys outnumbering girls in each year.
present[which.max(present$boys + present$girls),]$year
## [1] 1961