Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 17 Comparing Multiple Population Means: One-factor ANOVA.

Similar presentations


Presentation on theme: "Chapter 17 Comparing Multiple Population Means: One-factor ANOVA."— Presentation transcript:

1 Chapter 17 Comparing Multiple Population Means: One-factor ANOVA

2 What if we have more than 2 conditions/groups? Interest - the effects of 3 drugs on depression - Prozac, Zoloft, and Elavil Select 24 people with depression, randomly assign (blindly) to one of four conditions: 1) Prozac, 2) Zoloft, 3) Elavil, and 4) Placebo After 1 month of drug therapy, we measure depression

3 Research Design and Data ProzacZoloftElavilPlacebo 10 14 19 21 8 12 15 27 15 18 14 20 12 16 16 23 9 13 18 15 6 17 20 22

4 Multiple t-tests? Differences between drugs? Prozac vs. ZoloftProzac vs. Elavil Prozac vs. PlaceboZoloft vs. Elavil Zoloft vs PlaceboElavil vs. Placebo 6 separate t-tests

5 Probability Theory (Revisited) The probability of making a correct decision when the null is false is 1 - α (generally.95) Each test is independent The probability of making the correct decision across all 6 tests is the product of those probabilities or, (.95)(.95)(.95)(.95)(.95)(.95) =.735

6 Type 1 error & multiple t-tests Thus, the probability of a type 1 error is not α, but 1 - (1 - α) C, where C is the number of comparisons Or, in the present case 1 -.735 =.265

7 t statistic as a ratio obtained difference t = ———————————————— difference expected by chance (“error”) Easy – Pool Variance Hmmm…

8 Differences in the t test M 1 – M 2 or M D Can we subtract multiple means from one another? M 1 – M 2 – M 3 – M 4 = ???? M 4 – M 1 – M 2 – M 3 = ???? Is there another statistic that tells us how much things differ from one another?

9 What statistic describes how scores differ from one another? Variance How do a set a means differ from one another? Answer – variance between means/groups

10 t statistic as a ratio obtained difference t = ———————————————— difference expected by chance (“error”) variance between means/groups t = ———————————————— pooled variance

11 F statistic between-groups variance estimate F = —————————————— within-groups variance estimate Mean-square Treatment (MST or MSB) s 2 B F = ———————————————— = — Mean-square Error (MSE or MSW) s 2 W

12 ANOVA Analysis of Variance, or ANOVA, allows us to compare multiple group means, without compromising α And, even though an ANOVA uses variances and the F statistic, it helps test hypotheses about means

13 F statistic Between-groups variance (MST or MSB) is based on the variability between the groups Within-groups variance (MSE or MSW) is a measure of the variability within the groups –if there is no difference between these 2 measure of variability (due to no differences between groups), F will be close to 1 –if there is greater variability between-groups (due to differences between groups), F will be greater than 1

14 Between-groups variance (MST, MSB or s 2 B ) k groups where M i is the mean of the i th group, and M G is the grand mean (the mean of all scores)

15 Within-groups variance (MSE, MSW, or s 2 W ) k groups

16 SST (Sums of Squares Total) The sums of squares total can be used either as a check, or to calculate SSW

17 An ANOVA Table The results of an ANOVA are often presented in a table: Source SS df MSF Between Within Total

18 An ANOVA Table The results of an ANOVA are often presented in a table: Source SS df MSF Between 180 2 90.0 36.00 Within 30 12 2.5 Total 210 14

19 Procedure for Completing an ANOVA 1. Arrange Data by Group 2.Compute for each group (k groups): Σx Σx 2 M SS(x) n

20 Procedure for Completing an ANOVA 3.Compute the grand mean ( M G ), by adding all the scores and dividing by N M G = Σx/N 4.Compute SSB = Σ n i ( M i - M G ) 2 5.Compute SSW SSW = SS(x 1 ) + SS(x 2 ) + ···+ SS(x k ) 6. Compute SST = Σx 2 - (Σx) 2 /N

21 Procedure for Completing an ANOVA 7.Compute df df B = k - 1 df W = N - k df T = N -1 8.Fill in ANOVA table 9.Compute MS (SS/df) 10.Compute F = MSB/MSW

22 1. ANOVA Calculations ProzacZoloftElavilPlacebo 10 14 19 21 8 12 15 27 15 18 14 20 12 16 16 23 9 13 18 15 6 17 20 22

23 2. ANOVA Calculations Prozac (Group 1) 10ΣX 1 = 50 8ΣX 1 2 = 650 15M 1 = 10 12 SS(X 1 ) = 50 9n 1 = 6 6

24 2. ANOVA Calculations Zoloft (Group 2) 14ΣX 2 = 90 12ΣX 2 2 = 1378 18M 2 = 15 16 SS(X 2 ) = 28 13n 2 = 6 17

25 2. ANOVA Calculations Elavil (Group 3) 19ΣX 3 = 102 15ΣX 3 2 = 1762 14M 3 = 17 16 SS(X 3 ) = 28 18n 3 = 6 20

26 2. ANOVA Calculations Placebo (Group 4) 21ΣX 4 = 128 27ΣX 4 2 = 2808 20M 4 = 21.33 23 SS(X 4 ) = 77.33 15n 4 = 6 22

27 3. ANOVA Calculations M G = Σx/N =(ΣX 1 + ΣX 2 + ΣX 3 + ΣX 4 )/ (n 1 +n 2 +n 3 +n 4 ) = (60+90+102+128)/(6+6+6+6) = 380/24 = 15.83

28 4. ANOVA Calculations SSB = Σ n i ( M i - X G ) 2 = 6(10 - 15.83) 2 + 6(15 - 15.83) 2 + 6(17 - 15.83) 2 + 6(21.33 - 15.83) 2 = 6(34.03) + 6(.69) + 6(1.36) + 6(30.25) = 204.18 + 4.14 + 8.16 + 181.5 = 398.00

29 5. ANOVA Calculations SSW = SS(X 1 ) + SS(X 2 ) + ···+ SS(X k ) = 50 + 28 + 28 + 77.33 = 183.33

30 6. ANOVA Calculations SST = ΣX 2 - (ΣX) 2 /N = (650 + 1378 + 1762 + 2808) - (60 + 90 + 102 + 128) 2 /24 = 6598 - 144400/24 = 6598 - 6016.67 = 581.33

31 Check SST = SSB + SSW 581.33 = 398 + 183.33 581.33 = 581.33

32 7. ANOVA Calculations df B = k -1 = 4 -1 = 3 df W = N - k = 24 - 4 = 20 df T = N - 1 = 23

33 8. ANOVA Calculations Source SSdf MSF Between 398.00 3 Within 183.3320 Total 581.3323

34 8. ANOVA Calculations Source SSdf MSF Between 398.00 3 132.67 Within 183.3320 9.17 Total 581.3323

35 8. ANOVA Calculations Source SSdf MSF Between 398.00 3 132.67 14.47 Within 183.3320 9.17 Total 581.3323

36 8. ANOVA Calculations Source SSdf MSF Between 398.00 3 132.67 14.47 Within 183.3320 9.17 Total 581.3323

37 Hypothesis test of Anti-depressants 1. State and Check Assumptions –About the population Normally distributed? - don’t know Homogeneity of variance – we’ll check – About the sample Independent Random sample? – yes Independent samples –About the sample Interval level

38 Hypothesis test of Anti-depressants 2.Hypotheses H O : μ Prozac = μ Zoloft = μ Elavil = μ Placebo H A : the null is wrong

39 That’s an Odd H A You might think that the alternative hypothesis should look like this: H A : μ Prozac ≠ μ Zoloft ≠ μ Elavil ≠ μ Placebo Accepting this alternative indicates that all of the means are unequal, which is not what ANOVA determines

40 What does ANOVA determine? That at least one of the means is different than at least one other mean Since, that is a difficult statement to write, we say “the null is wrong”

41 Hypothesis test of Anti-depressants 3.Choose test statistic –4 groups independent samples One-factor ANOVA

42 Hypothesis test of Anti-depressants 4.Set Significance Level α =.05 Critical Value Non-directional Hypothesis with df B = k – 1 and df W = N – k df B = 3 and df W = 21 From Table D F crit = 3.07, so we reject H O if F ≥ 3.07

43 Hypothesis test of Anti-depressants 5.Compute Statistic Source SSdf MSF Between 398.00 3 132.67 14.47 Within 183.3320 9.17 Total 581.3323

44 Hypothesis test of Anti-depressants 6. Draw Conclusions –because our F falls within the rejection region, we reject the H O, and –conclude that at least one medicine is better than at least one other medicine in treating depression

45 Violations of Assumptions As with t-tests, ANOVA is fairly ROBUST to violations of normality and homogeneity of variance, but IF there are severe violations of these assumptions, Use a Kruskal-Wallis H test (a non- parametric alternative)

46 Procedure for completing a Kruskal-Wallis H 1.Arrange data in columns, 1 group per column, skipping columns between groups 2.Rank all the scores, assigning the lowest rank (1) to the lowest score (put ranks in the column next to the raw scores) 3.Sum the ranks in each column (ΣT j ) 4.Square the sum of the ranks of each column (ΣT j ) 2

47 Procedure for completing a Kruskal-Wallis H test 5.Compute SSB 6.Compute H

48 Procedure for completing a Kruskal-Wallis H test 6. Compute df = k - 1 7.H is distributed as a χ 2 –Look up critical value in χ 2 (chi-square) table with appropriate df

49 Dependent Samples (more than 2 conditions) Experiments are often conducted comparing more than 2 conditions –ANOVA –Kruskal-Wallis H Samples are often related - “dependent samples” (within-subjects, repeated measures, etc.)

50 Dependent Samples ANOVA SS(T) = SS(B) + SS(Bl) + SS(E) Calculate SS(T), SS(B), and SS(Bl) SS(E) = SS(T) - SS(B) - SS(Bl)

51 Why “Blocks”? A dependent samples ANOVA is sometimes referred to as a “Randomized-Block” design Each group of related measurements, either within-subject, or with matching, is a “Block” of measurements

52 SS(Bl) Sum of Squares Blocks - the sum of the squared deviations of each block mean from the grand mean SS(Bl) = Σk( M i - M G ) 2, or SS(Bl) = ΣBl 2 /k - N( M G 2 ), where Bl = sum of the scores in a block

53 Procedure for Completing A dependent samples ANOVA 1.Arrange data where columns are conditions, rows are blocks (subjects or matched-subjects) 2.Compute for each column (conditions) n ΣX ΣX 2 M SS(X) s 2

54 Procedure for Completing A dependent samples ANOVA 3.Total the scores in the rows in a new column to the right (Block Totals) 4. Square the block totals in the next column 5. Compute the grand mean ( M G ), by adding all the scores and dividing by N M G = ΣX/N 6.Compute SS(B) = Σ n i ( M i - M G ) 2

55 Procedure for Completing A dependent samples ANOVA 7.Compute SS(T) = ΣX 2 - NM G 2 8.Compute SS(Bl) = ΣBl 2 /k – NM G 2 9.Compute SS(E) = SS(T) - SS(B) - SS(Bl) 10.Compute df df B = k - 1 df Bl = n - 1 df E = (N - k) - (n - 1) df T = N -1

56 Procedure for Completing A dependent samples ANOVA 11. Fill in ANOVA table 12.Compute MS (SS/df) 13.Compute F = MSB/MSE

57 Dependent Samples ANOVA table Source SS df MSF Between Blocks Error Total

58 Example A researcher is interested in the effects of three new sleep-aids, Sleep E-Z, Zonked, and NockOut He selects 5 subjects and they take each of the 3 new drugs in a random order The number of hours slept per night on each of the new sleep-aids is recorded

59 Data SubjectSleep E-Z ZonkedNockOut 165 8 2567 3669 4776 5458

60 Hypothesis Test – Sleep aids 1. State and Check Assumptions –Population Normally Distributed – not sure, assume for time being H of V – not sure, but we’ll check sample variances –Sample Dependent samples Random assignment –Data Interval/Ratio

61 Hypothesis Test – Sleep aids 2. State Null and Alternative Hypotheses H O : μ 1 = μ 2 = μ 3 (the population means are equal) H A : H O is wrong (at least one of the means differs, can’t say “μ 1 ≠ μ 2 ≠ μ 3 ” because this means “all the means differ from one another”)

62 Hypothesis Test – Sleep aids 3. Choose Test Statistic –Parameter of interest – means –Number of Groups – 3 –One factor (or IV being manipulated) –Dependent Samples One-factor ANOVA for Dependent Samples (F)

63 Hypothesis Test – Sleep aids 4. Set Significance Level α =.05 F = MSB/MSE, df B = k – 1, df E = (N – k) – (n – 1), where N = total number of obs, k = number of groups/conditions, n = number of subs/blocks df B = 3 –1 = 2, df E = (15 – 3) – ( 5 – 1) F crit (2, 8) = 4.46 If our F ≥ 4.46, we Reject H O

64 Hypothesis Test – Sleep aids 5. Compute test Statistic

65 Computations SubS E-ZZNO 1658 2567 3669 4776 5458

66 SubS E-ZZNO 1658 2567 3669 4776 5458 n555 ΣX282938 ΣX 2 162171294 M5.65.87.6 SS(X)5.22.85.2 s 2 1.30.71.3 – H of V Otay!

67 SubS E-ZZNOBl 1658 19 256718 366921 477620 545817 n555 ΣX282938 ΣX 2 162171294 M5.65.87.6 SS(X)5.22.85.2 s 2 1.30.71.3

68 SubS E-ZZNOBl Bl 2 1658 19361 256718324 366921441 477620400 545817289 N555 ΣBl 2 = 1815 ΣX282938 ΣX 2 162171294 M5.65.87.6 SS(X)5.22.85.2 s 2 1.30.71.3

69 Computations M G = ΣX/N = (28 + 29 + 38) / (15) = 6.333

70 Computations SS(B) = Σ n i ( M i - M G ) 2 = 5(5.6 - 6.33) 2 + 5(5.8 - 6.33) 2 + 5(7.6 - 6.33) 2 = 12.133

71 Computations SS(T) = Σ X 2 - (Σ X) 2 /N = (162 + 171 + 294) - (28 + 29 + 38) 2 /15 = 627 - 601.66 = 25.33

72 Computations SS(Bl) = ΣBl 2 /k - N( M G 2 ) = (361 + 324 + 441 + 400 + 289)/3 - 15(6.33) 2 = 1815/3 - 601.66 = 3.33

73 Computations SS(E) = SS(T) - SS(B) - SS(Bl) = 25.33 - 12.13 - 3.33 = 9.87

74 Computations df B = k - 1 = 3 - 1 = 2 df Bl = n - 1 = 5 - 1 = 4 df E = (N - k) - (n - 1) = (15 - 3) - (5 - 1) = 12 - 4 = 8 df T = N -1 = 15 -1 = 14

75 Computations Source SSdf MSF Between 12.132 Blocks 3.334 Error 9.878 Total 25.3314

76 Computations Source SS df MSF Between 12.132 6.07 Blocks 3.334.83 Error 9.878 1.23 Total 25.3314

77 Computations Source SS df MSF Between 12.132 6.07 4.93 Blocks 3.334.83 Error 9.878 1.23 Total 25.3314

78 Hypothesis Test 6. Draw Conclusions –Since our F > 4.46, we Reject H O, accept H A –And conclude that the at least one of the medications resulted in more sleep than the others

79 Dependent samples ANOVA What if we violate one of the assumptions? Friedman test –means (or distribution) are of interest –more than 2 groups/conditions –dependent samples –concerns about normality, homogeneity of variance, etc.

80 Friedman F r 1.Arrange data in columns, 1 group/condition per column, (conditions = columns = k) 2. Place correlated measures (matched, repeated, etc.) across conditions in the same rows (n rows) 3.Rank the scores in each row from 1 to k, assigning the lowest rank (1) to the lowest score (put ranks in the column next to the raw scores)

81 Friedman (continued) 4. Sum the ranks of each column (ΣT k ) 5. Compute the mean of the Ts, T 6. Compute S

82 Friedman (continued) 7. Compute the Friedman test statistic F r 8. Compute df = k-1 9. Look up critical value in Χ 2 table or use Excel to find p


Download ppt "Chapter 17 Comparing Multiple Population Means: One-factor ANOVA."

Similar presentations


Ads by Google