March 1, 2006, Chapter 16-17, Matched pairs and two sample tests
Due March 3rd: 15: 26, 27, 29. 15.10, 15.11, 16.1-5, 16.8-9. 16.17, 16.18, 16.20, excel lab 4. 16.21, 22, 31. Midterm II: March 3rd.
Midterm covers
• Chapter 10 – Sampling distribution – Central limit theorem • Chapter 13: Confidence intervals, known standard deviation. – How to calculate. – What confidence interval measures. – What error takes into account. • Chapter 14: Hypothesis testing, known standard deviation. – Procedure – What P -value is the probability of. – Logic of procedure: why a low P -value means “reject H0.” – Significance levels. – Statistical significance vs. practical significance. • Chapter 15: Assumptions necessary to apply techniques of 13 and 14. • Chapter 16: – The t-distributions and using Table C. – Confidence intervals, unknown standard deviation. – Hypothesis testing, unknown standard deviation.
End of chapter summaries quite useful, but need to know examples for everything in those summaries. Vocabulary: • Population, sample. • Parameter, statistic. • Population standard deviation, sample standard deviaton. • Null hypothesis, alternative hypothesis. • Test statistic. • P -value. • Significance level.
Matched pairs test
Done when comparing two different treatments to the same subjects (at different times) or to members of similar pairs of subjects. Measure difference in variable from one treatment to the other. Example: 16.3. 21 subjects worked mazes with scented and unscented masks. First one way, then the other (randomly for each subject). For each subject measure the variable: time to solve maze wearing unscented mask - time to solve wearing scented mask. • Verify that data is not strongly skewed and has no strong outliers. • µ is mean of time to solve maze wearing unscented mask minus time to solve maze wearing scented mask. H0 : µ = 0: scent makes no difference. Ha : µ > 0: scent makes it faster to solve mazes. • x = .957, s = 12.548. So ¯ t= .957 − 0 √ = .349 12.547/ 21
• P -value from t-distribution with 20 degrees of freedom is .365. • Conclusion: no evidence for decreased maze solving time. Exercise 16.35
Two sample tests
This is used when there are two treatments, but it is not sensible to compare the two treatments on the same group (or on individuals from matched pairs). Example: you wish to compare health of people who have kidney transplants with health of people who have dialysis. Matched pairs cannot be used here. Need one sample with dialysis, and another sample with organ transplants. Example: you wish to estimate the effect of a TV advertisement for a chain store on generating new customers. Run ad in some random sample of cities. Have a second random sample of cities without running ad.
Compare two population means: Need two populations. Let µ1 correspond to first population, µ2 correspond to second population. • • • • Draw SRS size n1 from first population, SRS size n2 from second population. Calculate x1, x2 and s1, s2. ¯ ¯ Let k be the smaller of n1 − 1 and n2 − 1. (Conservative choice of k) CI for µ1 − µ2 is given by using t(k)-distribution to find t∗, then
∗
(¯1 − x2) ± t x ¯
s2 s2 1 + 2 n1 n2
• To test H0 : µ1 = µ2, calculate the t statistic (k df) t= x1 − x2 ¯ ¯
s2 1 n1
+
s2 2 n2
Leeches
Example: http://www.annals.org/cgi/content/full/139/9/724 Physicians wish to measure the effectiveness of leech therapy on arthritis pain (I’m not making this up)! They took a sample of 51 patients. They assigned a group of 24 patients to receive “leech therapy,” and a control group of 27 patients to receive a conventional pain-relief therapy (diclofenac gel). One week after the leech treatment (it was one treatment lasting a little over an hour involving 4 to 6 leeches), the leech group had a mean pain index of 19.3 with a standard deviation of 12.2. After one week of the other treatment, the control group had a mean pain index of 42.4 with standard deviation of 19.7. 1. We wish to test the null hypothesis that the effect of treatment by leeches is the same as the effect of conventional treatments. So if µ1 represents the mean pain level for arthritic people treated with leeches, and µ2 represents the mean pain level for arthritic people treated with conventional treatment, we wish to test H0 : µ1 = µ2. Our alternative hypothesis is that leeches work better than conventional
treatment. So Ha : µ1 < µ2.
2. We find our statistic by doing a two sample t procedure. We calculate t= x1 − x2
s2 1 n1
+
s2 2 n2
=
19.3 − 42.4
12.22 24
+
19.72 27
= −5.0926.
3. Now we find our P -value. As before we use the t(k) distribution where k is one less than the smaller of the two sample sizes. So here k = 23. (Conservative choice of k) So the probability P (t ≤ −5.0926) = .000019. 4. Our conclusion is that this result is significant at almost any significance level, since the P -value is smaller than almost any α we could imagine taking. (Less than α = .05, less than α = .01, less than α = .001.)
Actual degrees of freedom on two sample t-test
The distribution of the two-variable t statistic is well approximated by the distribution t(df ) where
s2 s2 2 1 ( n1 + n2 ) 2 . s2 2 s2 2 1 1 1 2 n1 −1 ( n1 ) + n2 −1 ( n2 )
df =
This approximation is good when both n1, n2 ≥ 5. For example, in our example with the leeches,
12.22 19.72 2 ( 24 + 27 ) 2 1 12.22 2 1 ( 24 ) + 26 ( 19.7 )2 23 27
df =
= 44.0138.
This gives an even smaller P -value of .00000355 for that example.