predict_merMod | R Documentation |
merMod
predictionsThis function generates predictions for merMod
models, but
with the ability to get standard errors as well.
predict_merMod(
object,
newdata = NULL,
se.fit = FALSE,
use.re.var = FALSE,
allow.new.levels = FALSE,
type = c("link", "response", "terms"),
na.action = na.pass,
re.form = NULL,
boot = FALSE,
sims = 100,
prog.arg = "none",
...
)
object |
a fitted model object |
newdata |
data frame for which to evaluate predictions. |
se.fit |
Include standard errors with the predictions? Note that these standard errors by default include only fixed effects variance. See details for more info. Default is FALSE. |
use.re.var |
If |
allow.new.levels |
logical if new levels (or NA values) in
|
type |
character string - either |
na.action |
|
re.form |
(formula, |
boot |
Use bootstrapping (via |
sims |
If |
prog.arg |
If |
... |
When |
The developers of lme4 omit an se.fit
argument for a
reason, which is that it's not perfectly clear how best to estimate
the variance for these models. This solution is a logical one, but perhaps
not perfect. Bayesian models are one way to do better.
The method used here is based on the one described here: http://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#predictions-andor-confidence-or-prediction-intervals-on-predictions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.