This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
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 ##State hypotheses tests Ho: p1 ≤ 0.05 Ha: p1 > 0.05
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
##Conclusion p-value is < 0.05 significance level, reject the null the statistical evidence shows proportion of females taking the AP Biology exam is higher than the proportion of female students taking the calculus 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.
##hypothesis tests Ho: mu1 (mean crying time during conventional holding) Ha: mu2 (holding infant with mother)
Mother <- c(0, 32, 20, 23, 14, 19, 60, 59, 61, 72, 50, 44, 14, 10, 41, 19, 41, 17, 5, 36, 73, 19, 46, 9, 43, 27, 25, 18)
conventional <- c(63, 0,2,46,33,33,29,23,12,48,15,33,14,51,37,24,70,63,0,73,39,54,52,39,34,58,18)
t.test(Mother, conventional, alternative = "less", paired = FALSE)
##
## Welch Two Sample t-test
##
## data: Mother and conventional
## t = -0.64957, df = 52.761, p-value = 0.2594
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
## -Inf 5.727688
## sample estimates:
## mean of x mean of y
## 32.03571 35.66667
##Conclusion
Since the p-value from the t.test is 0.259, greater than α=0.05, we accept the alternative hypothesis and reject the null.
At the 0.05 significance level, it cannot be concluded that infants cry more when being held by their mothers compared to conventional methods of holding.