GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 1 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition @c 2012 by G. David Garson and Statistical Associates Publishing. All rights reserved worldwide in all media. No permission is granted to any user to copy or post this work in any format or any media. The author and publisher of this eBook and accompanying materials make no representation or warranties with respect to the accuracy, applicability, fitness, or completeness of the contents of this eBook or accompanying materials. The author and publisher disclaim any warranties (express or implied), merchantability, or fitness for any particular purpose. The author and publisher shall in no event be held liable to any party for any direct, indirect, punitive, special, incidental or other consequential damages arising directly or indirectly from any use of this material, which is provided “as is”, and without warranties. Further, the author and publisher do not warrant the performance, effectiveness or applicability of any sites listed or linked to in this eBook or accompanying materials. All links are for information purposes only and are not warranted for content, accuracy or any other implied or explicit purpose. This eBook and accompanying materials is © copyrighted by G. David Garson and Statistical Associates Publishing. No part of this may be copied, or changed in any format, sold, or used in any way under any circumstances other than reading by the downloading individual. Contact: G. David Garson, President Statistical Publishing Associates 274 Glenn Drive Asheboro, NC 27205 USA Email: [email protected] Web: www.statisticalassociates.com Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 2 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Table of Contents Overview ....................................................................................................................................... 11 Key Concepts ................................................................................................................................. 15 Why testing means is related to variance in analysis of variance ........................................... 15 One-way ANOVA ...................................................................................................................... 16 Simple one-way ANOVA in SPSS .......................................................................................... 16 Simple one-way ANOVA in SAS ........................................................................................... 20 Two-way ANOVA ...................................................................................................................... 23 Two-way ANOVA in SPSS ..................................................................................................... 24 Two-way ANOVA in SAS ....................................................................................................... 27 Multivariate or n-way ANOVA .................................................................................................. 29 Regression models ................................................................................................................... 29 Parameter estimates (b coefficients) for factor levels ............................................................ 31 Parameter estimates for dichotomies ................................................................................. 32 Significance of parameter estimates ................................................................................... 32 Research designs ........................................................................................................................... 32 Between-groups ANOVA design............................................................................................... 32 Completely randomized design ........................................................................................... 34 Full factorial ANOVA ............................................................................................................ 34 Balanced designs ................................................................................................................. 35 Latin square designs ............................................................................................................ 36 Graeco-Latin square designs ............................................................................................... 37 Randomized Complete Block Design (RCBD ANOVA) .......................................................... 37 Split plot designs .................................................................................................................. 39 Mixed design models ........................................................................................................... 39 Random v. fixed effects models ............................................................................................... 41 In SPSS .................................................................................................................................. 41 In SAS ................................................................................................................................... 42 Linear mixed models (LMM) vs. general linear models (GLM) ........................................... 43 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 3 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Effects .................................................................................................................................. 43 Treating a random factor as a fixed factor .......................................................................... 43 Mixed effects models .......................................................................................................... 44 Nested designs ..................................................................................................................... 44 Nested designs ......................................................................................................................... 45 In SPSS .................................................................................................................................. 46 In SAS ................................................................................................................................... 48 Treatment by replication design ......................................................................................... 48 Within-groups (repeated measures) ANOVA designs .............................................................. 48 Counterbalancing ................................................................................................................ 49 Reliability procedure ........................................................................................................... 50 Repeated measures GLM in SPSS ........................................................................................ 50 Repeated measures GLM in SAS .......................................................................................... 50 Interpreting repeated measures output ............................................................................. 51 Variables........................................................................................................................................ 51 Types of variables ..................................................................................................................... 52 Dependent variable ............................................................................................................. 52 Fixed and random factors .................................................................................................... 53 Covariates ............................................................................................................................ 53 WLS weights ......................................................................................................................... 53 Models and types of effects.......................................................................................................... 54 Full factorial models ................................................................................................................. 54 Effects ....................................................................................................................................... 55 Main effects ......................................................................................................................... 55 Interaction effects ............................................................................................................... 55 Residual effects .................................................................................................................... 58 Effect size measures...................................................................................................................... 59 Effect size coefficients based on percent of variance explained ............................................. 59 Partial eta-squared .............................................................................................................. 59 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 4 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Omega-squared ................................................................................................................... 60 Herzberg's R2 ....................................................................................................................... 61 Intraclass correlation ........................................................................................................... 61 Effect size coefficients based on standardized mean differences ........................................... 61 Cohen's d ............................................................................................................................. 61 Glass's delta ......................................................................................................................... 63 Hedge's g.............................................................................................................................. 64 Significance tests ........................................................................................................................... 64 F-test ......................................................................................................................................... 64 Reading the F value ............................................................................................................. 64 Example 1 ............................................................................................................................ 65 Example 2 ............................................................................................................................ 65 Significance in two-way ANOVA .......................................................................................... 66 Computation of F ................................................................................................................. 66 F-test assumptions............................................................................................................... 66 Adjusted means ................................................................................................................... 67 Lack of fit test ...................................................................................................................... 67 Power level and noncentrality parameter .......................................................................... 68 Hotelling's T-Square ............................................................................................................. 69 Planned multiple comparison t-tests ....................................................................................... 69 Simple t-test difference of means ....................................................................................... 70 Bonferroni-adjusted t-test ................................................................................................... 71 Sidak test ............................................................................................................................. 72 Dunnett's test ...................................................................................................................... 73 HSU's multiple comparison with the best (MCB) test ......................................................... 73 Post-hoc multiple comparison tests......................................................................................... 73 The q-statistic ...................................................................................................................... 74 Output formats: pairwise vs. multiple range ...................................................................... 75 Tests assuming equal variances .......................................................................................... 75 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 5 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Least significant difference (LSD) test ................................................................................. 75 The Fisher-Hayter test ......................................................................................................... 76 Tukey's test, a.k.a. Tukey honestly significant difference (HSD) test .................................. 76 Tukey-b test, a.k.a. Tukey's wholly significant difference (WSD) test................................. 78 S-N-K or Student-Newman-Keuls test ................................................................................. 78 Duncan test .......................................................................................................................... 79 Ryan test (REGWQ) .............................................................................................................. 79 The Shaffer-Ryan test .......................................................................................................... 81 The Scheffé test ................................................................................................................... 81 Hochberg GT2 test ............................................................................................................... 83 Gabriel test .......................................................................................................................... 85 Waller-Duncan test .............................................................................................................. 85 Tests not assuming equal variances .................................................................................... 85 Tamhane's T2 test ................................................................................................................ 85 Games-Howell test .............................................................................................................. 86 Dunnett's T3 test and Dunnett's C test ............................................................................... 87 The Tukey-Kramer test ........................................................................................................ 87 The Miller-Winer test .......................................................................................................... 87 More than one multiple comparison/post hoc test ................................................................ 87 Example ............................................................................................................................... 87 Contrast tests ................................................................................................................................ 89 Overview .................................................................................................................................. 89 Types of contrasts .................................................................................................................... 90 Deviation contrasts .............................................................................................................. 90 Simple contrasts .................................................................................................................. 90 Difference contrasts ............................................................................................................ 90 Helmert contrasts ................................................................................................................ 90 Repeated contrasts .............................................................................................................. 90 Polynomial contrasts ........................................................................................................... 91 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 6 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Custom hypothesis tables ........................................................................................................ 91 Custom hypothesis tables index table ................................................................................. 91 Custom hypothesis tables.................................................................................................... 92 Estimated marginal means ........................................................................................................... 94 Overview .................................................................................................................................. 94 EMM Estimates table ............................................................................................................... 96 Other EMM output ................................................................................................................... 99 EMM Pairwise comparisons table ....................................................................................... 99 EMM Univariate tests table ................................................................................................. 99 Profile plots .......................................................................................................................... 99 GLM Repeated Measures ............................................................................................................ 100 Overview ................................................................................................................................ 100 Key Terms and Concepts ........................................................................................................ 101 Within-subjects factor ....................................................................................................... 101 Repeated measures dependent variables ......................................................................... 102 Between-subjects factors .................................................................................................. 103 Covariates .......................................................................................................................... 103 Models ............................................................................................................................... 104 Type of sum of squares ...................................................................................................... 105 Balanced vs. unbalanced models ...................................................................................... 105 Estimated marginal means ..................................................................................................... 106 Pairwise comparisons ............................................................................................................. 107 Statistics options in SPSS ........................................................................................................ 108 Descriptive statistics .......................................................................................................... 108 Hypothesis SSCP matrices.................................................................................................. 109 Partial eta-squared ............................................................................................................ 109 Within-subjects SSCP matrix and within-subjects contrast effects. .................................. 110 Multivariate tests. .................................................................................................................. 111 Univariate vs. multivariate models .................................................................................... 112 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 7 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Box's M test ....................................................................................................................... 113 Mauchly's test of sphericity ............................................................................................... 113 Univariate tests of within-subjects effects ............................................................................ 114 Parameter estimates .............................................................................................................. 116 Levene's test ........................................................................................................................... 117 Spread-versus-level plots ....................................................................................................... 118 Residual plots ......................................................................................................................... 118 Lack of fit test ......................................................................................................................... 120 General estimable function .................................................................................................... 121 Post hoc tests ......................................................................................................................... 121 Overview ............................................................................................................................ 121 Profile plots for repeated measures GLM .............................................................................. 124 Example ............................................................................................................................. 124 Contrast analysis for repeated measures GLM ...................................................................... 126 Types of contrasts for repeated measures ........................................................................ 127 Simple contrasts example .................................................................................................. 128 Saving variables in repeated measures GLM ......................................................................... 129 Cook's distance .................................................................................................................. 130 Leverage values ................................................................................................................. 130 Assumptions ................................................................................................................................ 131 Interval data ........................................................................................................................... 131 Homogeneity of variances ..................................................................................................... 131 Homogeneity of variance ....................................................................................................... 132 Appropriate sums of squares ................................................................................................. 136 Multivariate normality ........................................................................................................... 137 Adequate sample size ............................................................................................................ 138 Equal or similar sample sizes .................................................................................................. 138 Random sampling ................................................................................................................... 138 Orthogonal error .................................................................................................................... 139 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 8 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Data independence ................................................................................................................ 139 Recursive models ................................................................................................................... 139 Categorical independent variables ........................................................................................ 139 The independent variable is or variables are categorical. ..................................................... 139 Continuous dependent variables ........................................................................................... 139 Non-significant outliers .......................................................................................................... 139 Sphericity ................................................................................................................................ 140 Assumptions related to ANCOVA: .......................................................................................... 141 Limited number of covariates ........................................................................................... 141 Low measurement error of the covariate ......................................................................... 141 Covariates are linearly related or in a known relationship to the dependent .................. 141 Homogeneity of covariate regression coefficients ............................................................ 142 No covariate outliers ......................................................................................................... 142 No high multicollinearity of the covariates ....................................................................... 143 Additivity ............................................................................................................................ 143 Assumptions for repeated measures ..................................................................................... 143 Frequently Asked Questions ....................................................................................................... 144 How do you interpret an ANOVA table? ................................................................................ 145 Isn't ANOVA just for experimental research designs? ........................................................... 147 Should I standardize my data before using ANOVA or ANCOVA? ......................................... 147 Since orthogonality (uncorrelated independents) is an assumption, and since this is rare in real life topics of interest to social scientists, shouldn't regression models be used instead of ANOVA models? ..................................................................................................................... 147 Couldn't I just use several t-tests to compare means instead of ANOVA? ............................ 147 How does counterbalancing work in repeated measures designs? ...................................... 148 How is F computed in random effect designs? ...................................................................... 149 What designs are available in ANOVA for correlated independents? ................................... 149 If the assumption of homogeneity of variances is not met, should regression models be used instead? .................................................................................................................................. 150 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 9 Single User License. Do not copy or post. GLM UNIVARIATE, ANOVA, AND ANCOVA 2013 Edition Is ANOVA a linear procedure like regression? How is linearity related to the "Contrasts" option? ................................................................................................................................... 150 What is hierarchical ANOVA or ANCOVA? ............................................................................. 150 Is there a limit on the number of independents which can be included in an analysis of variance? ................................................................................................................................ 151 Which SPSS procedures compute ANOVA? ........................................................................... 151 I have several independent variables, which means there are a very large number of possible interaction effects. Does SPSS have to compute them all? ................................................... 151 Do you use the same designs (between groups, repeated measures, etc.) with ANCOVA as you do with ANOVA? .............................................................................................................. 151 How is GLM ANCOVA different from traditional ANCOVA? .................................................. 152 What are paired comparisons (planned or post hoc) in ANCOVA? ....................................... 152 Can ANCOVA be modeled using regression? ......................................................................... 152 How does blocking with ANOVA compare to ANCOVA? ....................................................... 152 What is the SPSS syntax for GLM repeated measures? ......................................................... 153 What is a "doubly repeated measures design"? .................................................................... 154 Bibliography ................................................................................................................................ 155 Copyright @c 2013 by G. David Garson and Statistical Associates Publishing Page 10 Single User License. Do not copy or post.