ANOVA/ANCOVA using the GLM Procedure Flashcards
Fixed factor(s)
Categorical IVs or treatment conditions that we can replicate; for example a dosage of a drug (e.g. low, medium or high).
Random factor(s)
A treatment condition that is unique in space and time
Covariate(s)
The continuous IVs in out study
Corrected Model Significance
The overall significance of our model, including all factors
Factor significance
The significance of that particular factor
Total SS
Variation around the origin (zero). Meaningless.
Corrected Total SS
Variation around the grand mean
Unique Sum of Squares (Type III)
The SS as if each effect was the last one fitted in the model. The unique SS for each predictor or factor. Does not depend on order of the IV fit.
Sequential Sums of Squares (Type I)
The SS when each factor is fitted in order to the model. Depends on order of IV fit.
SStotal
SSbetween/treat + SSwithin/error
SSbetween
Take a score, subtract the grand mean, square the result for every score and sum the result
SSwithin/error
Take each group mean, subtract the grand mean, square and then sum the results and multiply the sum by n.
SStotal
Take a score, subtract the mean of the group it belongs to, square the result and add up results
dftotal
N-1
Where N = total sample size
dfbetween/treat
K-1
Where K= number of groups
dfwithin/error
N-K
MSbetween
SSbetween/dfbetween
MSwithin/error
SSwithin/dfwithin
Number of possible pairwise comparisons formula
k(k-1)/2
Planned contrasts
Specified in advance. Are orthogonal (sum of contrast coefficients equals zero); no part of model variance used more than once
NB there will always be one less orthogonal contrast than groups.
NB no group should occur in more than one contrast
Post-hoc contrasts
Not normally specified in advance. May not be orthogonal (sum of contrast coefficients may not equal zero); some part of model variance may be used more than once (e.g. comparing A and B to B and C). All possible pairwise comparisons of group means
Subcommand: posthoc
Simple contrast og group means.
Subcommand: contrast
A selection of predefined contrast combinations.
Subcommand: lmatrix
Allows you to hand code contrast specifications.
Subcommand: emmeans
Compare marginal design means.
Subcommand: profile
Plot of means.
Rules for defining contrasts
- Choose sensible contrasts
- If A is compared to B, give A the positive weight and B the negative weight
- Within a contrast, the weights must add to zero
- Any group not logically involved in a contrast gets a weight of zero
- In contrasts of multiple group contrasts, that total weights for each ‘chunk’ should be equal
Contrast sub command: deviation
each group versus overall mean
Contrast sub command: Simple
Each group versus the reference group
Contrast sub command: Difference
Each group versus mean of preceeding groups
Contrast sub command: Helmert
Each group versus mean of preceeding groups
Contrast sub command: Repeated
Difference between consecutive groups
Contrast sub command: Polynomial
Linear, quadratic, cubic
Posthoc adjustment
Bonferroni: Most conserative adjustment.
Least Significant Adjustment - no adjustment for multiple comparisons
Emmeans sub command
Compares and displays marginal means which is the difference in the values of means across a factor (or factors).
Effect size: partial eta squared or Omega squared
“generally a better representation of effect size in a population rather than a sample”.
One way ANOVA
IV: One categorical IV.
DV: Continuous numeric.
Design: between subjects
Syntax: GLM taste BY coffee_type.
Two way ANOVA
IVs: Two categorical IVs DV: Continuous numeric Design: between subjects Syntax for additive: GLM taste BY coffee_type size. Syntax for interaction model: GLM taste BY coffee_type size / DESIGN = coffee_type coffee_type*size / LMATRIX = 'dark coffees versus milk coffees across sizes' coffee_type*size -1 0.5 0.5 +1 0.5 0.5
ANCOVA
Why ANCOVA?
Why include co-variates?
IVs: One categorical IV, plus one or more continuous IVs.
DV: Continuous numeric.
Design: between subjects.
Why ANCOVA? Why include co-variates?
- Eliminates the influence of potentially confounding variables.
- Reduce SSresidual/error making our test more powerful.
If something is a factor we put it after BY, if something is a covariate it goes after WITH.
One Way Repeated Measures ANOVA
IVs: One categorical IV.
DV: Continuous numeric.
Design: Within subjects
Assumptions of Repeated Measures ANOVA:
- Independence within groups
- Sphericity/compound symmetry
- Normal distribution within groups
Compound Symmetry
- Equal variance across conditions - is the standard deviations approximately the same across for our IVs?
- Equal correlation (or covariance) between all possible pairs of conditions - do our IVs correlate with each other fairly consisently?
Sphericity
We use Mauchley’s test where we want a p>= 0.05. Informally, do we get similar standard deviations across participants for our DV?
What happens when we fail Mauchly’s test of sphericity?
- Look at the Epsilon output of Mauchly’s test and examine the values for Greenhouse-Geisser, Huynh-Feldt and Lower Bound.
- If any measure is > 0.75 we can discard it and move onto the next, more conservative measure.
Two Way Repeated Measures ANOVA
IVs: Two categorical IVs. DV: Continuous numeric. Design: Within subjects Syntax: GLM cap_small cap_med cap_large mocha_small mocha_med mocha_large / WSFACTOR coffee 2 size 3 / MMATRIX = "Cap vs..." / WSDESIGN = coffee size coffee*size.
Mixed Designs ANOVA
IVs: IVs that span between and within subjects.
DV: Continuous numeric.
Design: Between subjects and within subjects.
Syntax:
GLM cap exp mocha black size BY gender
/ WSFACTOR coffee 4 coffee_size 2.