[R] how to run ANCOVA?

From: Sasha Wolosin <sasha.wolosin_at_gmail.com>
Date: Wed 23 Aug 2006 - 06:59:22 EST


Dear all,

  I would like to know how to run an analysis of covariance in R. For example, I have a data frame ("data") consisting of two second-degree categorical variables ("diagnosis" and "gender"), one continous independent variable ("age") and one continous dependent variable ("response").

I ran a simple anova to see the effects of diagnosis and gender (and interaction):

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

Now I would like to covary for age, how can I add "age" as a covariate to this equation?

Thanks,
Sasha



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 Wed Aug 23 07:04:31 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 Wed 23 Aug 2006 - 08:22:38 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.