| predict.glmmTMB {glmmTMB} | R Documentation |
prediction
## S3 method for class 'glmmTMB'
predict(object, newdata = NULL, se.fit = FALSE, re.form,
allow.new.levels = FALSE, type = c("link", "response", "conditional",
"zprob", "zlink"), zitype = NULL, na.action = na.pass, 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. |
type |
Denoting mu as the mean of the conditional distribution and
##'
|
zitype |
deprecated: formerly used to specify type of zero-inflation probability. Now synonymous with |
na.action |
how to handle missing values in |
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)