Re: [R] individual intercept and slope

2010-11-02 Thread Phil Spector
You didn't say what form you wanted the output in, but here's one way: sapply(split(dat,dat$individual),function(s)lm(height~time,data=s)$coef) 1 2 (Intercept) 8.47 19.87 time2.485714 -2.057143 - Phil Spector

Re: [R] individual intercept and slope

2010-11-02 Thread Dimitris Rizopoulos
Have a look at function(s) lmList() from packages lme4 or nlme. I hope it helps. Best, Dimitris On 11/2/2010 3:14 PM, Rosario Garcia Gil wrote: Hello I would like to extract the estimates for the intercept and slope by individual for growth from a lm fit. Any advice? Individual Time point

[R] individual intercept and slope

2010-11-02 Thread Rosario Garcia Gil
Hello I would like to extract the estimates for the intercept and slope by individual for growth from a lm fit. Any advice? Individual Time point Height 1 1 10 1 2 11 1 3 23 1