Re: [R] how to run ANCOVA?

From: Sasha Wolosin <sasha.wolosin_at_gmail.com>
Date: Thu 24 Aug 2006 - 00:29:34 EST

Hello,

   Thank you very much for your response!

However, I still do not understand how this works. I would like to adjust the factors (diagnosis and gender) for the covariate (age), so you are saying I should use:

        aov.out <- aov(response ~ age + diagnosis*gender, data) or

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

But how is that different from just a 3-way ANOVA with age, diagnosis, and gender as the the three effects? Isn't ANCOVA a fundamentally different model?

Thanks,
Sasha

On 8/23/06, Richard M. Heiberger <rmh@temple.edu> wrote:
> > 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
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Aug 24 04:10:38 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:39 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.