Tests of inference about 2 population means Outline Tests of inference about 2 population means Independent vs. dependent groups Large sample, independent groups Z test Small sample, independent groups Test of equality of population variances If variances are equal, t-test Independent Samples
Tests of Inference about 2 population means Sometimes, we want to know how 2 population means compare with each other. To begin this procedure we ask 2 questions: Are the samples large or small? (n < 30 small) Are the samples independent of each other? Independent Samples
Independent vs. dependent samples Sometimes, observations in two samples are tied together in some way: E.g., same subjects tested twice, or subjects matched on some variable (IQ, age, education…) In that case, we have dependent pairs – our topic two weeks from today. When observations are not tied in any way, we have independent pairs. Independent Samples
Four tests we’ll use this month 1a. Large samples, independent groups 1b. Small samples, independent groups 2a. Large samples, dependent pairs 2b. Small samples, dependent pairs Independent Samples
1a. Large samples, independent groups We want to answer a question about the difference between two population means, 1 – 2. As usual, we do this by taking samples and measuring their means comparing those sample means Independent Samples
3. Make inference back to population Inferred Population 3. Make inference back to population 2. Measure sample Known Sample 1. Draw sample The logic of the single sample test Independent Samples
Population 1 μ1 Population 2 μ2 μ1 – μ2 This time, we’re interested in the difference between two population means: μ1 – μ2.
The difference between two population means: μ1 – μ2: We learn about this population difference by testing the difference between two sample means: X1 – X2 Sample 1 Sample 2 X1 – X2 Independent Samples
Logic of the two sample test Inferred Population 1 Population 2 μ1 – μ2 Sample 1 Sample 2 X1 – X2 Known Logic of the two sample test
1a. Large samples, independent groups Our null hypothesis is typically that there is no difference between the two population means. Sometimes we’ll hypothesize that a historical, non-zero difference still holds. Either way, we use the sampling distribution of the difference . X1 X2 ( ) Independent Samples
1a. Large sample, independent groups X1 X2 ( ) The sampling distribution of is approximately normal for large n, by C.L.T. This result is directly analogous to result for tests of hypothesis respecting a single sample mean. Independent Samples
1a. Large samples, independent groups The mean of the sampling distribution of the difference is . Because the samples are independent, (X1–X2) = 12 22 n1 n2 X1 X2 ( ) (1 – 2) Independent Samples
The C.I. for the difference between two population means is: Confidence Interval: The C.I. for the difference between two population means is: ± Zα/2 (x1 – x2) = ± Zα/2 12 22 n1 n2 X1 X2 ( ) X1 X2 ( ) Independent Samples
Z test H0: 1 – 2 = D0 H0: 1 – 2 = D0 HA: 1 – 2 > D0 HA: 1 – 2 ≠ D0 or: 1 – 2 < D0 Test statistic: Z = – D0 X1 X2 ( ) D0 is the historical value of the difference between population means, typically but not always 0. 12 22 n1 n2 Independent Samples
One-tailed: Two-tailed: Z > Zα │Z│ > Zα/2 or Z < -Zα Z test Rejection region: One-tailed: Two-tailed: Z > Zα │Z│ > Zα/2 or Z < -Zα Independent Samples
1b. Small samples, independent groups We now turn to the case of comparing means for two independent, small samples (ns < 30). There are 2 ways to do this – depending upon whether the two population variances are equal or different. In order to know which method we should use, we have to test the hypothesis H0: 12 = 22 So for small, independent samples, there are always 2 steps– test the variances, then test the means. Independent Samples
1b. Small samples, independent groups VERY IMPORTANT POINT: We can only use the independent groups t-test when the two population variances are equal. We must not assume that 12 = 22. We must test H0: 12 = 22. The test of hypothesis about the two population variances uses the ratio F= (12 / 22). Independent Samples
1b. Small samples, independent groups On an exam, you must test the hypothesis of equal variances before doing the independent groups t-test! If H0: 12 = 22 is rejected, we use the Wilcoxon Rank Sum test instead of the t-test (our subject next week). Note: before t-test only; not before Z test. Independent Samples
Test of hypothesis of equal variances Notes: Next slide shows a formal statement of test of hypothesis about two population variances. Both one-tailed and two-tailed tests are shown. When you test equality of variances before doing small sample, independent groups t-test, always do a two-tailed test. One-tailed test of equality of variances has other uses. Independent Samples
Test of hypothesis of equal variances H0: 12 = 22 H0: 12 = 22 HA: 12 < 22 HA: 12 ≠ 22 or 12 > 22 Test statistic: F = S12 S22 Independent Samples
Test of hypothesis of equal variances Rejection region for the one tailed test: Fobt > F ((n1 – 1), (n2 – 1,) Fcritical is obtained from the table, with numerator d.f., denominator d.f., and Note: For the one tailed-test, you can put either variance in the numerator, but if you put the smaller variance in the numerator then you have to use the lower tail critical value of F, which is computed as on slide 23. If you put larger variance in the numerator then use F with (num d.f., denom. d.f., ) Independent Samples
An example of an F distribution α Problem: how do we obtain the lower-tail critical value of ? The given in the F table is the value for the upper tail. Since the F distribution is not symmetric, we have to compute critical F for lower tail. Independent Samples
Computing critical F values for lower tail Critical F for upper tail of distribution is found in Table VII, using α/2 and d.f. Critical F for lower tail of distribution: 1 Fα/2, n2-1, n1-1 Note that d.f. are inverted! Independent Samples
Test of hypothesis of equal variances Rejection region for the two tailed test: Fobt < 1 F(n2-1,n1-2,/2) or Fobt > F(n1-1, n2-1,/2) Note the reversed d.f. For the two sided test, you reject H0 if either Fobt is smaller than the lower-tail critical F (the reciprocal) or larger than the upper tail critical F. Independent Samples
1b. Small samples, independent groups Now – back to our t-test. If you do NOT reject H0 in the test of equality of variances, then you can pool the two sample variances: Sp2 = (n1-1)s12 + (n2-1)s22 n1 + n2 - 2 Pooling the sample variances makes no sense if you have just demonstrated that they are unequal (e.g., you have just rejected the null hypothesis in your test of the equality of the variances). Independent Samples
1b. Small samples, independent groups H0: 1 – 2 = D0 H0: 1 – 2 = D0 HA: 1 – 2 > D0 HA: 1 – 2 ≠ D0 or: 1 – 2 < D0 Test statistic: t = – D0 X1 X2 ( ) Sp2 1 1 n1 n2 ( ) Independent Samples
1b. Small samples, independent groups Rejection region: One-tailed: Two-tailed: t < -tα │t│>tα/2 or t > tα With tα and tα/2 based on df = n1 + n2 – 2 Independent Samples
Example 1a This is a question about the sampling distribution of the difference, . The question is, how likely is a value of less than 194.0? What is 1 – 2? To get 1 – 2, we subtract population means: 546.9 – 342.5 = 204.4 X1 X2 ( ) X1 X2 ( ) Independent Samples
The mean of the sampling distribution of the difference between the means (X1 – X2) is the difference between the population means, 546.9 – 342.5 = 204.4 194 204.4 Independent Samples
194 204.4 The question asks, what is the probability that our sample difference (X1 – X2) is < 194? Independent Samples
Example 1a (X1-X2) = = 900 1225 50 70 = 5.958 12 22 n1 n2 = 900 1225 50 70 = 5.958 12 22 n1 n2 Independent Samples
Example 1a Z = 194 – 204.4 = -10.4 5.958 5.958 = -1.75 P(Z < -1.75) = .5 - .4599 = .0401 Independent Samples
From Table .0401 .4599 194 204.4 Independent Samples
Example 1b First – compute mean # of bold-faced words in each discipline’s text: XP = 14396 = 449.875 32 XS = 19897 = 497.425 40 Independent Samples
Example 1b 12 22 H0: S – P = 204.4 HA: S – P < 204.4 Rejection region: Zobt < Zcrit = -3.08 (α < .001) = 900 1225 = 7.665 32 40 12 22 n1 n2 Independent Samples
Example 1b Zobt = (497.425 – 449.875) – 204.4 7.665 = -20.46 Decision: reject H0 – the difference in # of bold-faced words in P & S texts is decreasing. Independent Samples
Example 1c The difference S - P = 90% of 204.4 which is 183.96. H0: S – P = 204.4 HA: S – P < 204.4 Independent Samples
Fail to reject B Reject 204.4 A 183.96 Independent Samples
Example 1c What is the critical value of XS – XP? Zcrit = -1.645 = (XS – XP) – 204.4 7.665 XS – XP = 191.79 For XS – XP > 191.79, do not reject H0. Independent Samples
Example 1c Z = 191.79 – 183.96 = 1.02 7.665 P(Z ≥ 1.02) = .5 – .3461 = .1539. Probability you fail to reject H0 even though mean difference has decreased from 204.4 to 183.96 is .1539. Independent Samples
Example 2 First, we have to test the hypothesis of the equality of the variances: S21 = 7646 - 7426.286 = 219.71 6 6 = 36.62 Independent Samples
Fobt < 1 or Fobt > F(6,7,.025) F(7,6,.025) Example 2 S22 = 12992 - 12800 = 192 7 7 = 27.43 Rejection region: Fobt < 1 or Fobt > F(6,7,.025) F(7,6,.025) Independent Samples
Example 2 Rejection region: Fobt < 1 or Fobt > 5.70 5.12 Independent Samples
Example 2 F = 36.62 = 1.335 27.43 Do not reject H0 – we can now do the t-test of our hypothesis about the difference between customers at the two types of stores. Independent Samples
( ) Example 2 H0: 1 – 2 = 0 HA: 1 – 2 > 0 Test statistic: t = – 0 X1 X2 ( ) Sp2 1 1 n1 n2 ( ) Independent Samples
Example 2 X1 = 228/7 = 32.57 X2 = 320/8 = 40.0 S2P = (n1 – 1)*S21 + (n2 – 1)*S22 n1 + n2 – 2 Independent Samples
Example 2 S2P = 6 (36.62) + 7 (27.43) 7 + 8 – 2 = 219.72 + 192.01 13 = 31.67 Independent Samples
Example 2 Rejection region: tobt > tcrit = t(13, .05) = 1.771 √31.67 * (1/7 + ⅛) √8.483 Independent Samples
Example 2 t = 7.43 = 2.55 2.913 Decision: Reject H0 – there is evidence that people who shop at membership-required stores spend more on average than people who shop at no-membership-required stores. Independent Samples
12 22 (1 – 2) n1 n2 X1 X2 ( ) 12 22 n1 n2 Independent Samples