Re: [R] help on regression by subsets in dataset

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Mon 08 Aug 2005 - 21:51:43 EST

you could use function lmList() from the nlme package, i.e.,

dat <- data.frame(y = rnorm(120), x = runif(120, -3, 3), g = rep(1:3, each = 40))
############
library(nlme)
m <- lmList(y ~ x | g, data = dat)
m
summary(m)

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


> Hi Everyone
>
> May I request for a small help while performing the regression
> analysis.
>
> I would like to know is there any possibility of conducting the
> regression for different data subsets (in the same data file),
> classified on the basis of "grouping variable". The alternative for
> this is running the regression for n number of times which you all
> know is quite cumbersome.
>
> Thank you for your kind attention and help
>
> rgds
>
> krishna
>
> ______________________________________________
> 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
>



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 Mon Aug 08 21:55:14 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:08:59 EST