Presentation is loading. Please wait.

Presentation is loading. Please wait.

Regression designs Y X1 Plant size Growth rate 1 10

Similar presentations


Presentation on theme: "Regression designs Y X1 Plant size Growth rate 1 10"— Presentation transcript:

1 Regression designs Y X1 Plant size 1 2 3 4 5 6 7 8 9 Growth rate 1 10
1 2 3 4 5 6 7 8 9 Growth rate Y 1 10 Plant size X1 X Y 1 1.5 2 3.3 4 4.0 6 4.5 8 5.2 10 72

2 Regression designs Y Y X1 X1 Plant size Plant size 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 Growth rate Y 1 2 3 4 5 6 7 8 9 Growth rate Y 10 Plant size X1 1 10 Plant size X1 X Y 1 1.5 2 3.3 4 4.0 6 4.5 8 5.2 10 72 X Y 1 0.8 1 1.7 1 3.0 10 5.2 10 7.0 10 8.5

3 Regression designs Y Y X1 Y X1 X1 Code 0=small, 1=large Plant size
1 2 3 4 5 6 7 8 9 Growth rate Y 1 2 3 4 5 6 7 8 9 Growth rate Y 10 Plant size X1 1 2 3 4 5 6 7 8 9 Growth rate Y Plant size X1 1 10 Plant size X1 X Y 1 1.5 2 3.3 4 4.0 6 4.5 8 5.2 10 7.2 X Y 1 0.8 1 1.7 1 3.0 10 5.2 10 7.0 10 8.5 X Y 0 0.8 0 1.7 0 3.0 1 5.2 1 7.0 1 8.5

4 Growth = m*Size + b Y X1 Questions on the general equation above:
Code 0=small, 1=large Growth = m*Size + b 1 2 3 4 5 6 7 8 9 Growth rate Y Plant size X1 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? X Y 0 0.8 0 1.7 0 3.0 1 5.2 1 7.0 1 8.5

5 Growth = m*Size + b If small Y Growth = m*0 + b If large X1
Difference in growth Growth of small Code 0=small, 1=large Growth = m*Size + b 1 2 3 4 5 6 7 8 9 Growth rate Y Plant size X1 If small Growth = m*0 + b If large Growth = m*1 + b X Y 0 0.8 0 1.7 0 3.0 1 5.2 1 7.0 1 8.5 Large - small = m

6 Two (or more) X variables:
Both categorical …………... ANOVA One categorical, one continuous……………...ANCOVA

7 ANCOVA In an Analysis of Covariance, we look at the effect of a treatment (categorical) while accounting for a covariate (continuous) Fertilized P Fertilized N Growth rate (g/day) Plant height (cm)

8 ANCOVA Fertilizer treatment (X1): code as 0 = N; 1 =P
Plant height (X2): continuous Fertilized P Fertilized N Growth rate (g/day) Plant height (cm)

9 ANCOVA Fertilizer treatment (X1): code as 0 = N; 1 = P
Plant height (X2): continuous ? X1 X2 Y : : : X1*X2 : 1 2 5 Growth rate (g/day) ? Fertilized P Fertilized N Plant height (cm)

10 ANCOVA Fit full model (categorical treatment, covariate, interaction)
Y=m1X1+ m2X2 +m3X1X2 +b Fertilized P Fertilized N Growth rate (g/day) Plant height (cm)

11 ANCOVA Fit full model (categorical treatment, covariate, interaction)
Y=m1X1+ m2X2 +m3X1X2 +b Questions: Write out equation for N fertilizer (X1= 0) Write out equation for P fertilizer (X1 = 1) What differs between two equations? If no interaction (i.e. m3 = 0) what differs between eqns?

12 ANCOVA Fit full model (categorical treatment, covariate, interaction)
Y=m1X1+ m2X2 +m3X1X2 +b If X1=0: Y=m1X1+ m2X2 +m3X1X2 +b If X1=1: Y=m m2X2 +m3X b Difference: m1 +m3X2 Difference if no interaction: m1 +m3X2

13 Difference between categories….
Constant, doesn’t depend on covariate Depends on covariate = m1 + m3X2 (interaction) = m1 (no interaction) 12 10 8 Growth rate (g/day) Growth rate (g/day) 6 4 2 2 4 6 Plant height (cm) Plant height (cm)

14 ANCOVA Fit full model (categorical treatment, covariate, interaction)
Test for interaction (if significant- stop!) If no interaction, the lines will be parallel Growth rate (g/day) Plant height (cm)

15 ANCOVA Fit full model (categorical treatment, covariate, interaction) Test for interaction (if significant- stop!) Test for differences in intercepts between lines = m1 } m1 Growth rate (g/day) No interaction Intercepts differ Plant height (cm)

16 Multiple X variables: Both categorical …………... ANOVA One categorical, one continuous……………...ANCOVA Both continuous …………....?

17 Multiple regression Herbivore damage Higher nutrient trees Lower nutrient trees Tree age Damage= m1*age + b

18 Herbivore damage Tree age Residuals of herbivore damage Tree nutrient concentration

19 Damage= m1*age + m2*nutrient + b
Herbivore damage Tree age Residuals of herbivore damage Tree nutrient concentration

20 No interaction (additive):
Interaction (non-additive): y y Damage= m1*age + m2*nutrient + m3*age*nutrient +b

21 Non-linear regression? Just a special case of multiple regression!
X2 X1 X X2 Y Y = m1 x +m2 x2 +b Y = m1 x1 +m2 x2 +b

22 Regression’s deep dark secret:
Order matters! Input: height p=0.001 weight p=0.34 age p=0.07 age p=0.04 weight p=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.

23 Solutions? 1) Use a logical order. For example in ANCOVA it makes sense to test the interaction first 2) Stepwise regression: “tries out” various orders of removing variables.


Download ppt "Regression designs Y X1 Plant size Growth rate 1 10"

Similar presentations


Ads by Google