lab-2

.pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

C88C

Subject

Statistics

Date

May 9, 2024

Type

pdf

Pages

6

Uploaded by CountQuetzalMaster887 on coursehero.com

Lab 2 Question 1 What is the chance that a child born tomorrow is a girl? Question 2 The unit of observation is the christening record of the newborn. Some variables that may have been recorded are their birth date and sex. Question 3 The probability of having a newborn child recorded as a girl is 50%. I came to this determi- nation because when someone is born, they are born either a girl or a boy. We are able to gather data in the form of birth certificates from hospitals. Question 4 Every row in the data frame corresponds to a year of the total number of boys and girls born collected by Arbuthnot. The names of the variables are “years”, “boys”, and “girls”. The variable “years” is a nominal categorical variable and “boys” and “girls” are both discrete numerical variables. library (stat20data) data (arbuthnot) Question 5 The time frame is from 1629-1710. 1
Question 6 1705 had the greatest number of children christened. library (stat20data) data (arbuthnot) library (tidyverse) -- Attaching packages --------------------------------------- tidyverse 1.3.2 -- v ggplot2 3.3.6 v purrr 0.3.4 v tibble 3.1.8 v dplyr 1.0.10 v tidyr 1.2.0 v stringr 1.4.1 v readr 2.1.2 v forcats 0.5.2 -- Conflicts ------------------------------------------ tidyverse_conflicts() -- x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag() names (arbuthnot) [1] "year" "boys" "girls" arrange ( mutate (arbuthnot,year, greatest_index = boys + girls), desc (greatest_index)) # A tibble: 82 x 4 year boys girls greatest_index <int> <int> <int> <int> 1 1705 8366 7779 16145 2 1707 8379 7687 16066 3 1698 8426 7626 16052 4 1708 8239 7623 15862 5 1697 8062 7767 15829 6 1702 8031 7656 15687 7 1701 8102 7514 15616 8 1703 7765 7683 15448 9 1706 7952 7417 15369 10 1699 7911 7452 15363 # ... with 72 more rows 2
Question 7 arrange (arbuthnot, desc (year), boys, girls) # A tibble: 82 x 3 year boys girls <int> <int> <int> 1 1710 7640 7288 2 1709 7840 7380 3 1708 8239 7623 4 1707 8379 7687 5 1706 7952 7417 6 1705 8366 7779 7 1704 6113 5738 8 1703 7765 7683 9 1702 8031 7656 10 1701 8102 7514 # ... with 72 more rows girls_christened1700 <- 7061 / 14639 The proportion of girls christened in 1700 is 0.48234 Question 8 In general, there are time periods when there are dips in the total number of children christened but the total number of children christened has steadily been increasing over the time period 1629-1710. library (stat20data) data (arbuthnot) library (tidyverse) names (arbuthnot) [1] "year" "boys" "girls" 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help