ancova regression with more than one line andrew jackson [email protected]
TRANSCRIPT
![Page 2: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/2.jpg)
Focus on gene / environment effects
• Prof. Donal Manahan’s seminar “Evolution and development: an ecological perspective” 3/11/2011
• Growth rates are affected by extrinsic environmental conditions
• Growth rates are affected by intrinsic physiological factors which may be governed by genetic factors
![Page 3: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/3.jpg)
Experiments
• Rear larval oysters at different temperatures• Record simple growth rate as mm/week• Repeat the experiment with different
genotypes
![Page 4: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/4.jpg)
The effect of temperature
Intercept = 5, slope = 1.3
![Page 5: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/5.jpg)
The effect of genotype
![Page 6: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/6.jpg)
The effect of both together
![Page 7: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/7.jpg)
How do these lines differ?
• Temperature affects both genotypes equally
• There is a fixed effect of genotype– Constant for all temperatures
• The red genotype grows faster than the black one
• coefficients– Slopes = 1.3– red intercept = 8– black intercept=5
![Page 8: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/8.jpg)
A different genotype
![Page 9: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/9.jpg)
How do these lines differ?
• There is still an effect of temperature
• But, now it is different for each genotype
• The effect of genotype is no longer fixed for all temperatures
• There is an interaction between temperature (environment) and genotype
• Coefficients– Green slope = 1.8, intercept = 8– Black slope = 1.3, intercept = 5
![Page 10: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/10.jpg)
A slightly different question
And why its important to consider the linear covariate when comparing
between groups
![Page 11: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/11.jpg)
• Known as:• Analysis of Covariance:
ANCOVA• Also a GLM with fixed
factors and linear covariates
How do we compare two lines statistically?
![Page 12: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/12.jpg)
• Experiment to study effect of herbivores on primary productivity in ecosystems
• Series of in situ exclusion experiments
• Measured:– Seed mass (g)– Grazed / Ungrazed– Root diameter at start of
experiment
An alternative dataset
![Page 13: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/13.jpg)
The Data
Root Fruit Grazing
6.225 59.77 Ungrazed
6.487 60.98 Ungrazed
4.919 14.73 Ungrazed
5.13 19.28 Ungrazed
5.417 34.25 Ungrazed
5.359 35.53 Ungrazed
8.643 78.28 Grazed
7.916 41.48 Grazed
9.351 98.47 Grazed
7.066 40.15 Grazed
8.158 52.26 Grazed
7.382 46.64 Grazed
8.515 71.01 Grazed
8.53 83.03 Grazed
Covariate Response Fixed Factor
![Page 14: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/14.jpg)
Questions to ask
• How does grazing affect seed production?• Why was root diameter recorded?– How might this have changed the picture if it were
omitted?• What do we need to
test statistically to address our hypothesis?
![Page 15: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/15.jpg)
• Pick one line to be the reference (e.g. Grazed)
• What is the equation for the Grazed line?– Seed = b0 + b1Root
• What is the equation for Ungrazed line?– Seed = b0 + bug + b1Root
Testing parallel lines
![Page 16: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/16.jpg)
Testing parallel Lines in R
• Call:• glm(formula = Fruit ~ Root + Grazing, data = mydata)
• Deviance Residuals: • Min 1Q Median 3Q Max • -17.1920 -2.8224 0.3223 3.9144 17.3290
• Coefficients:• Estimate Std. Error t value Pr(>|t|) • (Intercept) -127.829 9.664 -13.23 1.35e-15 ***• Root 23.560 1.149 20.51 < 2e-16 ***• GrazingUngrazed 36.103 3.357 10.75 6.11e-13 ***• ---• Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
• AIC: 271.13
• Number of Fisher Scoring iterations: 2
![Page 17: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/17.jpg)
• Pick one line to be the reference (e.g. Grazed)
• What is the equation for the Grazed line?– Seed = b0 + b1Root
• What is the equation for Ungrazed line?– Seed = b0 + bug +
(b1+b2)Root
– Seed = b0 + bug + b1Root + b2Root_UG
Testing non-parallel lines
![Page 18: ANCOVA Regression with more than one line Andrew Jackson a.jackson@tcd.ie](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d0e5503460f949e41a0/html5/thumbnails/18.jpg)
Testing parallel Lines in R
• Call:• glm(formula = Fruit ~ Root * Grazing, data = mydata)• Deviance Residuals: • Min 1Q Median 3Q Max • -17.3177 -2.8320 0.1247 3.8511 17.1313
• Coefficients:• Estimate Std. Error t value Pr(>|t|) • (Intercept) -125.173 12.811 -9.771 1.15e-11 ***• Root 23.240 1.531 15.182 < 2e-16 ***• GrazingUngrazed 30.806 16.842 1.829 0.0757 . • Root:GrazingUngrazed 0.756 2.354 0.321 0.7500 • ---• Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
• AIC: 273.01
• Number of Fisher Scoring iterations: 2