[R] how to run ANCOVA?

Richard M. Heiberger rmh at temple.edu
Wed Aug 23 07:35:10 CEST 2006


>  aov.out <- aov(response~diagnosis*gender,data)

Just add it where you think it belongs in the
sequential sum of squares

To adjust the factors for the covariate use
aov.out <- aov(response ~ age + diagnosis*gender, data)

To adjust the covariate for the factors
aov.out <- aov(response ~ diagnosis*gender + age, data)

If you want to check for interaction of the factors with the
covariate, then use * instead of + in the formula.

Please note that I added spaces to your statement to improve human legibility.

Rich



More information about the R-help mailing list