Question 1 : AP Test Proportions
Hypothesis Test:Let P1 be the proportion of females taking the Biology exam and P2 be the proportion of females taking the Calculus AB exam. * H(0): P1 = P2 (The proportions are the same) * H(A): P1> P2 (Biology proportion is higher)
# Data entry
females <- c(84200, 102598)
totals <- c(144790, 211693)
# 2 proportion z test
test1 <- prop.test(x = females, n = totals, alternative = "greater", correct = FALSE)
test1
##
## 2-sample test for equality of proportions without continuity correction
##
## data: females out of totals
## 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, we Reject the null hypothesis.
Conclusion: There is sufficient evidence at the 5% level to show that the proportion of female students taking the biology exam is higher than the proportion taking the calculus AB exam.
Question 2 : Infant Crying Times
Hypothesis Test:Let Mu1 be the mean crying time for the conventional method and Mu2 be the mean for the “mother-held” method. * H(0): Mu1=Mu2 (There is no difference in average crying time)
# Conventional Method Data
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)
# New Methods (Mother Held) Data
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)
# Independent two-sample t-test (Welch's t-test)
test2 <- t.test(held, conv, alternative = "less")
test2
##
## 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: Since the p-value is greater than 0.05, we Fail to reject the null hypothesis.
Conclusion: There is not enough evidence at the 5% level to show that infants cry less on average when held by their mothers compared to conventional methods.