Hypothesis
\(p_1\) = Proportion of female students taking the biology AP exam \(p_2\) = Proportion of female students taking the Calculus AB AP exam
\(H_0\): \(p_1\) = \(p_2\)
\(H_a\): \(p_1\) > \(p_2\)
Significance level is .05
Test
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 is < 2.2e-16 which is statistically significant at α = 0.05. There is strong evidence that the proportion of female students taking the Biology exam is greater than the proportion of female students taking the Calculus AB exam
95% CI = (0.094, 1). Since 0 is outside the interval, that means the difference in means is statistically significant, showing that more females took the biology exam.
Hypothesis
\(\mu_1\) = mean crying time in infants given shots using new methods
\(\mu_2\) = mean crying time in infants given shots using conventional methods
\(H_0\): \(\mu_1\) = \(\mu_2\)
\(H_a\): \(\mu_1\) < \(\mu_2\)
Significance level is .05
Test
new_methods <- 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)
conventional_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_methods, conf.level = 0.95, alternative = "less")
##
## Welch Two Sample t-test
##
## data: new_methods and conventional_methods
## t = 0.029953, df = 57.707, p-value = 0.5119
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
## -Inf 9.468337
## sample estimates:
## mean of x mean of y
## 35.30000 35.13333
P value is 0.5119 so we fail to reject the null at α = 0.05. There is not sufficient evidence to prove that infants cried less on average when using new methods compared to conventional methods.
95% CI = (-∞, 9.468). Since 0 is within the interval, the difference in means is not statistically significant.