Re: [R] how to run ANCOVA?

2006-08-23 Thread Sasha Wolosin
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 [EMAIL PROTECTED] 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.


[R] how to run ANCOVA?

2006-08-22 Thread Sasha Wolosin
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.