[R] lm question

Bill Simpson wsi at gcal.ac.uk
Mon Oct 9 11:49:52 CEST 2000

I have not really used lm before and I was hoping for some help on a
simple problem.

Here is a toy version of the problem I want to solve.

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

I want to fit a model that has one y-intercept and three slopes, one for
each group.

Could someone please show me how to do this?  Thanks very much for any

Bill Simpson

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