1 / 58

Two-Way Balanced Independent Samples ANOVA

Two-Way Balanced Independent Samples ANOVA. Computations Contrasts Confidence Intervals. Partitioning the SS total. The total SS is divided into two sources Cells or Model SS Error SS The model is . Partitioning the SS cells. The cells SS is divided into three sources

elsu
Download Presentation

Two-Way Balanced Independent Samples ANOVA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  4. Gender x Smoking History • Cell n = 10, Y2 = 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. SScellsand SSerror SSerror is then SStotal minus SSCells = 26,115 ‑ 15,405 = 10,710.

  7. SSgenderand SSsmoke

  8. SSSmoke x Gender SSinteraction = SSCellsSSGenderSSSmoke = 15,405 ‑ 9,025 ‑ 5,140 = 1,240.

  9. Degrees of Freedom • dftotal = N - 1 • dfA = a - 1 • dfB = b - 1 • dfAxB = (a - 1)(b -1) • dferror = N - ab

  10. Source Table

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

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

  13. Simple Main Effects of Gender • MS = SS / df; F = MSeffect / 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-Smokersvs. 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 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. Results of Bonferroni Test Means sharing a superscript do not differ from one another at the .05 level.

  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. (A1B1 + A2B2) – (A1B2 + A2B1) One diagonal versus the other. Rearranging terms, (A1B1 - A2B1) – (A1B2 - A2B2) Effect of A at B1 versus effect of A at B2 (A1B1 - A1B2) – (A2B1 - A2B2) Effect of B at A1 versus effect of B at A2

  24. SAS Code • AB cells (level of A, level of B) are 11, 12, 21, 22 • ProcGLM; 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 B1B2 versus B3 at A1 contrasted with simple main effect of B1B2 versus B3 at A2,, or (next slide)

  27. Simple main effect of A (A1 versus A2) at combined B1B2 contrasted with simple main effect of A at B3, or That is, the A x B interaction with levels 1 and 2 of B combined.

  28. Simple main effect of A at B1 contrasted with simple main effect of A at B2 • Simple main effect of B12 (B1 versus B2 ignoring B3) at A1 contrasted with same effect at A2 • That is, the A x B interaction ignoring level 3 of B.

  29. SSAxB = 644.03 + 152.10 = 769.13 ProcGLM; Class Cell; Model Y=Cell; CONTRAST 'B12vs3' Cell 1 1 -2 -1 -1 2; CONTRAST 'B1vs2' Cell 1 -1 0 -1 -1 0;

  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 effect of therapy • Should the denominator of estimated dinclude variance due to gender? • The MSE excludes variance due to gender, but • In the population gender 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 SSwithin-cells, SSsex, and SSinteraction 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. Eta-Squared • 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 excluded from the model. • For gender,

  37. CI.90 Eta-Squared • Using 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, SSTotal would not include SSGender and SSInteraction. • 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 it excludes 0

  41. Omega-Squared • For the interaction, • For gender, • For smoking history,

  42. SAS EFFECTSIZE • PROCGLM; 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.

  43. 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?

  44. For every effect,

  45. For every effect, These sum to 150%

  46. 2 for Simple Main Effects • For the women, SStotal = 11,055 • and SSsmoking = 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.

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

  48. Assumptions • Normality within each cell • Homogeneity of variance across cells

  49. 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.

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

More Related