[R] lm question

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Oct 9 13:39:46 CEST 2000


Martyn Plummer <plummer at iarc.fr> writes:

> Is that really necessary?
> 
> R> lm(y ~ grp:x, data=foo)
> 
> Call:
> lm(formula = y ~ grp:x, data = foo)
> 
> Coefficients:
> (Intercept)       grpa.x       grpb.x       grpc.x  
>    -0.80977      0.01847      0.13124      0.14259  

Surprise, surprise. You're right, obviously. I could have sworn that
would get you in trouble with the contrasts coding. Not my day today
apparently... 

(I can't even pretend I mixed up R and S:

> lm(y ~ grp:x)
Call:
lm(formula = y ~ grp:x)

Coefficients:
 (Intercept)      grpax     grpbx     grpcx 
  -0.8097666 0.01847139 0.1312409 0.1425913

)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list