Problem 1: Comparing TWO Population

In 2017, Biology: 84,200 females took AP test out of 144,790 students Calculus: 102, 598 females took AP test out of 211,693 students 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\)

Where: \(p_1\)= proportion of biology ap test \(p_2\) = proportion of calculs ap_test

# right tail test
prop.test(
  x = c(84200, 102598),
  n = c(144790, 211693),
  alternative = "greater",
  correct = FALSE
)
## 
##  2-sample test for equality of proportions without continuity correction
## 
## data:  c(84200, 102598) out of c(144790, 211693)
## X-squared = 3235.3, df = 1, p-value < 2.2e-16
## alternative hypothesis: greater
## 95 percent confidence interval:
##  0.09409523 1.00000000
## sample estimates:
##    prop 1    prop 2 
## 0.5815319 0.4846547

conclusion: At 5% significant level, there is sufficient evidence to conclude that the proporation of female students taking teh Biology AP exam is higher than the proporation of female students taking teh AP calculus AP exam.

Problem 2: Single-Sample t-Test (Crying time of infants given Vitamin K shots)

researchers want to determine whether infants cry for a shorter time on average when help by their mothers during the Vit K shot compared to mother holding method.

regular <- c(63,0,2,46,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)

momholding <- 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)

we will perform a two sample t-test., This is a left tariled two sample t-test

# Left tail test, and CI is 99% not 95%. Why was 99% used instead of 95%?
t.test(regular,momholding, alternative = "less")
## 
##  Welch Two Sample t-test
## 
## data:  regular and momholding
## t = 0.043496, df = 56.978, p-value = 0.5173
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##      -Inf 9.701632
## sample estimates:
## mean of x mean of y 
##  35.37931  35.13333

At the 5% significance level, there is not sufficient evidence to conclude that infants cry for a shorter time on average when held by their mothers during the vitamin K shot than when regular methods are used.The data do not show a statistically significant reduction in crying time for the mother-held method.