title: “HWK 7” output: pdf_document: latex_engine: xelatex —


Question 1: Comparing Proportions of Female Students in AP Biology vs. Calculus AB

Step 1: Write the Hypothesis Tests \(H_0\): \(p1=p2\) \(H_a\): \(p1>p2p\)

Where: \(p_1\) = proportion of female students taking the biology exam \(p_2\) = proportion of female students taking the calculus AB exam This is a right-tailed two-proportion z-test.

prop.test(
  x = c(84200, 102598),
  n = 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

α=0.05

p-value < 2.2e-16 << α=0.05

We reject The null hypothesis

Because the p-value is far smaller than 0.05, we reject \(H_0\) and conclude that the proportion of female students taking the Biology exam is significantly higher than the proportion taking the Calculus AB exam.

Question 2: Comparing Crying Times for Infants (Conventional vs. New Method)

conventional_method <- c(63, 0, 1, 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)

mother_held_infants <- 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)

\(H_0\): \(\mu_1 = \mu_2\) \(H_a\): \(\mu_1 > \mu_2\) Where: \(\mu_1\) = mean crying time for conventional method \(\mu_2\) = mean crying time for new method (held by mother)

t.test(conventional_method, mother_held_infants, conf.level = 0.99, alternative = "greater")
## 
##  Welch Two Sample t-test
## 
## data:  conventional_method and mother_held_infants
## t = 0.023933, df = 57.729, p-value = 0.4905
## alternative hypothesis: true difference in means is greater than 0
## 99 percent confidence interval:
##  -13.19687       Inf
## sample estimates:
## mean of x mean of y 
##  35.26667  35.13333

α=0.05 p=0.4905>0.05 There is not enough statistical evidence to conclude that infants who received the shot using the conventional method cried longer than those held by their mothers.