[R] plotting all subgroups with augPred

Afshartous, David afshart at exchange.sba.miami.edu
Thu Sep 14 16:08:02 CEST 2006


All,

I have a question RE plotting the prediction lines of a random effects
model via augPred.  I'll illustrate via the Pixel dataset within the
nlme package: 

library(nlme)
attach(Pixel)
fm1Pixel = lme(pixel ~ day + I(day^2), data = Pixel, random = list(Dog =
~ 1))
plot(augPred(fm1Pixel))   ### 10 fitted lines since there are 10 dogs

fm2Pixel = update(fm1Pixel, . ~ . + Side)
plot(augPred(fm2Pixel))    ## also produces 10 fitted lines

For the second plot, shouldn't we have 2 fitted lines per dog, one for
each level
of the fixed effect Side?  

1) How does one plot insure that this is plotted accordingly?

2) How does one plot say only the first 5 dogs?


Thanks!
Dave



More information about the R-help mailing list