p5 <- read.csv("http://www.public.iastate.edu/~aiminy/data/p_5_2.csv") attach(p5) m.random<-lmer(formula = Y ~ Aa + As + Cur + Aa:As + Aa:Cur + As:Cur+(1|P),family = binomial(logit),method="REML",data = p5) stdresid(m.random) doesn't work , why? Can I do use nlme if so, How to write code for nlme?