I've surfed the web and haven't found a satisfactory answer for this.
How would I generate a prediction interval for from a lmer object for each observation in the test dataset?
train_ind <- sample(seq(1:nrow(iris)), size = nrow(iris)/2, replace = F)
TRAIN <- iris[train_ind,]
TEST <- iris[-train_ind,]
m1 <- lmer(Sepal.Length ~ Sepal.Width + Petal.Length + (1|Species), data = TRAIN)
interval
has no argument with predict. sim
apparently doesn't work so I need to use an mcmc function that comes with LMER and draw from quantiles?