Sie sind auf Seite 1von 17

ANCOVA

(Analysis of Covariance)
Katie Langin BIOL 843

Linear Models: A Summary


Y One-way ANOVA Two-way ANOVA Two-way ANOVA w/ interaction Simple Linear Regression Multiple Regression Multivariate Regression MANOVA Y Y Y Y Y Y1, Y2, Y3 Y1, Y2, Y3 Model effect(s) A A, B A, B, A*B X X1, X2, X3 X1, X2, X3 A

Where does ANCOVA fit in?

Linear Regression

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

ANOVA

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

= ANCOVA

ANCOVA
Covariance
the degree to which two variables vary together (covary)

Analysis of covariance (ANCOVA)


procedure for comparing mean values of a response variable between groups when the response variable covaries with other continuous variables (covariates)

Linear Models: A Summary


Y One-way ANOVA Two-way ANOVA Two-way ANOVA w/ interaction Simple Linear Regression Multiple Regression Multivariate Regression MANOVA Y Y Y Y Y Y1, Y2, Y3 Y1, Y2, Y3 Model effect(s) A A, B A, B, A*B X X1, X2, X3 X1, X2, X3 A

ANCOVA

A, B X1, X2

Why use ANCOVA?


Including a covariate in the model can help reduce residual variation More powerful than the corresponding one-way or two-way ANOVA But, this is contingent on there being a good correlation between the covariate and the response variable

What is a covariate?
A source of variation that affects the response variable, but was not controlled for during study design (often observational studies). It cannot be related to any categorical factor being tested (i.e. must be independent). It serves to reduce the unexplained variance and thus increase the precision of group mean estimates.
Result is increased power!

An example from the sea

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Constable (1993)

ANCOVA: the math


yij = + 1 + (xij - x) + ij
yij = jth replicate observation of response variable = mean value of response variable 1 = 1 - = combined regression coefficient xij = covariate value for the jth replicate observation from the ith level of factor A x = mean value of covariate ij = unexplained error assoc. with jth replicate observation from the ith level of factor A

ANCOVA: the math


Adjusted Y values: yij(adj) = yij - (xij - x) = + 1 + ij Adjusted Y means: i(adj) = i - (xi - x)

ANOVA table for ANCOVA


Source df MS F-ratio

Factor A (adjusted) Residual (adjusted) Total (adjusted)

(p - 1)

SSA(adj) (p - 1) SSResidual(adj) p(n - 1) - 1

MSA(adj) MSResidual(adj)

p(n - 1) - 1

pn - 2

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

An Example
Sex and fruitfly longevity
response variable = longevity (log transformed) factor = partner type (5 treatments)
1. 2. 3. 4. 5. 1 virgin female per day 8 virgin females per day control (1 pregnant female per day) control (8 pregnant females per day) control (no females)

covariate = thorax length


(Partridge and Farquhar 1981)

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Fruitfly example
Fit Model: (log longevity)ij = overall mean + (treatment)i + (thorax length)ij + ij
H0: no significant difference in longevity (adjusted for thorax length) between treatment groups

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Fruitfly example: ANOVA


Source Treatment Residual C. Total r2 = 0.35 df 4 120 124 SS 0.98 1.85 2.83 MS 0.24 0.02 F 15.85 P <0.001

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Fruitfly example: ANCOVA


Source Treatment Thorax Residual r2 = 0.71 H0 rejected: adjusted treatment means were significantly different between groups. Also reject H0 of zero pooled regression slope. df 4 1 119 MS 0.196 1.017 0.007 F 27.97 145.44 P <0.001 <0.001

QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Fruitfly example
Treatment
1 2 3 4 5 (1 virgin) (8 virgin) (1 preg) (8 preg) (no partners)

Adjusted Mean
1.717 1.589 1.794 1.808 1.771 0.017

Unadjusted Mean
1.737 1.564 1.799 1.789 1.789 0.025

SE

Assumptions
Normality Homogeneity of variances Independence Linearity Covariate values not different among groups Fixed covariate Homogenous slopes

Assumptions
Normality Homogeneity of variances Independence Linearity Covariate values not different among groups Fixed covariate Homogenous slopes

Assumptions
Normality Homogeneity of variances Independence Linearity Covariate values not different among groups Fixed covariate Homogenous slopes

Assumptions
Normality Homogeneity of variances Independence Linearity Covariate values not different among groups Fixed covariate Homogenous slopes

Assumptions
Normality Homogeneity of variances Independence Linearity Covariate values not different among groups Fixed covariate Homogenous slopes

Homogenous Slopes
H0: 1 = 2 = i = To test: include interaction term (A*X) in the ANCOVA model. If P>0.05 (for A*X), H0 accepted
analyses can proceed without the interaction term.

If P<0.05, H0 rejected

Above test is stringent; examine plots of regression lines before concluding the slopes are heterogenous. If necessary, use Wilcox modification of the Johnson-Neyman procedure (described next). But remember that interactions can be interesting in their own right.

Wilcox modification of the Johnson-Neyman procedure


Post-hoc procedure for situations when slopes are heterogenous. Tests over what ranges of the covariate the group means are different Program available to run test on the texts website:
http://www.zoology.unimelb.edu.au/qkstats/software.html

Back to the sea


Heterogenous slopes Wilcox modification: Initial>Low cube root volume >2.95 High>Initial cube root volume >1.81 High>Low cube root volume >2.07
QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

An Example Using JMP: Predation risk perception in a hermit crab

Yet Another Example


Drug A LBS

LBI
(baseline bacteria count) Drug D LBS

Placeb o

LBS (LBS = bacteria count after treatment)

Drug example: ANOVA


where LBS = response variable Drug = factor df Model Error C. Total29 2 27 1289 SS 294 995 MS 147 37 F-ratio 3.98 P-value 0.03

Tukey post-hoc test: Drug A significantly different than Placebo

Oops! Improper Study Design!


25 20

ANOVA:
F = 3.67 P = 0.04

15

LSI
10

Drug A

Drug D

Placebo

Drug example: ANCOVA


where LBI is added as a covariate
Source Drug LBI df 2 1 SS 69 578 F 2.1 36.0 P 0.14 <0.0001

NOTE: No interaction between LBI and Drug (P=0.59).

Question: Was this technique appropriate? Why or why not?

Question: Was this technique appropriate? Why or why not? Answer: Inappropriate. An assumption was violated; the covariate values were not similar across groups.

Post hoc tests


Planned contrasts Unplanned comparisons
use Tukey test

Authors of text recommend planned contrasts

More Complex Designs


2 or more covariates
Response variable is adjusted for both covariates Test homogeneity of slopes for each covariate No collinearity between covariates

Factorial and nested designs


To test for homogenous slopes, include in the model interactions between covariate and each factor and between covariate and factor interactions (i.e. A*X, B*X, A*B*X).

ANCOVA: A Summary
An ANCOVA is essentially an ANOVA on a continuous response variable adjusted by the regression of Y vs. the covariate X. The inclusion of covariates in the model can reduce unexplained variation and thus increase power. Absolutely essential to test for homogeneity of slopes across groups.

Das könnte Ihnen auch gefallen