Regression designs Growth rate Y 110 Plant size X1X1 X Y
Regression designs Growth rate Y 110 Plant size X1X Growth rate Y 110 Plant size X1X1 X Y X Y
Regression designs Growth rate Y 110 Plant size X1X Growth rate Y 110 Plant size X1X Growth rate Y 01 Plant size X1X1 X Y X Y X Y Code 0=small, 1=large
Growth rate Y 01 Plant size X1X1 X Y Code 0=small, 1=large Growth = m*Size + b Questions on the general equation above: 1. What parameter predicts the growth of a small plant? 2. Write an equation to predict the growth of a large plant. 3. Based on the above, what does “m” represent?
Growth rate Y 01 Plant size X1X1 X Y Code 0=small, 1=large Growth = m*Size + b If small Growth = m*0 + b If large Growth = m*1 + b Large - small = m Growth of small Difference in growth
What about “covariates”… - looking at the effect of salmon on tree growth rates Nitrogen
Compare tree growth around 2 streams, one with and one without salmon Growth rate (g/day) Salmon No Salmon t (9) = 0.06, p = 0.64
Is something else having an effect? Growth rate (g/day) Salmon No Salmon Plant height (cm)
In an Analysis of Covariance, we look at the effect of a treatment (categorical) while accounting for a covariate (continuous) ANCOVA Salmon No Salmon Plant height (cm) Growth rate (g/day)
Fertilizer treatment (X 1 ): code as 0 = No Salmon; 1 = Salmon Plant height (X 2 ): continuous ANCOVA Salmon No Salmon Plant height (cm) Growth rate (g/day)
Plant height (cm) Growth rate (g/day) ANCOVA X1X2Y ::: ::: X1*X2 0 : ? ? Salmon No Salmon Fertilizer treatment (X 1 ): code as 0 = No Salmon; 1 = Salmon Plant height (X 2 ): continuous
1.Fit full model (categorical treatment, covariate, interaction) Y=m 1 X 1 + m 2 X 2 +m 3 X 1 X 2 +b ANCOVA Salmon No Salmon Plant height (cm) Growth rate (g/day)
ANCOVA Questions: Write out equation for No Salmon (X 1 = 0) Write out equation for Salmon (X 1 = 1) What differs between two equations? If no interaction (i.e. m 3 = 0) what differs between eqns? 1.Fit full model (categorical treatment, covariate, interaction) Y=m 1 X 1 + m 2 X 2 +m 3 X 1 X 2 +b
ANCOVA If X 1 =0: Y=m 1 X 1 + m 2 X 2 +m 3 X 1 X 2 +b If X 1 =1: Y=m 1 + m 2 X 2 +m 3 X 2 +b Difference: m 1 +m 3 X 2 1.Fit full model (categorical treatment, covariate, interaction) Y=m 1 X 1 + m 2 X 2 +m 3 X 1 X 2 +b Difference if no interaction: m 1 +m 3 X 2
Plant height (cm) Growth rate (g/day) Plant height (cm) Growth rate (g/day) Difference between categories…. Constant, doesn’t depend on covariate Depends on covariate = m 1 (no interaction) = m 1 + m 3 X 2 (interaction)
1.Fit full model (categorical treatment, covariate, interaction) 2.Test for interaction (if significant- stop!) ANCOVA If no interaction, the lines will be parallel Salmon No Salmon Plant height (cm) Growth rate (g/day)
1.Fit full model (categorical treatment, covariate, interaction) 2.Test for interaction (if significant- stop!) 3.Test for differences in intercepts between lines = m 1 ANCOVA No interaction Intercepts differ Plant height (cm) Growth rate (g/day) m 1
Multiple X variables: Both categorical …………... ANOVA One categorical, one continuous……………...ANCOVA Both continuous …………....Multiple Regression
Regression’s deep dark secret: Order matters! Input: heightp=0.001 weight p=0.34 agep=0.07 Input: heightp=0.001 age p=0.04 weightp=0.88 Why? In the first order, even though weight wasn’t significant, it explained some of the variation before age was tested. Common when x-variables are correlated with each other.