Regression designs

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

description

9. 8. 7. Growth rate. 6. Y. 5. 4. 3. 2. 1. 0. Regression designs. 1. 10. Plant size. X 1. X Y 11.5 23.3 44.0 64.5 85.2 1072. 9. 9. 8. 8. 7. 7. Growth rate. Growth rate. 6. 6. Y. Y. 5. 5. 4. 4. 3. 3. 2. 2. 1. 1. 0. 0. 1. 10. Plant size. X 1. - PowerPoint PPT Presentation

Transcript of Regression designs

Page 1: Regression designs

Regression designs

0123456789

Gro

wth

rat

e

Y

1 10Plant size

X1

X Y1 1.52 3.34 4.06 4.58 5.210 72

Page 2: Regression designs

Regression designs

0123456789

Gro

wth

rat

e

Y

1 10Plant size

X1

0123456789

Gro

wth

rat

e

Y

1 10Plant size

X1

X Y1 1.52 3.34 4.06 4.58 5.210 72

X Y1 0.81 1.71 3.010 5.210 7.010 8.5

Page 3: Regression designs

Regression designs

0123456789

Gro

wth

rat

e

Y

1 10Plant size

X1

0123456789

Gro

wth

rat

e

Y

1 10Plant size

X1

0123456789

Gro

wth

rat

e

Y

0 1Plant size

X1

X Y1 1.52 3.34 4.06 4.58 5.210 7.2

X Y1 0.81 1.71 3.010 5.210 7.010 8.5

X Y0 0.80 1.70 3.01 5.21 7.01 8.5

Code 0=small, 1=large

Page 4: Regression designs

0123456789

Gro

wth

rat

e

Y

0 1Plant size

X1

X Y0 0.80 1.70 3.01 5.21 7.01 8.5

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?

Page 5: Regression designs

0123456789

Gro

wth

rat

e

Y

0 1Plant size

X1

X Y0 0.80 1.70 3.01 5.21 7.01 8.5

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 smallDifference in growth

Page 6: Regression designs

What about “covariates”…- looking at the effect of salmon on tree growth rates

Nitrogen

Page 7: Regression designs

Compare tree growth around 2 streams, one with and one without salmon

0

2

4

6

8

10

12

0 2 4 6

Gro

wth

ra

te (

g/d

ay)

Salmon No Salmon

t(9) = 0.06, p = 0.64

Page 8: Regression designs

In an Analysis of Covariance, we look at the effect of a treatment (categorical) while accounting for a covariate (continuous)

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

Salmon No Salmon

Page 9: Regression designs

Fertilizer treatment (X1): code as 0 = No Salmon; 1 = Salmon

Plant height (X2): continuous

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

SalmonNo Salmon

Page 10: Regression designs

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

X1 X2 Y0 1 1.10 2 4.0: : :1 1 3.11 2 5.2: : :1 5 11.3

X1*X200:12

5

?

?

Salmon

No Salmon

Fertilizer treatment (X1): code as 0 = No Salmon; 1 = Salmon

Plant height (X2): continuous

Page 11: Regression designs

1. Fit full model (categorical treatment, covariate, interaction)

Y=m1X1+ m2X2 +m3X1X2 +b

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

SalmonNo Salmon

Page 12: Regression designs

ANCOVA

Questions:

• Write out equation for No Salmon (X1= 0)

• Write out equation for Salmon (X1 = 1)

• What differs between two equations?

• If no interaction (i.e. m3 = 0) what differs between eqns?

1. Fit full model (categorical treatment, covariate, interaction)

Y=m1X1+ m2X2 +m3X1X2 +b

Page 13: Regression designs

ANCOVA

If X1=0: Y=m1X1+ m2X2 +m3X1X2 +b

If X1=1: Y=m1 + m2X2 +m3X2 +b

Difference: m1 +m3X2

1. Fit full model (categorical treatment, covariate, interaction)

Y=m1X1+ m2X2 +m3X1X2 +b

Difference if

no interaction: m1 +m3X2

Page 14: Regression designs

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

Difference between categories….

Constant, doesn’t depend on covariate

Depends on covariate

= m1 (no interaction)= m1 + m3X2

(interaction)

Page 15: Regression designs

1. Fit full model (categorical treatment, covariate, interaction)

2. Test for interaction (if significant- stop!)

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

If no interaction, the lines will be parallel

SalmonNo Salmon

Page 16: Regression designs

1. Fit full model (categorical treatment, covariate, interaction)

2. Test for interaction (if significant- stop!)3. Test for differences in intercepts between

lines = m1

ANCOVA

0

2

4

6

8

10

12

0 2 4 6

Plant height (cm)

Gro

wth

ra

te (

g/d

ay)

No interactionIntercepts differ

} m1

Page 17: Regression designs

Multiple X variables:

Both categorical …………... ANOVA

One categorical, one continuous……………...ANCOVA

Both continuous …………....Multiple Regression

Page 18: Regression designs

Regression’s deep dark secret:

Order matters!

Input: height p=0.001weight p=0.34age p=0.07

Input: height p=0.001age p=0.04weight 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.