Download Analyzing Variance in Factorial ANOVA: Omega-Squared and Interaction Contrasts - Prof. Mic and more Study notes Psychology in PDF only on Docsity! 1 Factorial ANOVA 2 Advanced Psychological Statistics I Psychology 502 November 8, 2007 2 Overview ! Questions? ! Other factorial basics " Contrasts and posthocs on main effects " Magnitude of effects ! Interpreting interactions " Simple main effects " Contrasts " Posthocs ! Power ! Higher-order designs 3 Results Hard Medium Easy Athlete 46.4 30.2 17.8 31.47 College 36.8 37.8 21.4 32.00 41.60 34.00 19.60 31.73 4 Tests of Between-Subjects Effects Depend ent Variable: SCORE 580 8.533 a 5 1161.707 97.53 1 .000 604 20.267 1 60420.267 507 2.597 .000 4.267 1 4.267 .358 .552 499 4.133 2 249 7.067 209.642 .000 810.133 2 405.067 34.00 7 .000 643.200 54 11.911 668 72.000 60 645 1.733 59 Source Corrected Model Intercept POP DIFF POP * DIFF Error Total Corrected Total Type II I Sum of Squares df Mean Squar e F Sig. R Squar ed = .900 (Adjusted R Squared = .891)a. Results, SPSS version 9 Contrasts ! What if you have a hypothesis about a main effect which is more specific than “some marginal mean is different than the grand mean?” ! Can still do contrasts in factorial designs ! Two kinds of contrasts: " Main effects contrasts " Interaction contrasts ! Main effects contrasts " Can do contrasts on each factor, ignoring the other factor(s) " For example, could contrast “hard” vs. “medium” and “easy” with contrast (-2 1 1) " Independent of other factors 10 Main Effects Contrasts ! Again, these are particularly useful if you have specific hypotheses in advance ! Same kind of contrast statements as with one-way ANOVA " UNIANOVA score BY pop diff /CONTRAST(diff) = SPECIAL(-1 0 1) /CONTRAST(diff) = SPECIAL(-2 1 1) /CONTRAST(pop) = SPECIAL(-1 1). ! Slight complications " Must remember how your means are ordered in the data file " Should adjust for multiple comparisons # Treat each factor as a family 11 SPSS Contrast Output Contrast Results (K Matrix) -2 2.000 0 -2 2.000 1.091 .000 -2 4.188 -1 9.812 Contrast Estimate Hypothesized Value Dif ference (Estimate - Hypothesized) Std. Error Sig. Lower Bound Upper Bound 95% Conf idence Interval for Dif ference DIFF Special Contrast L1 SCORE Dependent Variable Test Results Depend ent Variable: SCORE 4840.000 1 4840.000 406 .343 .000 643 .200 54 11.911 Source Contrast Error Sum of Squar es df Mean Square F Sig. ! You!ll get two tables for each contrast (this is the set from the first contrast) " Just like with one-way ANOVA 12 Main Effect Posthocs ! What if we " (1) Didn!t have prior hypotheses? " (2) Found a reliable main effect? " (3) Wanted to look for differences in marginal means? ! Same procedures as in one-way ANOVA: " Do a posthoc ! Can do posthocs on marginal means or cell means " Marginal means for main effects " Cell means for interactions ! Marginal means are easy: " UNIANOVA score BY pop diff /POSTHOC = diff(QREGW). " Runs the R-E-G-W on the marginal means 13 SCORE Ryan-Einot-Gabr ie l-Welsch Rangea 20 19.600 20 34.000 20 41.600 1.000 1.000 1.000 DIFF Easy Medium Hard Sig. N 1 2 3 Subset Means for groups in homogeneous subsets are d isplayed. Based on Type III Sum of Squa res The er ror term is Mean Squar e(Error) = 11.911. Alpha = .050.a. Main Effects Posthoc Output ! Note that all three marginal means are different 14 Interpreting Interactions ! Many ways to interpret most interactions ! A viable interpretation here might be: " Effect of difficulty occurs only when the population is “athlete” 19 Simple Main Effects ! Look only at “college” population: " TEMPORARY. SELECT IF (pop = 0). UNIANOVA score BY diff. ! Look only at “athlete” population: " TEMPORARY. SELECT IF (pop = 1). UNIANOVA score BY diff. ! Looking for one to be reliable and one to not be reliable, right? 20 Tests of Between-Subjects Effects Depend ent Variable: SCORE 4113.867 a 2 205 6.933 175.973 .000 297 04.533 1 29704.533 254 1.262 .000 4113.867 2 205 6.933 175.973 .000 315.600 27 11.68 9 341 34.000 30 442 9.467 29 Source Corrected Model Intercept DIFF Error Total Corrected Total Type II I Sum of Squares df Mean Squar e F Sig. R Squar ed = .929 (Adjusted R Squared = .923)a. “College” Population ! Effect of difficulty is reliable among those subjects in the “college” population 21 Tests of Between-Subjects Effects Depend ent Variable: SCORE 169 0.400 a 2 845.200 69.65 9 .000 307 20.000 1 30720.000 253 1.868 .000 169 0.400 2 845.200 69.65 9 .000 327.600 27 12.13 3 327 38.000 30 201 8.000 29 Source Corrected Model Intercept DIFF Error Total Corrected Total Type II I Sum of Squares df Mean Squar e F Sig. R Squar ed = .838 (Adjusted R Squared = .826)a. “Athlete” Population ! Reliable here as well ! Thus, not especially helpful 22 Interaction Contrasts ! Think of design as a giant one-way ! Generate a contrast on factor A ! Generate another contrast of factor B ! Interaction contrast would be the product of those two A,+ A A,- C,+ C C,- Hard vs. others 2 -1 -1 2 -1 -1 Athlete vs. College 1 1 1 -1 -1 -1 Interaction 2 -1 -1 -2 1 1 23 Interaction Contrasts ! This tests the second interaction hypothesis that I proposed: " “Effect of population is reversed for high difficulty (hard)” ! Does everyone see why? A,+ A A,- C,+ C C,- Hard vs. others 2 -1 -1 2 -1 -1 Athlete vs. College 1 1 1 -1 -1 -1 Interaction 2 -1 -1 -2 1 1 24 Another Interaction Contrast ! Tests a different hypothesis: " First contrast is linear effect of difficulty " Interaction contrast: is the linear effect of difficulty different at the different levels of population? ! Everybody see why? Linear difficulty 29 Another Example ! What would we want to test? ! What would that contrast look like? 30 Another Example ! Tedious but doable ! Everyone clear on this idea? 210-1-2 1210-1-24 1210-1-23 -1-2-10122 -1-2-10121 54321Group 31 Another Example ! What would we want to test? ! What would that contrast look like? 32 Another Example ! Tedious but doable ! Everyone clear on this idea? 2-1-2-12 12-1-2-124 12-1-2-123 -1-2121-22 -1-2121-21 54321Group 33 Interaction Contrast Pros and Cons ! Pros " Allow you to test very specific interaction effects " Good power # Overall error term is still the same MSE # No loss of degrees of freedom " Generally easier to interpret ! Cons " Can still have trouble finding one that makes sense " Can be hard to explain clearly even when you do find them " Can still find more than one is reliable " Can still find none are reliable ! Most sophisticated and sensitive method 34 Interaction Contrasts ! It turns out that SPSS will not run an interaction contrast correctly with UNIANOVA ! Best strategy is to break it into a one-way ! Need a new variable, “cell,” which represents the six cells ! BE CAREFUL: Make sure that the cell numbering and your contrast weights match up " Very common error " Useful to compute the contrast by hand to make sure output is right 39 Power ! All the usual stuff applies " Changing " changes power " Changing effect size changes power # Absolute size of effects # Variance " Changing N (or n) changes power ! Not much different than one-way designs " Recall the one-way !" = # 2$ k% e 2 ! = " ! n ! Power computed separately for each factor and the interaction 40 Power Equations ! Power for Factor A !" A = #2$ J% e 2 ! A = " ! A Kn ! Power for Factor B !" B = #2$ K% e 2 ! B = " ! B Jn ! Power for interaction !" AxB = #$2% JK& e 2 ! AxB = " ! AxB n ! Same conventions for #´ " Small = 0.10, medium = 0.25, large = 0.40 41 Power Example ! Once you have #, can compute power " Use noncentral F table in your book ! Example: " Power for interaction from our example study !" AxB = #$2% JK& e 2 = 5.06 2 + 3.53 2 + ...+1.53 2 2(3)(MS e ) = 80.94 6(11.84) ! " AxB = 1.067 ! AxB = " ! AxB n = 1.067 10 = 3.38 ! How many d.f.? ! Resulting power is extremely good. Why? 42 Higher-Order Designs ! Can have more than two independent variables as well " Consider three factors, A, B, & C " Lots of effects (and lots of null hypotheses): # Main effect of A # Main effect of B # Main effect of C # Interaction of A and B # Interaction of B and C # Interaction of A and C # Interaction of A, B, and C ! Four-way and five-way designs happen, too ! Interpreting higher-order interactions can be very difficult 43 3-way ANOVA Effects ! Gets ugly very quickly " J is levels of A, K is levels of B, L is levels of C SSA = KLn ! j 2 = KLn (x j •• " x ) 2 ## SSAxC = Kn !" jl 2 = Kn (x j •l # x #! j #" l ) 2$$$$ SSAxBxC = n !"# jkl 2 = n (x jkl $ x $! j $ "k $# l $!" jk $ "# kl $!# jl ) 2%%%%%% ! Same basic ideas " MSeffect = SSefffect / d.f. efffect " One MSerror, computed from within cells " Form F-ratios by dividing MSefffect by MSerror 44 Three-Way Example ! Grand mean 25.5 ! There are marginals that matter that aren!t even in these tables: " Marginals for A and B " Marginals for AB ! Those marginals might matter " If an AxB interaction appears, then you!ll need to look at those C1 B1 B2 B3 A1 22 19 40 27 A2 9 26 50 28 A3 27 14 37 26 19 19 42 27 C2 B1 B2 B3 A1 23 20 30 24 A2 9 28 41 26 A3 25 15 29 23 19 21 33 24