lme4::lmer reports “fixed-effect model matrix is rank deficient”, do I need a fix and how to?

You are slightly over-concerned with the warning message: fixed-effect model matrix is rank deficient so dropping 7 columns / coefficients. It is a warning not an error. There is neither misuse of lmer nor ill-specification of model formula, thus you will obtain an estimated model. But to answer your question, I shall strive to explain … Read more

Extract prediction band from lme fit

Warning: Read this thread on r-sig-mixed models before doing this. Be very careful when you interpret the resulting prediction band. From r-sig-mixed models FAQ adjusted to your example: set.seed(42) x <- rep(0:100,10) y <- 15 + 2*rnorm(1010,10,4)*x + rnorm(1010,20,100) id<-rep(1:10,each=101) dtfr <- data.frame(x=x ,y=y, id=id) library(nlme) model.mx <- lme(y~x,random=~1+x|id,data=dtfr) #create data.frame with new values for … Read more