Dear R users, I'm hoping that more experienced users will be able to assist me in examining the model fit of a mixed generalised linear model. The example using the data 'bacteria' within the MASS package will hopefully illustrate what I would like to acheive;
library(MASS) library(nlme) attach(bacteria) # y being output and the trt - treatment group being an explanatory variable. There is pseudoreplication as each patient (ID) is sampled multiple times (week) bacteria$y<-1*(bacteria$y=="y") # to make readable in lmer table(bacteria$y,bacteria$trt) hs <- groupedData(y~trt|ID,outer=~trt,data=bacteria) # I don't think this is really necessary model <- lmer(y ~ trt + (week|ID),family=binomial,data=hs) summary(model) Here I would like to examine the fit of the variable trt by examining the residuals. In lm (using lme in "the R book, p. 657"), one would be able to use plot(model,trt~resid(.)) However it doesn't work. If some one would explain why, that would be great. I've come across the package "zelig", which uses simulation to examine model fit. I haven't gotten my head round this yet, and was hoping some one would advise the approp path to take. Many thanks! -- View this message in context: http://www.nabble.com/plotting-examining-residuals-of-a-mixed-generalised-linear-model-tp25905522p25905522.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.