 Write the hypothesis tests.  State the significance level (α)  p-value  State your decision.

1- 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.

Hypotheses

\(H_0\): \(p_1\) = \(p_2\)

\(H_a\): \(p_1\) > \(p_2\)

\(p_1\)= proportion of female students who took the AP biology exam

\(p_2\) = proportion of female students who took the AP calculus AB exam

Testing at 5% significance level (α)

prop.test(c(84200, 144790 ), c(102598, 211693), alternative = "greater")
## 
##  2-sample test for equality of proportions with continuity correction
## 
## data:  c(84200, 144790) out of c(102598, 211693)
## X-squared = 6531.4, df = 1, p-value < 2.2e-16
## alternative hypothesis: greater
## 95 percent confidence interval:
##  0.1341319 1.0000000
## sample estimates:
##    prop 1    prop 2 
## 0.8206788 0.6839622
  1. p-value < 2.2e-16. Statistically significant at α = 0.05.

Result: There is strong evidence that the proportion of female students taking the biology exam is higher than the proportion of female students taking the calculus AB exam.

2- 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.

conventional <- c(63, 0, 2, 46, 33, 29, 23, 11, 12, 48, 33, 14, 51, 37, 24, 63, 0, 73, 39, 54, 39, 34, 30, 55, 58 )

new_methods <- c(0, 32, 20, 23, 14, 60, 59, 64, 64, 72, 44, 14, 10, 58, 19, 17, 5, 36, 73, 19, 9, 43, 73, 27, 25)

Hypotheses

\(H_0\): \(\mu_1\) = \(\mu_2\)

\(H_a\): \(\mu_1\) < \(\mu_2\)

\(\mu_1\) = mean time infants cried after receiving vitamin K shot when the mother held the infant prior to and during the shot

\(\mu_2\) = mean time infants cried after receiving vitamin K shot when using conventional methods

Testing at 5% significance level (α)

t.test(new_methods, conventional, alternative = "less")
## 
##  Welch Two Sample t-test
## 
## data:  new_methods and conventional
## t = 0.057156, df = 47.15, p-value = 0.5227
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##     -Inf 10.9279
## sample estimates:
## mean of x mean of y 
##     35.20     34.84

p-value = 0.5227 Not Statistically significant at α = 0.05

Result: We do not have enough evidence to show that infants who are held prior to and during the vitamin K shot cry for less time.