Re: [R] how to fit model to split data and get residual plots

2008-01-15 Thread Henrique Dallazuanna
Try this: par(mfrow=c(4,4)) lapply(by(data3, list(data3$var1,data3$expt), function(x) lm(diameter ~ day, data = x)), plot) or: par(mfrow=c(4,4)) lapply(lapply(split(data3, list(data3$var1, data3$exp)), lm, form="diameter ~ day"), plot) On 15/01/2008, Eduardo S. G. Mizubuti <[EMAIL PROTECTED]> w

[R] how to fit model to split data and get residual plots

2008-01-15 Thread Eduardo S. G. Mizubuti
I have a data set with the following structure (with many more obs.): var1exptday diameter 1 1 2 0.5 1 1 3 0.9 1 1 4 1.3 1 1 5 1.7 1 2 2 0.3 1 2 3 0.5 1 2 4 0.