What command would you use to extract just the counts of girls baptized?
Answer: arbuthnot$girls
## [1] 4683 4457 4102 4590 4839 4820 4928 4605 4457 4952 4784 5332 5200 4910 4617
## [16] 3997 3919 3395 3536 3181 2746 2722 2840 2908 2959 3179 3349 3382 3289 3013
## [31] 2781 3247 4107 4803 4881 5681 4858 4319 5322 5560 5829 5719 6061 6120 5822
## [46] 5738 5717 5847 6203 6033 6041 6299 6533 6744 7158 7127 7246 7119 7214 7101
## [61] 7167 7302 7392 7316 7483 6647 6713 7229 7767 7626 7452 7061 7514 7656 7683
## [76] 5738 7779 7417 7687 7623 7380 7288
Is there an apparent trend in the number of girls baptized over the years? How would you describe it?
Answer: Yes, you can see a uptrend starting to appear at the double bottom of 1640 and 1660. The overall pattern shows that the population was increasing during this time, which means that it shows a steady growth.
## starting httpd help server ... done
## [1] 9901 9315 8524 9584 9997 9855 10034 9522 9160 10311 10150 10850
## [13] 10670 10370 9410 8104 7966 7163 7332 6544 5825 5612 6071 6128
## [25] 6155 6620 7004 7050 6685 6170 5990 6971 8855 10019 10292 11722
## [37] 9972 8997 10938 11633 12335 11997 12510 12563 11895 11851 11775 12399
## [49] 12626 12601 12288 12847 13355 13653 14735 14702 14730 14694 14951 14588
## [61] 14771 15211 15054 14918 15159 13632 13976 14861 15829 16052 15363 14639
## [73] 15616 15687 15448 11851 16145 15369 16066 15862 15220 14928
arbuthnot <- arbuthnot |>
mutate(total = boys + girls)
ggplot(data = arbuthnot, aes(x = year, y = total)) +
geom_line()## [1] 1.114243
## [1] 0.5270175
Generate a plot of the proportion of boys born over time. What do you see?
Answer: The proportion of boys seemed to be volatile but as you can see in the chart, there seems to be a downtrend after 1660s.
arbuthnot <- arbuthnot |>
mutate(more_boys = boys > girls)
ggplot(data = arbuthnot, aes( x = year, y = boy_ratio)) + geom_line()What years are included in this data set? What are the dimensions of the data frame? What are the variable (column) names?
Answer: The years that are included in the data set fall between 1940 - 2002. The dimensions are 63 observations and 3 variables. The variable colums are year, boys, and girls.
## Rows: 63
## Columns: 3
## $ year <dbl> 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950…
## $ boys <dbl> 1211684, 1289734, 1444365, 1508959, 1435301, 1404587, 1691220, 1…
## $ girls <dbl> 1148715, 1223693, 1364631, 1427901, 1359499, 1330869, 1597452, 1…
How do these counts compare to Arbuthnot’s? Are they of a similar magnitude?
Answer: They have the same column when it comes to the amount of rows but also has the same 82 observations.
## Rows: 82
## Columns: 7
## $ year <int> 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637…
## $ boys <int> 5218, 4858, 4422, 4994, 5158, 5035, 5106, 4917, 4703…
## $ girls <int> 4683, 4457, 4102, 4590, 4839, 4820, 4928, 4605, 4457…
## $ total <int> 9901, 9315, 8524, 9584, 9997, 9855, 10034, 9522, 916…
## $ boy_to_girl_ratio <dbl> 1.114243, 1.089971, 1.078011, 1.088017, 1.065923, 1.…
## $ boy_ratio <dbl> 0.5270175, 0.5215244, 0.5187705, 0.5210768, 0.515954…
## $ more_boys <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE…
Make a plot that displays the proportion of boys born over time. What do you see? Does Arbuthnot’s observation about boys being born in greater proportion than girls hold up in the U.S.?
Answer: I see that it doesn’t hold us as the boys population is still in a continuous downtrend. Also you can see that there is only 63 observations in the present data set while Arbuthnot had 83 observations.
present <- present %>%
mutate (total = boys + girls,
boys_ratio = boys/total,
more_boys = boys > girls)
ggplot (present, aes(x=year,y=boys_ratio)) + geom_line()In what year did we see the most total number of births in the U.S.?
Answer: We saw that the total number of births in the U.S was 4,268,326 births from 1961.
## # A tibble: 63 × 6
## year boys girls total boys_ratio more_boys
## <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
## 1 1961 2186274 2082052 4268326 0.512 TRUE
## 2 1960 2179708 2078142 4257850 0.512 TRUE
## 3 1957 2179960 2074824 4254784 0.512 TRUE
## 4 1959 2173638 2071158 4244796 0.512 TRUE
## 5 1958 2152546 2051266 4203812 0.512 TRUE
## 6 1962 2132466 2034896 4167362 0.512 TRUE
## 7 1956 2133588 2029502 4163090 0.513 TRUE
## 8 1990 2129495 2028717 4158212 0.512 TRUE
## 9 1991 2101518 2009389 4110907 0.511 TRUE
## 10 1963 2101632 1996388 4098020 0.513 TRUE
## # ℹ 53 more rows
How much of the R tutorial did you finish? Answer: 100%