Dear R user:
I have a question about doing ANCOVA in S-plus or R.
I know that many users use lm to do the regression and check the ANCOVA. But
is there a way to get the traditional Table form of the ANCOVA test through
S-plus (like what we would get from SPSS or SAS)?
The problem Im interested in is whether or not there is a treatment effect
on some medical measurement. I will have the endpoint (E) and the baseline (B)
of the measurement, together with a dummy variable (T) of what treatment the
patients get (control, or new). Im thinking of using lm( (E-B) ~ B + T, data
= ..)
Question 1: if I get the regression results (E-B) = b0 + b1*B + b2*T and in
order to check whether or not there is a treatment effect, all I need to do is
to check whether the p-value associated with b2 is less than the significant
level I set or theres more I need to do?
Question 2: If I put anova( lm( (E-B) ~ B + T, data = ..) ), is the table I
get here the one I want for an ANCOVA? My concern is that ANCOVA is supposed to
work only on residual compared to ANOVA, but we are using the same command
here. If this gives me the ANCOVA table, does the order of the variables in
regression matter? Will
anova( lm( (E-B) ~ T + B, data = ..) ) gives the same result?
Question 3: if I have another dummy variable to indicate the location of
hospital each patient goes to (L) and want to include it to my model, should I
do
lm( (E-B) ~ B + T + L, data = ..) or I need to consider the interactions?
Thanks a lot!
Cindy
__________________________________________________
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html