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
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
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
3 matches
Mail list logo