\(p_1\) = Proportion of students who took the AP Biology Exam that were female \(p_2\) = Proportion of students who took the AP Calculus AB Exam that were female
1:
\(H_0\): \(p_1\) = \(p_2\) \(H_a\): \(p_1\) > \(p_2\)
2: α = 0.05
3:
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 = 2.2e-16
4:
The p-value is 2.2e-16 which is significantly smaller than the α which is 0.05. Meaning that we reject the null which was the proportion of students who took the AP Biology Exam that were female was equal to the proportion of students who took the AP Calculus AB Exam that were female.
\(\mu_1\) = Mean crying time for infants given shots using conventional methods \(\mu_2\) = Mean crying time for infants given shots using new methods
1:
\(H_0\): \(\mu_1\) = \(\mu_2\) \(H_a\): \(\mu_1\) > \(\mu_2\)
2: α = 0.05
3:
conventionalm <- c(63, 29, 33, 63, 39, 0, 23, 14, 0, 34, 2, 11, 51, 73, 30, 46, 12, 37, 39, 55, 33, 48, 24, 54, 58, 33, 15, 70, 52, 18)
newm <- c(0, 60, 44, 17, 9, 32, 59, 14, 5, 43, 20, 64, 10, 36, 73, 23, 64, 58, 73, 27, 14, 72, 19, 19, 25, 19, 50, 41, 46, 18)
t.test(newm, conventionalm, alternative = "less")
##
## Welch Two Sample t-test
##
## data: newm and conventionalm
## 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
4:
The p-value is 0.4881 which is significantly larger than the α which was 0.05. This means that we fail to reject the null that the mean crying time for infants given shots using new methods is less than the mean crying time for infants given shots using conventional methods.