Presentation is loading. Please wait.

Presentation is loading. Please wait.

Two-Way Balanced Independent Samples ANOVA Computations Contrasts Confidence Intervals.

Similar presentations


Presentation on theme: "Two-Way Balanced Independent Samples ANOVA Computations Contrasts Confidence Intervals."— Presentation transcript:

1 Two-Way Balanced Independent Samples ANOVA Computations Contrasts Confidence Intervals

2 Partitioning the SS total The total SS is divided into two sources –Cells or Model SS –Error SS –The model is

3 Partitioning the SS cells The cells SS is divided into three sources –SS A, representing the main effect of factor A –SS B, representing the main effect of factor B –SS AxB, representing the A x B interaction These sources will be orthogonal if the design is balanced (equal sample sizes) –They sum to SS cells –Otherwise the analysis gets rather complicated.

4 Gender x Smoking History Cell n = 10,  Y 2 = 145,140

5 Computing Treatment SS Square and then sum group totals, divide by the number of scores that went into each total, then subtract the CM.

6 SS cells and SS error SS error is then SS total minus SS Cells = 26,115 ‑ 15,405 = 10,710.

7 SS gender and SS smoke

8 SS Smoke x Gender SS interaction = SS Cells  SS Gender  SS Smoke = 15,405 ‑ 9,025 ‑ 5,140 = 1,240.

9 Degrees of Freedom df total = N - 1 df A = a - 1 df B = b - 1 df AxB = (a - 1)(b -1) df error = N - ab

10 Source Table

11 Simple Main Effects of Gender SS Gender, never smoked SS Gender, stopped < 1m SS Gender, stopped 1m ‑ 2y

12 Simple Main Effects of Gender SS Gender, stopped 2y - 7y SS Gender, stopped 7y ‑ 12 y

13 Simple Main Effects of Gender MS = SS / df; F = MS effect / MSE MSE from omnibus model = 119 on 90 df

14 Interaction Plot

15 Simple Main Effects of Smoking SS Smoking history for men SS Smoking history for women Smoking history had a significant simple main effect for women, F(4, 90) = 11.97, p <.001, but not for men, F(4, 90) = 1.43, p =.23.

16 Multiple Comparisons Involving A Simple Main Effect Smoking had a significant simple main effect for women. There are 5 smoking groups. We could make 10 pairwise comparisons. Instead, we shall make only 4 comparisons. We compare each group of ex-smokers with those who never smoked.

17 Female Ex-Smokers vs. Never Smokers There is a special procedure to compare each treatment mean with a control group mean (Dunnett). I’ll use a Bonferroni procedure instead. The denominator for each t will be:

18 See Obtaining p values with SPSSSee Obtaining p values with SPSS

19 Multiple Comparisons Involving a Main Effect Usually done only if the main effect is significant and not involved in any significant interaction. For pedagogical purposes, I shall make pairwise comparisons among the marginal means for smoking. Here I use Bonferroni, usually I would use REGWQ.

20 Bonferroni Tests, Main Effect of Smoking c = 10, so adj. criterion =.05 / 10 =.005. n’s are 20: 20 scores went into each mean.

21 Smoking HistoryMean < 1 m25.0 A 1m - 2y28.5 AB 2y - 7y35.0 BC 7y - 12y39.0 CD Never45.0 D Means sharing a superscript do not differ from one another at the.05 level. Results of Bonferroni Test

22 Interaction Contrasts 2 x 2 Coefficients must be doubly centered Sum to zero in every row and every column Consider a 2 x 2, for which there is only one interaction contrast.

23 (A 1 B 1 + A 2 B 2 ) – (A 1 B 2 + A 2 B 1 ) –One diagonal versus the other.  Rearranging terms, (A 1 B 1 - A 2 B 1 ) – (A 1 B 2 - A 2 B 2 ) –Effect of A at B 1 versus effect of A at B 2 (A 1 B 1 - A 1 B 2 ) – (A 2 B 1 - A 2 B 2 ) –Effect of B at A 1 versus effect of B at A 2 Coefficients B1B1 B2B2 A1A1 1 A2A2 1

24 SAS Code AB cells (level of A, level of B) are 11, 12, 21, 22 Proc GLM; Class Cell; Model Y=Cell; CONTRAST 'A x B' Cell 1 -1 -1 1; This will produce the interaction SS.

25 2 x 3  Two Interaction df

26 Simple main effect of combined B 1 B 2 versus B 3 at A 1 contrasted with simple main effect of B 1 B 2 versus B 3 at A 2,, or (next slide) A x B 12 vs 3 B1B1 B2B2 B3B3 A1A1 11-2 A2A2 2

27 Simple main effect of A (A 1 versus A 2 ) at combined B 1 B 2 contrasted with simple main effect of A at B 3 That is, the A x B interaction with levels 1 and 2 of B combined. A x B 12 vs 3 B1B1 B2B2 B3B3 A1A1 11-2 A2A2 2

28 Simple main effect of A at B 1 contrasted with simple main effect of A at B 2 Simple main effect of B 12 (B 1 versus B 2 ignoring B 3 ) at A 1 contrasted with same effect at A 2 That is, the A x B interaction ignoring level 3 of B.

29 Proc GLM; Class Cell; Model Y=Cell; CONTRAST 'B12vs3' Cell 1 1 -2 -1 -1 2; CONTRAST 'B1vs2' Cell 1 -1 0 -1 1 0; ContrastDFContrast SS Mean Square F ValuePr > F A x B12vs31644.03644.03391.83<.0001 A x B1vs21152.10 21.69<.0001 SS AxB = 644.03 + 152.10 = 769.13

30 Standardized Contrasts Give the contrast in standard deviation units Should the standardizer (the denominator of estimated d) include or exclude variance due to other factors in the design? Kline argues that the standardizer should include all variance in the outcome variable. I generally agree.

31 Therapy x Sex of Patient, 2 x 2 You want to estimate d for the main effect of therapy. Should the denominator of estimated d include variance due to sex? The MSE excludes variance due to sex, but In the population, sex may account for some of the variance in the outcome variable. The SQRT(MSE) would under-estimate the population standard deviation.

32 Kline says one should include in the standardizer variance due to any factor that is naturally variable in the population (like sex or type of therapy). But is the distribution of the factor in the research the same as it is in the population? If not, then the factor may account for more or less variance in the research than in the population.

33 Obtaining a Pooled Standardizer You decide to include in the standardizer, for the effect of therapy, variance due to all other effects. Could pool the SS within-cells, SS sex, and SS interaction to form an appropriate standardizer. Or just drop Sex and (Therapy x Sex) from the model, run the ANOVA, and use the SQRT of the resulting MSE as the standardizer.

34 Simple Main Effects Effect of therapy in men vs. in women. Should the standardizer be computed within-sex? If so, that for men might differ from that for women. Do you want to estimate d in a single- sex population or in a way that the estimate for men can be compared to that for women without considering differences in the denominators?

35 (Semipartial) Eta-Squared  2 = SS Effect  SS Total Using our smoking history data, For the interaction, For gender, For smoking history,

36 CI.90 Eta-Squared Compute the F that would be obtained were all other effects added to the error term. For gender,

37 CI.90 Eta-Squared Use that F with my Conf-Interval-R2- Regr.sas 90% CI [.22,.45] for gender [.005,.15] for smoking [.000,.17] for the interaction Yikes, 0 in the CI for a significant effect! The MSE in the ANOVA excluded variance due to other effects, that for the CI did not.

38 Partial Eta-Squared The value of η 2 can be affected by the number and magnitude of other effects contributing to variance in the outcome variable. For example, if our data were only from women, SS Total would not include SS Gender and SS Interaction. This would increase η 2. Partial eta-squared estimates what the effect would be if the other effects were all zero.

39 Partial Eta-Squared For the interaction, For gender, For smoking history,

40 CI.90 on Partial Eta-Squared If you use the source table F-ratios and df with my Conf-Interval-R2-Regr.sas, it will return confidence intervals on partial eta-squared. Gender: [.33,.55] Smoking: [.17,.41] Interaction [.002,.18] note that it excludes 0

41 Partial  2 and F For Interaction  Notice that the denominator of both includes error but excludes the effects of Gender and Smoking History.

42 Semi-Partial  2  Notice that, unlike partial  2 and F, the denominator of semi-partial  2 includes the effects of Gender and Smoking History.

43 Omega-Squared For the interaction, For gender, For smoking history,

44 SAS EFFECTSIZE PROC GLM; CLASS Age Condition; MODEL Items=Age|Condition / EFFECTSIZE alpha=0.1; This will give you eta-squared, partial eta-squared, omega-squared, and confidence intervals for each.

45  2 or Partial  2 ? I generally prefer  2 Kline says you should exclude an effect from standardizer only if it does not exist in the natural population. Values of partial  2 can sum to greater than 100%. Can one really account for more than all of the variance in the outcome variable?

46 For every effect,

47 These sum to 150%

48  2 for Simple Main Effects For the women, SS total = 11,055 and SS smoking = 5,700  2 = 5,700/11,055 =.52 To construct confidence interval, need compute an F using data from women only. The SSE is 11,055 (total) – 5,700 (smoking) = 5,355.

49 90% CI [.29,.60] For the men,  2 =.11, 90% CI [0,.20]

50 Assumptions Normality within each cell Homogeneity of variance across cells

51 Advantages of Factorial ANOVA Economy -- study the effects of two factors for (almost) the price of one. Power -- removing from the error term the effects of Factor B and the interaction gives a more powerful test of Factor A. Interaction -- see if effect of A varies across levels of B.

52 One-Way ANOVA Consider the partitioning of the sums of squares illustrated to the right. SS B = 15 and SSE = 85. Suppose there are two levels of B (an experimental manipulation) and a total of 20 cases.

53 Treatment Not Significant MSB = 15, MSE = 85/18 = 4.722. The F(1, 18) = 15/4.72 = 3.176, p =.092. Woe to us, the effect of our experimental treatment has fallen short of statistical significance.

54 Sex Not Included in the Model Now suppose that the subjects here consist of both men and women and that the sexes differ on the dependent variable. Since sex is not included in the model, variance due to sex is error variance, as is variance due to any interaction between sex and the experimental treatment.

55 Add Sex to the Model Let us see what happens if we include sex and the interaction in the model. SS Sex = 25, SS B = 15, SS Sex*B = 10, and SSE = 50. Notice that the SSE has been reduced by removing from it the effects of sex and the interaction.

56 Enhancement of Power The MSB is still 15, but the MSE is now 50/16 = 3.125 and the F(1, 16) = 15/3.125 = 4.80, p =.044. Notice that excluding the variance due to sex and the interaction has reduced the error variance enough that now the main effect of the experimental treatment is significant.

57 Presenting the Results Participants were given a test of their ability to detect the scent of a chemical thought to have pheromonal properties in humans. Each participant had been classified into one of five groups based on his or her smoking history. A 2 x 5, Gender x Smoking History, ANOVA was employed, using a.05 criterion of statistical significance and a MSE of 119 for all effects tested. There were significant main effects of gender, F(1, 90) = 75.84, p <.001,  2 =.346, 90% CI [.22,.45], and smoking history, F(4, 90) = 10.80, p <.001,  2 =.197, 90% CI [.005,.15], as well as a significant interaction between gender and smoking history, F(4, 90) = 2.61, p =.041,  2 =.047, 90% CI [.00,.17],. As shown in Table 1, women were better able to detect this scent than were men, and smoking reduced ability to detect the scent, with recovery of function being greater the longer the period since the participant had last smoked.

58

59 The significant interaction was further investigated with tests of the simple main effect of smoking history. For the men, the effect of smoking history fell short of statistical significance, F(4, 90) = 1.43, p =.23,  2 =.113, 90% CI [.00,.20]. For the women, smoking history had a significant effect on ability to detect the scent, F(4, 90) = 11.97, p <.001,  2 =.516, 90% CI [.29,.60]. This significant simple main effect was followed by a set of four contrasts. Each group of female ex-smokers was compared with the group of women who had never smoked. The Bonferroni inequality was employed to cap the familywise error rate at.05 for this family of four comparisons. It was found that the women who had never smoked had a significantly better ability to detect the scent than did women who had quit smoking one month to seven years earlier, but the difference between those who never smoked and those who had stopped smoking more than seven years ago was too small to be statistically significant.

60 Interaction Plot


Download ppt "Two-Way Balanced Independent Samples ANOVA Computations Contrasts Confidence Intervals."

Similar presentations


Ads by Google