[R] Linear regression on several groups

JesperHybel jesperhybel at hotmail.com
Thu Aug 12 17:11:32 CEST 2010


I have a simple dataset of a numerical dependent Y, a numerical independent X
and a categorial variable Z with three levels. I want to do linear
regression Y~X for each level of Z. How can I do this in a single command
that is without using lm() applied three isolated times?
-- 
View this message in context: http://r.789695.n4.nabble.com/Linear-regression-on-several-groups-tp2322835p2322835.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list