leeper / prediction

Tidy, Type-Safe 'prediction()' Methods

Home Page:https://cran.r-project.org/package=prediction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use `merTools::predictInterval()` for lmer/merMod models?

benwhalley opened this issue · comments

I wonder whether it would makesense to use predictInterval from merTools instead of the standard predict function? At present prediction returns NA for the fitted.se, but predictInterval would make this possible, and is also relatively fast:

https://cran.r-project.org/web/packages/merTools/vignettes/Using_predictInterval.html

Perhaps merTools could be an optional dependency, and if not present we'd fall back to the standard predict method?

Thanks. I'll investigate.

You could also take a look on a method from Ben Bolker, which would reduce dependencies on other packages:
http://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#predictions-andor-confidence-or-prediction-intervals-on-predictions

However, this approach does not take the uncertainty of random effect into account.