Q1 - Difference in Proportions (Biology Female prop versus Calculus Female prop)

\(H_0\): \(p_{bio}\) = \(p_{calc}\)

\(H_a\): \(p_{bio}\) > \(p_{calc}\)

# Data
bio_total   <- 144790
bio_female  <- 84200
calc_total  <- 211693
calc_female <- 102598

# Two-proportion z-test
prop.test(
  x = c(bio_female, calc_female),
  n = c(bio_total, calc_total),
  alternative = "greater",
  correct = FALSE
)
## 
##  2-sample test for equality of proportions without continuity correction
## 
## data:  c(bio_female, calc_female) out of c(bio_total, calc_total)
## X-squared = 3235.3, df = 1, p-value < 2.2e-16
## alternative hypothesis: greater
## 95 percent confidence interval:
##  0.09409523 1.00000000
## sample estimates:
##    prop 1    prop 2 
## 0.5815319 0.4846547

Decision:

Since the p-value is less than 0.05 (p-value < 2.2e-16), we reject \(H_0\). There is strong evidence that the proportion of female students taking the Biology AP exam is higher than the proportion taking the Calculus AB AP exam.

Q2 – Difference in Means (Conventional vs. Held by Mother)

\(H_0\): \(\mu_{held}\) = \(\mu_{conv}\)

\(H_a\): \(\mu_{held}\) < \(\mu_{conv}\)

# Crying times (seconds)

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

held <- 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(held, conv, alternative = "less", var.equal = FALSE)
## 
##  Welch Two Sample t-test
## 
## data:  held and conv
## 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

Decision:

The p-value (= 0.4881) is greater than 0.05, so we fail to reject \(H_0\). There is not enough evidence to conclude that infants cry less when held by their mothers compared to conventional handling.