Factorial ANOVA
description
Transcript of Factorial ANOVA
Factorial ANOVAFactorial ANOVA
2-Way ANOVA, 3-Way ANOVA, 2-Way ANOVA, 3-Way ANOVA, etc.etc.
Factorial ANOVAFactorial ANOVA
• One-Way ANOVA = ANOVA with one One-Way ANOVA = ANOVA with one IV with 1+ levels and one DVIV with 1+ levels and one DV
• Factorial ANOVA = ANOVA with 2+ Factorial ANOVA = ANOVA with 2+ IV’s and one DVIV’s and one DV– Factorial ANOVA Notation:Factorial ANOVA Notation:
•2 x 3 x 4 ANOVA2 x 3 x 4 ANOVA•The number of numbers = the number of IV’sThe number of numbers = the number of IV’s•The numbers themselves = the number of The numbers themselves = the number of
levels in each IVlevels in each IV
Factorial ANOVAFactorial ANOVA
• 2 x 3 x 4 ANOVA = an ANOVA with 3 IV’s, one of 2 x 3 x 4 ANOVA = an ANOVA with 3 IV’s, one of which has 2 levels, one of which has 3 levels, and which has 2 levels, one of which has 3 levels, and the last of which has 4 levelsthe last of which has 4 levels
• Why use a factorial ANOVA? Why not just Why use a factorial ANOVA? Why not just use multiple one-way ANOVA’s?use multiple one-way ANOVA’s?
1.1. Increased power – with the same sample size Increased power – with the same sample size and effect size, a factorial ANOVA is more and effect size, a factorial ANOVA is more likely to result in the rejection of Hlikely to result in the rejection of Hoo
– aka with equal effect size and probability of aka with equal effect size and probability of rejecting Hrejecting Hoo if it is true ( if it is true (αα), you can use fewer ), you can use fewer subjects (and time and money)subjects (and time and money)
Factorial ANOVAFactorial ANOVA
• Why use a factorial ANOVA? Why not Why use a factorial ANOVA? Why not just use multiple one-way ANOVA’s?just use multiple one-way ANOVA’s?
2.2. With 3 IV’s, you’d need to run 3 one-way With 3 IV’s, you’d need to run 3 one-way ANOVA’s, which would inflate your ANOVA’s, which would inflate your αα-level-level– However, this could be corrected with a However, this could be corrected with a
Bonferroni CorrectionBonferroni Correction
3.3. The The bestbest reason is that a factorial ANOVA reason is that a factorial ANOVA can detect can detect interactionsinteractions, something that , something that multiple one-way ANOVA’s cannot domultiple one-way ANOVA’s cannot do
Factorial ANOVAFactorial ANOVA
• Interaction:Interaction:– when the effects of one independent variable when the effects of one independent variable
differ according to levels of another independent differ according to levels of another independent variablevariable
– Ex. We are testing two IV’s, Gender (male and Ex. We are testing two IV’s, Gender (male and female) and Age (young, medium, and old) and female) and Age (young, medium, and old) and their effect on performancetheir effect on performance• If males performance differed as a function of age, i.e. If males performance differed as a function of age, i.e.
males performed better or worse with age, but females males performed better or worse with age, but females performance was the same across ages, we would say performance was the same across ages, we would say that Age and Gender that Age and Gender interactinteract, or that we have an, or that we have an Age x Age x Gender interactionGender interaction
Factorial ANOVAFactorial ANOVA
• Interaction:Interaction:– Presented graphically:Presented graphically:
• Note how male’s Note how male’s performance changes performance changes as a function of age as a function of age while females does notwhile females does not
• Note also that the lines Note also that the lines cross one another, this cross one another, this is the hallmark of an is the hallmark of an interaction, and why interaction, and why interactions are interactions are sometimes called sometimes called cross-over or disordinal cross-over or disordinal interactionsinteractions
Factorial ANOVAFactorial ANOVA
• Interactions:Interactions:– However, it is not necessary that the However, it is not necessary that the
lines cross, only that the slopes differ lines cross, only that the slopes differ from one anotherfrom one another• I.e. one line can be flat, and the other I.e. one line can be flat, and the other
sloping upward, but not cross – this is still an sloping upward, but not cross – this is still an interactioninteraction
•See Fig. 13.2 on p. 400 in the Howell book See Fig. 13.2 on p. 400 in the Howell book for more examplesfor more examples
Factorial ANOVAFactorial ANOVA
• As opposed to interactions, we have As opposed to interactions, we have what are called what are called main effectsmain effects::– the effect of an IV independent of any the effect of an IV independent of any
other IV’sother IV’s•This is what we were looking at with one-way This is what we were looking at with one-way
ANOVA’s – if we have a significant main effect ANOVA’s – if we have a significant main effect of our IV, then we can say that the mean of at of our IV, then we can say that the mean of at least one of the groups/levels of that IV is least one of the groups/levels of that IV is different than at least one of the other different than at least one of the other groups/levelsgroups/levels
Factorial ANOVAFactorial ANOVA
• Main Effects:Main Effects:– Presented Presented
Graphically:Graphically:• Note how the graph Note how the graph
indicates that males indicates that males performed higher than performed higher than females equally for the females equally for the young, medium, and young, medium, and old groupsold groups
• This indicates a main This indicates a main effect (men>women), effect (men>women), but no interaction (this but no interaction (this is equal across ages)is equal across ages)
Factorial ANOVAFactorial ANOVA
• InteractionInteraction Main Effect Main Effect Both Main Both Main
(No main effect) (No interaction) Effect & Inter.(No main effect) (No interaction) Effect & Inter.
Factorial ANOVAFactorial ANOVA
• Finally, we also have Finally, we also have simple effectssimple effects::– the effect of one group/level of our IV at the effect of one group/level of our IV at
one group/level of another IVone group/level of another IV•Using our example earlier of the effects of Using our example earlier of the effects of
Gender (Men/Women) and Age Gender (Men/Women) and Age (Young/Medium/Old) on Performance, to say (Young/Medium/Old) on Performance, to say that young women outperformed other that young women outperformed other groups would be to talk about a simple groups would be to talk about a simple effecteffect
Factorial ANOVAFactorial ANOVA
• One more new issue:One more new issue:– Random vs. Fixed Factors (IV’s)Random vs. Fixed Factors (IV’s)
• Sadly, I’ve never read a paper that bothered to make this Sadly, I’ve never read a paper that bothered to make this distinction, while it seriously effects the results you getdistinction, while it seriously effects the results you get
• Fixed IV: when levels of IV are selected theoreticallyFixed IV: when levels of IV are selected theoretically– i.e. IV = Depression, Levels = Present vs. Absent; IV = i.e. IV = Depression, Levels = Present vs. Absent; IV =
Memory Condition, Levels = Counting, Rhyming, Imagery, Memory Condition, Levels = Counting, Rhyming, Imagery, etc.etc.
• Random IV: when levels are randomly sampledRandom IV: when levels are randomly sampled– i.e. IV = Treatment Duration, Levels = 6, 8, and 12 sessions i.e. IV = Treatment Duration, Levels = 6, 8, and 12 sessions
Factorial ANOVAFactorial ANOVA
• Assumptions:Assumptions:1.1. NormalityNormality
2.2. Homogeneity of Variance Homogeneity of Variance (Homoscedasticity)(Homoscedasticity)
3.3. Independence of ObservationsIndependence of Observations• Same as one-way ANOVASame as one-way ANOVA
• Just like ANOVA, robust to violations of Just like ANOVA, robust to violations of Assumptions #1 & 2 (so long as cell sizes are Assumptions #1 & 2 (so long as cell sizes are roughly equal), but roughly equal), but very sensitivevery sensitive to violations to violations of Assumption #3of Assumption #3
Factorial ANOVAFactorial ANOVA
• Assumptions:Assumptions:– If Assumption #3 is violated, use a If Assumption #3 is violated, use a
repeated-measures ANOVArepeated-measures ANOVA– If Assumptions #1 and/or 2 are violated If Assumptions #1 and/or 2 are violated
((andand cell sizes are unequal), alternate cell sizes are unequal), alternate procedures must be usedprocedures must be used•Transform non-normal dataTransform non-normal data
•Use Browne-Forsythe or Welch statisticUse Browne-Forsythe or Welch statistic
Factorial ANOVAFactorial ANOVA
• Calculating a Factorial ANOVA:Calculating a Factorial ANOVA:– First, we have to divide our data into First, we have to divide our data into cellscells
• the data represented by our simple effectsthe data represented by our simple effects• If we have a 2 x 3 ANOVA, as in our Age and Gender If we have a 2 x 3 ANOVA, as in our Age and Gender
example, we have 3 x 2 = 6 cellsexample, we have 3 x 2 = 6 cells
YoungYoung MediumMedium OldOld
MaleMale Cell #1Cell #1 Cell #2Cell #2 Cell #3Cell #3
FemaleFemale Cell #4Cell #4 Cell #5Cell #5 Cell #6Cell #6
Factorial ANOVAFactorial ANOVA
• Then we calculate means for all of these cells, and for our IV’s across cellsThen we calculate means for all of these cells, and for our IV’s across cells– Mean #1 = Mean for Young Males onlyMean #1 = Mean for Young Males only– Mean #2 = Mean for Medium Males onlyMean #2 = Mean for Medium Males only– Mean #3 = Mean for Old MalesMean #3 = Mean for Old Males– Mean #4 = Mean for Young FemalesMean #4 = Mean for Young Females– Mean #5 = Mean for Medium FemalesMean #5 = Mean for Medium Females– Mean #6 = Mean for Old FemalesMean #6 = Mean for Old Females– Mean #7 = Mean for all Young people (Male and Female)Mean #7 = Mean for all Young people (Male and Female)– Mean #8 = Mean for all Medium people (Male and Female)Mean #8 = Mean for all Medium people (Male and Female)– Mean #9 = Mean for all Old people (Male and Female)Mean #9 = Mean for all Old people (Male and Female)– Mean #10 = Mean for all Males (Young, Medium, and Old)Mean #10 = Mean for all Males (Young, Medium, and Old)– Mean #11 = Mean for all Females (Young, Medium, and Old)Mean #11 = Mean for all Females (Young, Medium, and Old)
Young Young MediumMedium OldOld
Male Male Mean #1Mean #1 Mean #2Mean #2 Mean #3Mean #3 Mean #10Mean #10
FemaleFemale Mean #4Mean #4 Mean #5Mean #5 Mean #6Mean #6 Mean #11Mean #11
Mean #7Mean #7 Mean #8Mean #8 Mean #9Mean #9
Factorial ANOVAFactorial ANOVA
• We then calculate the Grand Mean ( We then calculate the Grand Mean ( ) )– This remains (This remains (ΣΣX)/N, or all of our X)/N, or all of our
observations added together, divided by observations added together, divided by the number of observationsthe number of observations
• We can also calculate SSWe can also calculate SStotaltotal, which is , which is also calculated the same as in a one-also calculated the same as in a one-way ANOVAway ANOVA
..X
N
XX
22
Factorial ANOVAFactorial ANOVA
• Next we want to calculate our SS Next we want to calculate our SS terms for our IV’sterms for our IV’s
•Same as SSSame as SStreattreat in one-way ANOVA, but with in one-way ANOVA, but with one small additionone small addition
– SSSSIVIV = nx = nxΣΣ( - )( - )22
•n = number of subjects per group/level of n = number of subjects per group/level of our IVour IV
•x = number of groups/levels in the x = number of groups/levels in the otherother IV IV
IVX ..X
Factorial ANOVAFactorial ANOVA
– SSSSIVIV = nx = nxΣΣ( - )( - )22
1.1. Subtract the grand mean from each of our levels Subtract the grand mean from each of our levels meansmeans• For SSFor SSgendergender, this would involve subtracting the mean , this would involve subtracting the mean
for males from the grand mean, and the mean for for males from the grand mean, and the mean for females from the grand meanfemales from the grand mean
• Note: The number of values should equal the number Note: The number of values should equal the number of levels of your IVof levels of your IV
2.2. Square all of these valuesSquare all of these values3.3. Add all of these values upAdd all of these values up4.4. Multiply this number by the number of subjects in Multiply this number by the number of subjects in
each cell x the number of levels of the each cell x the number of levels of the otherother IV IV5.5. Repeat for any IV’sRepeat for any IV’s
• Using the previous example, we would have both Using the previous example, we would have both SSSSgendergender and SS and SSageage
IVX ..X
Factorial ANOVAFactorial ANOVA
• Next we want to calculate SSNext we want to calculate SScellscells, which has a , which has a formula similar to SSformula similar to SSIVIV
– SSSScells cells ==
1.1. Subtract the grand mean from each of our cell meansSubtract the grand mean from each of our cell means• Note: The number of values should equal the number of cellsNote: The number of values should equal the number of cells
2.2. Square all of these valuesSquare all of these values
3.3. Add all of these values upAdd all of these values up
4.4. Multiply this number by the number of subjects in each cellMultiply this number by the number of subjects in each cell
2..XXn cell
Factorial ANOVAFactorial ANOVA
• A brief note on SSA brief note on SScellscells
– Represents variability in individual cell Represents variability in individual cell meansmeans
– Cell means differ for 4 reaons:Cell means differ for 4 reaons:1.1. ErrorError
2.2. Effects of IV#1 (Gender)Effects of IV#1 (Gender)
3.3. Effects of IV#2 (Age)Effects of IV#2 (Age)
4.4. Effects of interaction(s)Effects of interaction(s)
Factorial ANOVAFactorial ANOVA
T̶We’ve already accounted for variability due to We’ve already accounted for variability due to error (SSerror (SSerrorerror), so subtracting the variability due ), so subtracting the variability due to Gender (SSto Gender (SSgendergender) and Age (SS) and Age (SSageage) from SS) from SScellscells leaves us with the effects of our interaction leaves us with the effects of our interaction (SS(SSintint))
– SSSSintint = SS = SScellscells – SS – SSIV1IV1 – SS – SSIV2IV2 – etc… – etc…• Going back to our previous example, Going back to our previous example,
SSSSintint = SS = SScellscells – SS – SSgendergender – SS – SSageage
– SSSSerrorerror = SS = SStotaltotal – SS – SScellscells
Factorial ANOVAFactorial ANOVA
• Similar to a one-way ANOVA, factorial Similar to a one-way ANOVA, factorial ANOVA uses df to obtain MSANOVA uses df to obtain MS– dfdftotaltotal = N – 1 = N – 1
– dfdfIVIV = k – 1 = k – 1
• Using the previous example, dfUsing the previous example, dfageage = 3 = 3 (Young/Medium/Old) – 1 = 2 and df(Young/Medium/Old) – 1 = 2 and dfgendergender = 2 = 2 (Male/Female) – 1 = 1(Male/Female) – 1 = 1
– dfdfintint = df = dfIV1IV1 x df x dfIV2IV2 x etc… x etc…
• Again, using the previous example, dfAgain, using the previous example, df intint = 2 x 1 = 2 = 2 x 1 = 2
– dfdferrorerror = df = dftotaltotal – df – dfintint - df - dfIV1IV1 – df – dfIV2IV2 – etc… – etc…
Factorial ANOVAFactorial ANOVA
• Factorial ANOVA provides you with Factorial ANOVA provides you with FF--statistics for all main effects and statistics for all main effects and interactionsinteractions– Therefore, we need to calculate MS for all of Therefore, we need to calculate MS for all of
our IV’s (our main effects) and the our IV’s (our main effects) and the interactioninteraction
– MSMSIVIV = SS = SSIVIV/df/dfIVIV
•We would do this for each of our IV’sWe would do this for each of our IV’s
– MSMSintint = SS = SSintint/df/dfintint
– MSMSerrorerror = SS = SSerrorerror/df/dferrorerror
Factorial ANOVAFactorial ANOVA
• We then divide each of our MS’s by MSWe then divide each of our MS’s by MSerrorerror to obtain our to obtain our F F - statistics- statistics
• Finally, we compare this with our critical Finally, we compare this with our critical FF to determine if we accept or reject Hto determine if we accept or reject Hoo– All of our main effects and our interaction have All of our main effects and our interaction have
their own critical F’stheir own critical F’s– Just as in the one-way ANOVA, use table E.3 or Just as in the one-way ANOVA, use table E.3 or
E.4 depending on your alpha level (.05 or .01)E.4 depending on your alpha level (.05 or .01)– Just as in the one-way ANOVA, “df numerator” Just as in the one-way ANOVA, “df numerator”
= the df for the term in question (the IV’s or = the df for the term in question (the IV’s or their interaction) and “df denominator” = dftheir interaction) and “df denominator” = dferrorerror
Factorial ANOVAFactorial ANOVA
• Just like in a one-way ANOVA, a Just like in a one-way ANOVA, a significant significant FF in factorial ANOVA in factorial ANOVA doesn’t tell you which groups/levels doesn’t tell you which groups/levels of your IV’s are differentof your IV’s are different– There are several possible ways to There are several possible ways to
determine where differences liedetermine where differences lie
Factorial ANOVAFactorial ANOVA
• Multiple Comparison Techniques in Multiple Comparison Techniques in Factorial ANOVA:Factorial ANOVA:
1.1. Several one-way ANOVA’s (as many as there Several one-way ANOVA’s (as many as there are IV’s) with their corresponding multiple are IV’s) with their corresponding multiple comparison techniquescomparison techniques– Probably the most common methodProbably the most common method
– A priori/post hoc techniques the same as one-way A priori/post hoc techniques the same as one-way ANOVAANOVA
2.2. Analysis of Simple EffectsAnalysis of Simple Effects– Calculate MS for each cell/simple effect, obtain an Calculate MS for each cell/simple effect, obtain an FF
for each one and determine its associated for each one and determine its associated pp-value-value
Factorial ANOVAFactorial ANOVA
• Multiple Comparison Techniques in Multiple Comparison Techniques in Factorial ANOVA:Factorial ANOVA:– In addition, interactions must be In addition, interactions must be
decomposed to determine what they meandecomposed to determine what they mean•A significant interaction between two variables A significant interaction between two variables
means that one IV’s value changes as a function means that one IV’s value changes as a function of the other, but gives no specific informationof the other, but gives no specific information
•The most simple and common method of The most simple and common method of interpreting interactions is to look at a graphinterpreting interactions is to look at a graph
• Interpreting Interactions:Interpreting Interactions:– In the example above, you can see that for Males, as age In the example above, you can see that for Males, as age
increases, Performance increases, whereas for Females there is increases, Performance increases, whereas for Females there is no relation between Age and Performanceno relation between Age and Performance
– To interpret an interaction, we graph the DV on the y-axis, place To interpret an interaction, we graph the DV on the y-axis, place one IV on the x-axis, and define the lines by the other IVone IV on the x-axis, and define the lines by the other IV• You may have to try switching the IV’s if you don’t get a nice You may have to try switching the IV’s if you don’t get a nice
interaction pattern the first timeinteraction pattern the first time
AGE
OldMediumYoung
Pe
rfo
rma
nce
40
30
20
10
0
GENDER
Male
Female
Factorial ANOVAFactorial ANOVA
• Effect Size in Factorial ANOVA:Effect Size in Factorial ANOVA:– ηη22 (eta squared) = SS (eta squared) = SSIVIV/SS/SStotal total (for any of (for any of
the IV’s)the IV’s) or SSor SSintint/SS/SStotal total (for the (for the interaction)interaction)•Tells you the percent of variability in the DV Tells you the percent of variability in the DV
accounted for by the IV/interactionaccounted for by the IV/interaction
•Like the one-way ANOVA, very easily Like the one-way ANOVA, very easily computed and commonly used, but also computed and commonly used, but also very biased – don’t ever use itvery biased – don’t ever use it
Factorial ANOVAFactorial ANOVA
• Effect Size in Factorial ANOVA:Effect Size in Factorial ANOVA:– ωω22 (omega squared) = (omega squared) =
•oror
•Also provides an estimate of the percent of Also provides an estimate of the percent of variability in the DV accounted for by the variability in the DV accounted for by the IV/interaction, but is not biasedIV/interaction, but is not biased
errortotal
errorIVIV
MSSS
MSdfSS
errortotal
error
MSSS
MSdfSS
intint
Factorial ANOVAFactorial ANOVA
• Effect Size in Factorial ANOVA:Effect Size in Factorial ANOVA:– Cohen’s d = Cohen’s d =
•The two means can be between two IV’s, or The two means can be between two IV’s, or between two groups/levels within an IV, between two groups/levels within an IV, depending on what you want to estimatedepending on what you want to estimate
•Reminder: Cohen’s conventions for d – small Reminder: Cohen’s conventions for d – small = .3, medium = .5, large = .8= .3, medium = .5, large = .8
ps
XX 21
Factorial ANOVAFactorial ANOVA
• Example #1:Example #1:– The previous example used data from The previous example used data from
Eysenck’s (1974) study of the effects of age Eysenck’s (1974) study of the effects of age and various conditions on memory and various conditions on memory performance. Another aspect of this study performance. Another aspect of this study manipulated depth of processing more directly manipulated depth of processing more directly by placing the participants into conditions that by placing the participants into conditions that directly elicited High or Low levels of directly elicited High or Low levels of processing. Age was maintained as a variable processing. Age was maintained as a variable and was subdivided into Young and Old groups. and was subdivided into Young and Old groups. The data is as follows:The data is as follows:
Factorial ANOVAFactorial ANOVA
• Young/Low: 8 6 4 6 7 6 5 7 9 7Young/Low: 8 6 4 6 7 6 5 7 9 7• Young/High: 21 19 17 15 22 16 22 22 18 Young/High: 21 19 17 15 22 16 22 22 18
21 21• Old/Low: 9 8 6 8 10 4 6 5 7 7Old/Low: 9 8 6 8 10 4 6 5 7 7• Old/High: 10 19 14 5 10 11 14 15 11 11Old/High: 10 19 14 5 10 11 14 15 11 11
1.1. What are the IV’s and the DV’s, and the What are the IV’s and the DV’s, and the number of levels of each?number of levels of each?
2.2. What are the number of cells?What are the number of cells?3.3. What are the various df’s?What are the various df’s?
Factorial ANOVAFactorial ANOVA
• IV = Age (2 IV = Age (2 levels) and levels) and Condition (2 Condition (2 levels)levels)
• 2 x 2 ANOVA 2 x 2 ANOVA = 4 cells= 4 cells
• ddageage = .70 = .70
• ddconditioncondition = 1.82 = 1.82
• ddintint = .80 = .80
Between-Subjects Factors
Young 20
Old 20
Low 20
High 20
.00
1.00
AGE
.00
1.00
CONDITIO
Value Label N
Descriptive Statistics
Dependent Variable: MEMPERF
6.5000 1.43372 10
19.3000 2.66875 10
12.9000 6.88935 20
7.0000 1.82574 10
12.0000 3.74166 10
9.5000 3.84571 20
6.7500 1.61815 20
15.6500 4.90193 20
11.2000 5.76995 40
CONDITIOLow
High
Total
Low
High
Total
Low
High
Total
AGEYoung
Old
Total
Mean Std. Deviation N
Tests of Between-Subjects Effects
Dependent Variable: MEMPERF
1059.800a
3 353.267 53.301 .000 .816
5017.600 1 5017.600 757.056 .000 .955
115.600 1 115.600 17.442 .000 .326
792.100 1 792.100 119.512 .000 .769
152.100 1 152.100 22.949 .000 .389
238.600 36 6.628
6316.000 40
1298.400 39
SourceCorrected Model
Intercept
AGE
CONDITIO
AGE *CONDITIO
Error
Total
Corrected Total
Type III Sumof Squares df Mean Square F Sig.
Partial EtaSquared
R Squared = .816 (Adjusted R Squared = .801)a.
Factorial ANOVAFactorial ANOVA
• Decomposing the Decomposing the interaction:interaction:
AGE
OldYoung
Me
an
PE
RF
OR
MA
22
20
18
16
14
12
10
8
6
4
CONDITIO
Low
High
CONDITIO
HighLow
Me
an
PE
RF
OR
MA
22
20
18
16
14
12
10
8
6
4
AGE
Young
Old