Workshop 7.6a: Factorial ANOVA Murray Logan 19 Jul 2017
Section 1 Background
Factorial ANOVA
Factorial ANOVA Response (mean growth rate of seedlings) Response (mean growth rate of seedlings) a) b) ● ● ● ● ● ● ● ● High Low High Low Factor A (temperature) Factor A (temperature) Response (mean growth rate of seedlings) Response (mean growth rate of seedlings) c) d) ● ● ● ● ● ● ● ● High Low High Low Factor A (temperature) Factor A (temperature)
The linear model Two-factor Low N Medium N High N Low temp. XXX XXX XXX High temp XXX XXX XXX y ijk = µ + α i + β j + α i β j + ε ijk • α i is the effect of the i th temperature • β j is the effect of the j th nitrogen level • α i β j is the effect of the ij th interaction.
Low High Low Medium Low Medium Low Medium Low High Low High Low High High Low High Low Low Low Low High High High High High High High Medium Medium Low High Medium Temp Nitrogen ------ ---------- Low Low High The linear model Two-factor Low N Medium N High N Low temp. XXX XXX XXX High temp XXX XXX XXX y i i i i i i i i i
1 0 0 High Low NA 1 1 0 0 0 0 High Medium NA 1 1 1 0 1 0 0 High Medium 1 0 0 1 0 0 High Low NA 1 1 0 0 0 0 High Low NA 1 0 NA NA 0 High High NA 1 1 0 1 1 0 High High NA 1 1 0 1 0 1 1 1 1 1 1 0 1 0 High Medium NA 1 1 0 0 1 0 High High NA 1 1 1 High 0 NA 0 0 0 0 0 Low Low 1 NA 0 0 0 0 0 Low Medium NA 1 Low Low ---- ------ ---- ------------- ------- --------- ------- --------------- ------------- NA (Intercept) THigh NMedium NHigh THigh:NMedium THigh:NHigh Low Low Low NA 1 0 0 0 0 0 1 1 T 0 High NA 1 0 0 1 0 Low 0 High NA 1 0 0 1 0 0 Low 0 0 1 0 0 Low Medium NA 1 0 0 0 0 0 Low Medium NA 1 0 1 N The linear model Two-factor
The linear model Two-factor Low N Medium N High N Low temp. XXX XXX XXX High temp XXX XXX XXX y i = β 0 i + β 1 i + β 2 i + β 3 i + β 4 i + β 5 i + β 6 i + ε i • β 0 is the mean of the T L : N L group • β 1 is the difference between T H : N L and T L : N L • β 2 is the difference between T L : N M and T L : N L
The linear model Two-factor Low N Medium N High N Low temp. XXX XXX XXX High temp XXX XXX XXX y ijk = µ + α i + β j + α i β j + ε ijk • α i is the effect of the i th temperature at the base level of β
Factorial ANOVA Factor MS F-ratio (both F-ratio (A F-ratio (both fixed) fixed, B ran- random) dom) MS A / MS Resid MS A / MS A : B MS A / MS A : B A MS A MS B / MS Resid MS B / MS Resid MS B / MS A : B B MS B A:B MS A : B MS A : B / MS Resid MS A : B / MS Resid MS A : B / MS Resid
Section 2 Design Balance
Balance When balanced SS TOTAL = SS A + SS B + SS A : B + SS Resid
Factoral ANOVA n c e l a b a i g n D e s • When balanced SS TOTAL = SS A + SS B + SS A : B + SS Resid • When not balanced SS TOTAL ̸ = SS A + SS B + SS A : B + SS Resid
Factorial ANOVA
Factoral ANOVA e a n c b a l g n e s i D • When balanced SS TOTAL = SS A + SS B + SS A : B + SS Resid • When not balanced SS TOTAL ̸ = SS A + SS B + SS A : B + SS Resid • cant use sequential SS (Type I SS) should use either hierarchical (Type II SS) marginal (Type III SS)
Factorial ANOVA
Factorial ANOVA n s t i o u m p A s s • Normality • Homogeneity of variance • Independence • Considerations for Balance
Section 3 Worked examples
> #Worked examples > stehman <- read.csv ('../data/stehman.csv', strip.white=T) Error in file(file, "rt"): cannot open the connection > head (stehman) Error in head(stehman): object 'stehman' not found Worked examples
Worked Examples Question: what effects do pH and health have on the bud emergence rating of spruce seedlings Linear model: ε ∼ N (0 , σ 2 ) Buds ijk = µ + α i + β j + α i β j + ε ijk
Error in head(quinn): object 'quinn' not found Error in file(file, "rt"): cannot open the connection Worked Examples
Worked Examples Question: what effects do season and density have on barnacle recruitment Linear model: ε ∼ N (0 , σ 2 ) Recruits ijk = µ + α i + β j + α i β j + ε ijk
Recommend
More recommend