[R] ANCOVA in S-plus/R?

From: Cindy Yang <xitingy_at_yahoo.com>
Date: Sat 03 Jun 2006 - 05:29:28 EST

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 Iím 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). Iím 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 thereís 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!    


        [[alternative HTML version deleted]]

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 Received on Sat Jun 03 05:35:00 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 Sat 03 Jun 2006 - 06:10:30 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.