Re: [R] how to run ANCOVA?

From: Richard M. Heiberger <>
Date: Wed 23 Aug 2006 - 15:35:10 EST

> 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 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 23 15:39:35 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 24 Aug 2006 - 06:22:24 EST.

Mailing list information is available at Please read the posting guide before posting to the list.