| predict.glmmTMB {glmmTMB} | R Documentation |
prediction
## S3 method for class 'glmmTMB'
predict(object, newdata = NULL, se.fit = FALSE, re.form,
allow.new.levels = FALSE, zitype = c("response", "conditional", "zprob"),
debug = FALSE, ...)
object |
a |
newdata |
new data for prediction |
se.fit |
return the standard errors of the predicted values? |
re.form |
(not yet implemented) specify which random effects to condition on when predicting |
allow.new.levels |
allow previously unobserved levels in random-effects variables? see details. |
zitype |
for zero-inflated models, return expected value ("response": (mu*(1-p))), the mean of the conditional distribution ("conditional": mu), or the probability of a structural zero ("zprob")? |
debug |
(logical) return the |
... |
unused - for method compatibility |
Prediction of new random effect levels is possible as long as the model specification (fixed effects and parameters) is kept constant.
However, to ensure intentional usage, a warning is triggered if allow.new.levels=FALSE (the default).
data(sleepstudy,package="lme4") g0 <- glmmTMB(Reaction~Days+(Days|Subject),sleepstudy) predict(g0, sleepstudy) ## Predict new Subject nd <- sleepstudy[1,] nd$Subject <- "new" predict(g0, newdata=nd, allow.new.levels=TRUE)