[R] lm question

Bill Venables William.Venables at cmis.CSIRO.AU
Mon Oct 9 14:31:48 CEST 2000


> Thanks very much Peter, Martyn, and Brian for the help.
> 
> > > lm(y~x:(grp-1)+1)
> > 
> > Call:
> > lm(formula = y ~ x:(grp - 1) + 1)
> > 
> > Coefficients:
> > (Intercept)       x.grpa       x.grpb       x.grpc  
> >    -0.80977      0.01847      0.13124      0.14259  
>
> It seems to me that there is something seriously wrong here
> since for the data I posted (I just re-checked it),
> intercept=-1, slope a=.1, slope b=.2, and slope c = .3 (These
> fit the data exactly)

It was a typo in your data.  Well, two actually.  You posted

y       x       grp
-.9     1       a
-.8     2       a
-.7     3       a
-.7     1.5     b
-.5     2.5     b
-.3     3.5     b
-.19    2.7     c
-.11    3.7     c
-.41    4.7     c

What you meant was:

y       x       grp
-.9     1       a
-.8     2       a
-.7     3       a
-.7     1.5     b
-.5     2.5     b
-.3     3.5     b
-.19    2.7     c
 .11    3.7     c
 .41    4.7     c

Bill Venables.

-- 
Bill Venables,      Statistician,     CMIS Environmetrics Project
CSIRO Marine Labs, PO Box 120, Cleveland, Qld,  AUSTRALIA.   4163
Tel: +61 7 3826 7251           Email: Bill.Venables at cmis.csiro.au    
Fax: +61 7 3826 7304      http://www.cmis.csiro.au/bill.venables/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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