leeper / prediction

Tidy, Type-Safe 'prediction()' Methods
https://cran.r-project.org/package=prediction
Other
89 stars 14 forks source link

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

Open benwhalley opened 7 years ago

benwhalley commented 7 years ago

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?

leeper commented 7 years ago

Thanks. I'll investigate.

strengejacke commented 6 years ago

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.