I am trying to compute confidence interval for predictions from lmer.
I am wondering if computing percentiles on predictions from fixed effects
based on multiple calls of simulate() and refit() does the job?

My toy ex:
  model <- lmer(...)
  matrix_response_simu <- simulate(model,1000)
  list_model_simu <- apply(matrix_response_simu,2,function(x)
refit(model,x))
  matrix_fixef_simu <- sapply(list_simu,function(x) x@fixef)
  predict_model_simu <- newX_matrix%*%matrix_fixef_simu
  quantile(predict_model_simu,c(0.025,0.975))

Thanks a lot!

Alex

	[[alternative HTML version deleted]]


