Many high school students take the AP tests in different subject areas. In 2017, of the 144,790 students who took the biology exam 84,200 of them were female. In that same year, of the 211,693 students who took the calculus AB exam 102,598 of them were female. Is there enough evidence to show that the proportion of female students taking the biology exam is higher than the proportion of female students taking the calculus AB exam? Test at the 5% level.
Hypothesis
\(H_0\): \(p_1\) = \(p_2\)
\(H_a\): \(p_1\) > \(p_2\)
Where:
\(p_1\) = proportion of female students taking the AP Bio exam
\(p_2\) = proportion of female students taking the AP Calc AB exam
α = 0.05
prop.test(c(84200, 102598), c(144790, 211693), alternative = "greater", conf.level = 0.95)
##
## 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
As the p-value = 2.2e-16 which is less than 0.05 we can reject the null. The p-value is statistically significant at α = 0.05. We are 95% confident that the difference between the proportion of female students who took the AP Bio exam and the proportion of female students who took the AP Calc AB exam is between 0.094 and 1.000. The confidence interval does not include 0 meaning there is statistical significance. We have enough evidence at a 0.05 significance level that the proportion of female students who took the AP Bio exam is greater than the proportion of female students who took the AP Calc AB exam.
A vitamin K shot is given to infants soon after birth. The study is to see if how they handle the infants could reduce the pain the infants feel. One of the measurements taken was how long, in seconds, the infant cried after being given the shot. A random sample was taken from the group that was given the shot using conventional methods, and a random sample was taken from the group that was given the shot where the mother held the infant prior to and during the shot. Is there enough evidence to show that infants cried less on average when they are held by their mothers than if held using conventional methods? Test at the 5% level.
Hypothesis
\(H_0\): \(\mu_1\) = \(\mu_2\)
\(H_a\): \(\mu_1\) > \(\mu_2\)
Where:
\(\mu_1\) = average time infant cried using conventional methods
\(\mu_2\) = average time infant cried when held by mother
α = 0.05
conventional <- 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)
mother <- 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(conventional, mother, alternative = "greater", conf.level = 0.95)
##
## Welch Two Sample t-test
##
## data: conventional and mother
## t = 0.029953, df = 57.707, p-value = 0.4881
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## -9.135003 Inf
## sample estimates:
## mean of x mean of y
## 35.30000 35.13333
As the p-value = 0.4881 which is greater than 0.05 we do not reject the null. The p-value is not statistically significant at α = 0.05. We are 95% confident that the difference between the average time infants cried using conventional methods and the average time infants cried when held by their mother is between -9.14 and infinity. The confidence interval includes 0 meaning there is no statistical significance. We do not have enough evidence at a 0.05 significance level that infants cried less on average when they are held by their mothers than if held using conventional methods.