Lab report

Load data: (Hint, the source command from the lab)

source("http://www.openintro.org/stat/data/arbuthnot.R")

Exercise 1:

  1. What command would you use to extract just the counts of girls baptized? Try it!
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

Exercise 2:

  1. Is there an apparent trend in the number of girls baptized over the years?
    How would you describe it? There is a upward linear progression follwing the depression in the graph showed representing the uptick in the number of baptisms after a big decrease between 1650-1660
plot(x = arbuthnot$year, y = arbuthnot$girls, type = "l")

Exercise 3:

  1. Now, make a plot of the proportion of boys over time. What do you see? Tip: If you use the up and down arrow keys, you can scroll through your previous commands, your so-called command history. You can also access it by clicking on the history tab in the upper right panel. This will save you a lot of typing in the future.
plot(x = arbuthnot$year, y = arbuthnot$boys / (arbuthnot$boys + arbuthnot$girls), type = "l")


On your own:

source("http://www.openintro.org/stat/data/present.R")

1:

  1. What command would you use to extract just the counts of girls baptized? Try it!
present$girls
##  [1] 1148715 1223693 1364631 1427901 1359499 1330869 1597452 1800064 1721216
## [10] 1733177 1730594 1827830 1875724 1900322 1958294 1973576 2029502 2074824
## [19] 2051266 2071158 2078142 2082052 2034896 1996388 1967328 1833304 1760412
## [28] 1717571 1705238 1753634 1816008 1733060 1588484 1528639 1537844 1531063
## [37] 1543352 1620716 1623885 1703131 1759642 1768966 1794861 1773380 1789651
## [46] 1832578 1831679 1858241 1907086 1971468 2028717 2009389 1982917 1951379
## [55] 1930178 1903234 1901014 1895298 1925348 1932563 1981845 1968011 1963747

2:

  1. Is there an apparent trend in the number of girls baptized over the years?
    How would you describe it? This graph differs from the arbuthnot data beacause at first there is a linear progression, but it is followed by a dip in batisms starting in 1960 and then leveling back out in the 1990s.
plot(present$year, present$girls, type = "l")

3:

  1. Now, make a plot of the proportion of boys over time. What do you see? Tip: If you use the up and down arrow keys, you can scroll through your previous commands, your so-called command history. You can also access it by clicking on the history tab in the upper right panel. This will save you a lot of typing in the future.
plot(x=present$year, y=present$boys/present$girls, type="l")

4:

present[which.max(present$boys + present$girls),]
##    year    boys   girls
## 22 1961 2186274 2082052