I'm trying to solve an exercise from Pinheiro and Bates book (Mixed-Effects Models in S and S-PLUS) using R. It uses data Pixel from nlme package.
The exercise says: Use lmList to fit a separate quadratic model in day for each Dog. Plot the individual confidence intervals for the coefficients in the lmList fit. Verify that only the intercept and the linear coefficient seem to vary significantly with Dog.
I fitted the model like this:
fm2Pixel.lis<-lmList(pixel~day+I(day^2)|Dog, Pixel)
But when I try to plot confidence intervals using this function:
plot(intervals(fm2Pixel.lis))
R gives mi this error:
Error in `[<-`(`*tmp*`, use, use, ii, value = lst[[ii]]) :
subscript out of bounds
Does enyone know how to fix whatever is wrong?
nlme::lmList
(I think it should be able to handle this edge case). I've written to [email protected] raising the issue ... – Ben Bolkersummary(fm2Pixel.lis2<-lmList(pixel~poly(day,2)|Dog, Pixel))
– Ben Bolker