
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

∑n i=1 Xi/n^ and^ pˆ^2 =^
∑m j=1 Yj^ /m.
Var(ˆp 1 − pˆ 2 ) =
p 1 (1 − p 1 ) n
p 2 (1 − p 2 ) m
H 0 : p 1 = p 2 vs. H 1 : p 1 6 = p 2 :
pˆ 1 − ˆp 2 − E(ˆp 1 − pˆ 2 ) √ Var(ˆp 1 − pˆ 2 )
Example 1. 10 students took two midterm exams. Student ‖ 01 02 03 04 05 06 07 08 09 10 Midterm 1‖ 80 75 60 90 99 60 55 85 65 70 Midterm 2‖ 70 60 70 72 95 66 60 80 70 60 Is the first exam easier than the second exam? Test it at level 0.05. Solution. Let Xi and Yi be the first and the second midterm scores for the i-th student. Perform the t-test on H 0 : μY − μX = 0 based on observations Yi − Xi.
x<-c(80, 75, 60, 90, 99, 60, 55, 85, 65, 70) y<-c(70, 60, 70, 72, 95, 66, 60, 80, 70, 60) t.test(y-x, conf.level=0.95) One Sample t-test data: y - x t = -1.1739, df = 9, p-value = 0.2706 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -10.537282 3.
Example 2. Is it harmful to use Marijuana when mothers are pregnant?
User Nonuser Sample size 1246 11, Birth defects 42 294 Solution. Let p 1 and p 2 be the birth defect proportions among Marijuana users and non users. The hypothesis we are testing is H 0 : p 1 = p 2 vs. H 0 : p 1 > p 2. From data pˆ 1 = 42/1246 = 0. 034 , pˆ 2 = 294/11178 =
H 0 : P 1 = p 2 vs. H 1 : p 1 6 = p 2.
Let X be the number of heads when you threw the first coin n = 100 times and Y be the number of heads when you threw the second coin m = 110 times. pˆ 1 − pˆ 2 = X/n − Y /m. Then the test statistic is Z = √ X/n−Y /m p(1−p)(1/n+1/m)
where p = p 1 = p 2. Since p is unknown, you estimate it by pooling the samples: pˆ = (x + y)/(m + n). pˆ = (40 + 50)/(100 + 110) = 0. 43 and z = − 0. 60. Since we reject H 0 if |z| is large, the P -value would be P (|Z| > 0 .6) = 2P (Z > 0 .6) = 2(1 − P (Z ≤ 0 .6)) = 2(1 − 0 .73) = 0. 54. So we do not reject H 0 at any level smaller than 0.5.
Example 9.9, 9.11. Note: Starting lecture 19, we will jump to Chapter 12 and study linear regressions.