On 3/23/06, Leonardo D Bacigalupe <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a questions regarding mixed effects models: > > I'm trying to plot e.g. fitted vs residuals for each level of the > random effects, and i'm getting the same error. > I guess this might be a problem of the graphic capabilities of R. > > Is there any way to obtain those plots? > > library(nlme) > attach(ergoStool) > names(ergoStool) > [1] "effort" "Type" "Subject" > m1<-lme(effort~Type,random=~1|Subject) > plot(m1,form=resid(.,type="p")~fitted(.)|Subject,abline=0)#resid and > fitted for each level of subject > Error in as.vector(x, "list") : cannot coerce to vector
I haven't tried figuring out what's wrong here, but using attach() is generally a bad idea, I think. A lot of effort has gone into designing interfaces that don't require it, just use them. m1 <- lme(effort~Type,random=~1|Subject, data = ergoStool) plot(m1, form=resid(.,type="p")~fitted(.) | Subject, abline=0) seems to work for me. Deepayan ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
