library(tidyverse)
library(openintro)
data('arbuthnot', package='openintro')
arbuthnot
## # A tibble: 82 x 3
##     year  boys girls
##    <int> <int> <int>
##  1  1629  5218  4683
##  2  1630  4858  4457
##  3  1631  4422  4102
##  4  1632  4994  4590
##  5  1633  5158  4839
##  6  1634  5035  4820
##  7  1635  5106  4928
##  8  1636  4917  4605
##  9  1637  4703  4457
## 10  1638  5359  4952
## # ... with 72 more rows
arbuthnot$boys
##  [1] 5218 4858 4422 4994 5158 5035 5106 4917 4703 5359 5366 5518 5470 5460 4793
## [16] 4107 4047 3768 3796 3363 3079 2890 3231 3220 3196 3441 3655 3668 3396 3157
## [31] 3209 3724 4748 5216 5411 6041 5114 4678 5616 6073 6506 6278 6449 6443 6073
## [46] 6113 6058 6552 6423 6568 6247 6548 6822 6909 7577 7575 7484 7575 7737 7487
## [61] 7604 7909 7662 7602 7676 6985 7263 7632 8062 8426 7911 7578 8102 8031 7765
## [76] 6113 8366 7952 8379 8239 7840 7640

Exercise 1: Point plot (Girls vs. Year)

Arbuthnot$girls pulls an extract of just the counts of girls baptized by year.

The geom_point plot of the data using the ggplot package lays the data on a plot of ‘girls’ against ‘year’ in the given data. The code defines what is used in the a axis (year) and y axis (girls).

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
ggplot(data = arbuthnot, aes(x = year, y = girls)) + 
  geom_point()

### Exercise 1: Line plot (Girls vs. Year) #### Arbuthnot$girls pulls an extract of just the counts of girls baptized by year. #### The geom_point plot of the data using the ggplot package lays the data on a plot of ‘girls’ against ‘year’ in the given data. The code defines what is used in the a axis (year) and y axis (girls).

ggplot(data = arbuthnot, aes(x = year, y = girls)) + 
geom_line()

Exercise 2:

Trend in the number of girls baptized over the years.

I used the ggplot package to generate a line plot (geom_line) of the girls baptized over the year from the given data.

I can see in the plot that the number of girls baptized decreased by almost 50% from the year 1640 to 1659. Then the number gradually increased with considerable dips around the year 1665, 1693 and 1703.

I researched further and found that the dips in 1640 corresponds to the English Civil War, and the one in 1965 corresponds to the Great Plague of London. I could not find a good reason for the one in 1703.

Overall, from 1629 to 1710, there has been an increase in the number of girls baptized.

# Insert code for Exercise 2 here
ggplot(data = arbuthnot, aes(x = year, y = girls)) + 
geom_line()

## Code to add a 'total' column in the data frame that includes the sum of girls and boys baptized in each year
arbuthnot <- arbuthnot %>%
  mutate(total = boys + girls)
arbuthnot
## # A tibble: 82 x 4
##     year  boys girls total
##    <int> <int> <int> <int>
##  1  1629  5218  4683  9901
##  2  1630  4858  4457  9315
##  3  1631  4422  4102  8524
##  4  1632  4994  4590  9584
##  5  1633  5158  4839  9997
##  6  1634  5035  4820  9855
##  7  1635  5106  4928 10034
##  8  1636  4917  4605  9522
##  9  1637  4703  4457  9160
## 10  1638  5359  4952 10311
## # ... with 72 more rows
## Code to add a 'boy_to_girl_ratio' column in the data frame that includes the ratio of boys to girls by year
arbuthnot <- arbuthnot %>%
  mutate(boy_to_girl_ratio = boys / girls)
## Code to add a 'boy_ratio' column in the data frame that includes the ratio of boys to the total by year
arbuthnot <- arbuthnot %>%
  mutate(boy_ratio = boys / total)
## Added another column for 'girl_ratio'
arbuthnot <- arbuthnot %>%
  mutate(girl_ratio = boys / total)
## Removed the new column 'girl_ratio' from the data frame
arbuthnot <- subset (arbuthnot, select = -girl_ratio)
arbuthnot
## # A tibble: 82 x 6
##     year  boys girls total boy_to_girl_ratio boy_ratio
##    <int> <int> <int> <int>             <dbl>     <dbl>
##  1  1629  5218  4683  9901              1.11     0.527
##  2  1630  4858  4457  9315              1.09     0.522
##  3  1631  4422  4102  8524              1.08     0.519
##  4  1632  4994  4590  9584              1.09     0.521
##  5  1633  5158  4839  9997              1.07     0.516
##  6  1634  5035  4820  9855              1.04     0.511
##  7  1635  5106  4928 10034              1.04     0.509
##  8  1636  4917  4605  9522              1.07     0.516
##  9  1637  4703  4457  9160              1.06     0.513
## 10  1638  5359  4952 10311              1.08     0.520
## # ... with 72 more rows

Exercise 3: Plot of the proportion of boys born over time

The plot of proportion of boys born (ratio or boys to the total which is the boy_ratio in the table) against year across the data set is seen to fluctuate around 0.52 going as high as 0.536 around 1661 and as low as 0.503 around 1703.

# Insert code for Exercise 3 here
ggplot(data = arbuthnot, aes(x = year, y = boy_ratio)) + 
geom_line()

### Exercise 4 #### The present dataset includes the years 1940 through 2002

# Insert code for Exercise 4 here
present$year
##  [1] 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954
## [16] 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969
## [31] 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
## [46] 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
## [61] 2000 2001 2002

The dataset ‘present’ has 63 rows of data and 3 columns in each row.

The variable column names in this data set are ‘boys’ and ‘girls’.

dim.data.frame(present)
## [1] 63  3

Exercise 5

The count of boys and girls born between 1629 and 1710 and those between 1940 and 2002 is very different. As we can see in the summary of the two data sets, the mean of boys and girls in the arbuthnot data set is 5907 and 5535 respectively. The mean of boys and girls for the present data set are 1885600 and 1793915 respectively. So, they are clearly of different magnitudes. This makes sense because we are comparing different times with different populations as well as the the geographic area included in the two datasets is different, one from te city of London and the other from the United States.

# Insert code for Exercise 5 here
summary(arbuthnot)
##       year           boys          girls          total       boy_to_girl_ratio
##  Min.   :1629   Min.   :2890   Min.   :2722   Min.   : 5612   Min.   :1.011    
##  1st Qu.:1649   1st Qu.:4759   1st Qu.:4457   1st Qu.: 9199   1st Qu.:1.048    
##  Median :1670   Median :6073   Median :5718   Median :11813   Median :1.065    
##  Mean   :1670   Mean   :5907   Mean   :5535   Mean   :11442   Mean   :1.071    
##  3rd Qu.:1690   3rd Qu.:7576   3rd Qu.:7150   3rd Qu.:14723   3rd Qu.:1.088    
##  Max.   :1710   Max.   :8426   Max.   :7779   Max.   :16145   Max.   :1.156    
##    boy_ratio     
##  Min.   :0.5027  
##  1st Qu.:0.5118  
##  Median :0.5157  
##  Mean   :0.5170  
##  3rd Qu.:0.5210  
##  Max.   :0.5362
summary(present)
##       year           boys             girls        
##  Min.   :1940   Min.   :1211684   Min.   :1148715  
##  1st Qu.:1956   1st Qu.:1799857   1st Qu.:1711405  
##  Median :1971   Median :1924868   Median :1831679  
##  Mean   :1971   Mean   :1885600   Mean   :1793915  
##  3rd Qu.:1986   3rd Qu.:2058524   3rd Qu.:1965538  
##  Max.   :2002   Max.   :2186274   Max.   :2082052
sum(arbuthnot$girls)
## [1] 453841
sum(present$girls)
## [1] 113016646
sum(arbuthnot$boys)
## [1] 484382
sum(present$boys)
## [1] 118792776

Exercise 6: Plot of proportion of boys born over time

What do you see? In comparing the proportion of boys born from each dataset to the total number of births, we see that the proportion flucuates within a very similar range. We also see that there are more number of boys born in each year in both the data set as see in the plot as well as in the code below (present <- present %>% mutate(more_boys = boys > girls))

So Arbuthnot’s observation about boys being born in greater proportion than girls in the US hold true.

# Create a new column 'total' with the sum of 'boys' and 'girls'.
present <- present %>%
  mutate(total = boys + girls)
# Create a new column 'boy_ratio' with the ratio of 'boys' to 'total'.
present <- present %>%
  mutate(boy_ratio = boys / total)
# Create a new column 'girl_ratio' with the ratio of 'boys' to 'total'.
present <- present %>%
  mutate(girl_ratio = girls / total)
# Create a new column 'more_boys' that would display True if there were more boys born in each year; else False. The following code displays two rows of the new data set.
present <- present %>%
  mutate(more_boys = boys > girls)
head(present,2)
## # A tibble: 2 x 7
##    year    boys   girls   total boy_ratio girl_ratio more_boys
##   <dbl>   <dbl>   <dbl>   <dbl>     <dbl>      <dbl> <lgl>    
## 1  1940 1211684 1148715 2360399     0.513      0.487 TRUE     
## 2  1941 1289734 1223693 2513427     0.513      0.487 TRUE
# Plot of proportion of boys in the 'present' dataset.
ggplot(data = present, aes(x = year, y = boy_ratio)) + 
geom_line()

Exercise 7:

When the data is sorted in the order of decending ‘total’ we see that the highest number of births which is 4268326 took place in the year 1961.

# Code to sort the data in the decending order of total.
present %>%
  arrange(desc(total))
## # A tibble: 63 x 7
##     year    boys   girls   total boy_ratio girl_ratio more_boys
##    <dbl>   <dbl>   <dbl>   <dbl>     <dbl>      <dbl> <lgl>    
##  1  1961 2186274 2082052 4268326     0.512      0.488 TRUE     
##  2  1960 2179708 2078142 4257850     0.512      0.488 TRUE     
##  3  1957 2179960 2074824 4254784     0.512      0.488 TRUE     
##  4  1959 2173638 2071158 4244796     0.512      0.488 TRUE     
##  5  1958 2152546 2051266 4203812     0.512      0.488 TRUE     
##  6  1962 2132466 2034896 4167362     0.512      0.488 TRUE     
##  7  1956 2133588 2029502 4163090     0.513      0.487 TRUE     
##  8  1990 2129495 2028717 4158212     0.512      0.488 TRUE     
##  9  1991 2101518 2009389 4110907     0.511      0.489 TRUE     
## 10  1963 2101632 1996388 4098020     0.513      0.487 TRUE     
## # ... with 53 more rows
head(present,5)
## # A tibble: 5 x 7
##    year    boys   girls   total boy_ratio girl_ratio more_boys
##   <dbl>   <dbl>   <dbl>   <dbl>     <dbl>      <dbl> <lgl>    
## 1  1940 1211684 1148715 2360399     0.513      0.487 TRUE     
## 2  1941 1289734 1223693 2513427     0.513      0.487 TRUE     
## 3  1942 1444365 1364631 2808996     0.514      0.486 TRUE     
## 4  1943 1508959 1427901 2936860     0.514      0.486 TRUE     
## 5  1944 1435301 1359499 2794800     0.514      0.486 TRUE
LS0tDQp0aXRsZTogIkxhYiAxOiBJbnRybyB0byBSIg0KYXV0aG9yOiAiRGVlcGEgU2hhcm1hIg0KZGF0ZTogImByIFN5cy5E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