General Method: Difference of Means 1. Calculate x 1, x 2, SE 1, SE 2. 2. Combined SE = SE1 2 + SE2 2. ASSUMES INDEPENDENT SAMPLES. 3. Calculate df: either Welch-Satterthwaite formula or simpler df = min(n 1, n 2 ) 1. 4. For a hypothesis test, t = x 1 x 2 SE ; convert to a P-value using table of t statistics 5. For a confidence interval, calculate critical value t corresponding to desired confidence level (e.g. in our example we had df = 13, confidence level 95%, led to t = 2.16). Then the confidence interval is x 2 x 1 ± t SE. 1
Example (Question 10.28, page 493) Following are the numbers of newspapers read by a sample of women and of men Women: 5,3,6,3,7,1,1,3,0,4,7,2,2,7,3,0,5,0,4,4,5,14,3,1,2,1,7,2,5,3,7 Men: 0,3,7,4,3,2,1,12,1,6,2,2,7,7,5,3,14,3,7,6,5,5,2,3,5,5,2,3,3 (a) Construct and interpret a plot comparing responses of males and females (b) Construct and interpret a 95% confidence intervals comparing populations means (c) Show the five steps of a significance test comparing populations means (d) State and check the assumptions 2
MEN WOMEN 0 2 4 6 8 10 12 14 Newspapers Read Box plot for number of newspapers read by women and by men. 3
(a) See boxplots; male and female distributions look very similar (b) With suffix 1 indicating women, 2 for men: x 1 = 3.774, x 2 = 4.414, s 1 = 2.929, s 2 = 3.100, n 1 = 31, n 2 = 29, SE = s 2 1 n + s2 2 1 n = 0.78. We have df = 57.1 according to Welch- 2 Satterthwaite formula, df = 28 by simpler formula. Based on df = 28, the critical value of t for a 95% confidence interval is t = 2.048, so the 95% confidence interval for µ 2 µ 1 is 4.414 3.774 ± 2.048 0.78 = ( 0.957, 2.237). (c) The t statistic for a hypothesis test is x 2 x 1 SE = 0.82; this is well below the critical value for a test at significance level.05 (the critical value is t = 2.048, as in part 2) so we DO NOT REJECT the null hypothesis that the means for men and women are equal. 4
(d) The assumptions require independence of the two samples (probably more or less correct); randomness of the two samples (depends on how the samples were obtained); and approximately normal distributions for the samples themselves (probably true to a reasonable approximation). 5
Paired Comparison Tests Consider the following dataset, based on the midterm and final exam scores of a recent course of mine (not STOR 151!): Student 1 2 3 4 5 6 7 8 9 10 Midterm 86 100 90 90 94 73 76 76 95 87 Final 84 95 77 83 70 76 54 81 90 84 Difference 2 5 13 7 24 3 22 5 5 3 Mean midterm score=86.7; Mean final score=79.4; Difference 7.3 Is this significant evidence of a difference? 6
We could apply the same test as previously, which would lead to x 1 = 86.7, x 2 = 79.4, s 1 = 9.06, s 2 = 11.37, 9.06 2 SE = 10 + 11.372 = 4.60, 10 86.7 79.4 t = = 1.59, 4.60 df = 9. The two-sided P-value is 0.15 this is greater than 0.05, therefore the result is not significant. However, there is an error in this calculation... 7
The two samples are not independent since they represent scores from the same students. Instead, we apply a matched pairs test: 1. Calculate the difference in scores for each student. 2. Carry out a single-sample test for the null hypothesis that the mean difference is 0. 8
Details The 10 differences 2, 5, 13, 7, 24, 3, 22, 5, 5, 3 have a mean x = 7.3 and a standard deviation s = 9.67. The standard error is 9.67 10 = 3.06. The t statistic is 7.3 3.06 = 2.39. The corresponding two-sided P-value is 0.04. Therefore, the result is statistically significant 9
Message of this example: The standard two-sample test is valid only when the two samples are independent (along with other assumptions: quantitative variables, random sampling, approximately normal distributions) When the observations are directly paired (e.g. two exam scores from the same student, two medical results from the same patient, etc.) it is possible to apply a paired comparison test instead. The main difference is a different method of computing the standard error. This has implications for both hypothesis testing and confidence interval calculations. 10
Example: Problem 10.47, page 511/512. In a study to determine whether exercise reduced blood pressure, a sample of three patients was tested, with the following results: Subject Before After 1 150 130 2 165 140 3 135 120 (a) Explain why the three before observations and the three after observations are dependent samples. (b) Find the sample mean of the before scores, sample mean of the after scores, and the sample mean of d = before after. (c) Find a 95% confidence interval for the mean difference, and interpret it. 11
(a) They are from the same subjects; it is a matched pairs design. (b) 150+165+135 3 = 150; 130+140+120 3 = 130; difference 20. (c) The three differences 20, 25, 15 have mean 20 and standard 5 2 +0+5 2 deviation 2 = 5. The standard error is 5 = 2.887. 3 Based on the t table with df = 2, the critical value of t for a 95% confidence interval is 4.303. Therefore, a 95% confidence interval for the difference is 20 ± 4.303 2.887 = (7.58, 32.42). This does not contain 0, so despite the very small sample size, the difference is statistically significant. 12