Problem 1

pb: proportion of female students taking the biology exam

pc: proportion of female students taking the calculus AB exam

H0: pb = pc

H1: pb > pc

Significance level (\(\alpha\)) = 0.05

#right-tailed two-proportion z-test
#bio is prop 1, calc is prop 2
prop.test(c(84200,102598), c(144790,211693), alternative = "greater")
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  c(84200, 102598) out of c(144790, 211693)
## X-squared = 3234.9, df = 1, p-value < 2.2e-16
## alternative hypothesis: greater
## 95 percent confidence interval:
##  0.09408942 1.00000000
## sample estimates:
##    prop 1    prop 2 
## 0.5815319 0.4846547

p-value: less than 2.2 * 10-16

The p-value is less than 0.05, therefore there is sufficient evidence to disprove the null hypothesis and prove the alternative hypothesis. The proportion of female students taking the AP Bio exam is higher than the proportion of female students taking AP Calculus.

Problem 2

\(\mu\)m: Average crying time of sampled infants whose mothers held them before and during their Vitamin K shot

\(\mu\)c: Average crying time of sampled infants who received Vitamin K shot using conventional methods

H0: \(\mu\)m = \(\mu\)c

H1: \(\mu\)m < \(\mu\)c

Significance level (\(\alpha\)) = 0.05

#data
conventional <- c(63, 0, 2, 46, 33, 33,
                   29, 23, 11, 12, 48, 15,
                   33, 14, 51, 37, 24, 70,
                   63, 0, 73, 39, 54, 52,
                   39, 34, 30, 55, 58, 18)

new_methods <- c(0, 32, 20, 23, 14, 19,
                  60, 59, 64, 64, 72, 50,
                  44, 14, 10, 58, 19, 41,
                  17, 5, 36, 73, 19, 46,
                  9, 43, 73, 27, 25, 18)


t.test(new_methods, conventional, alternative = "less")
## 
##  Welch Two Sample t-test
## 
## data:  new_methods and conventional
## t = -0.029953, df = 57.707, p-value = 0.4881
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##      -Inf 9.135003
## sample estimates:
## mean of x mean of y 
##  35.13333  35.30000

p-value: 0.4881

The p-value is much greater than 0.05. The p-value tells us that in about 49% of samples where the population mean crying times of both groups were the same, the sample from the new_methods group would be this much less than the conventional methods group or smaller. As such, we have sufficient evidence to confirm our null hypothesis.