View source: R/predict.galamm.R
| predict.galamm | R Documentation |
Predictions are given at the population level, i.e., with random
effects set to zero. For fitted models including random effects, see
fitted.galamm. For mixed response models, only predictions on
the scale of the linear predictors is supported.
## S3 method for class 'galamm'
predict(object, newdata = NULL, type = c("link", "response"), ...)
object |
An object of class |
newdata |
Data from for which to evaluate predictions, in a
|
type |
Character argument specifying the type of prediction object to be returned. Case sensitive. |
... |
Optional arguments passed on to other methods. Currently used for
models with smooth terms, for which these arguments are forwarded to
|
A numeric vector of predicted values.
fitted.galamm() for model fits, residuals.galamm() for
residuals, and predict() for the generic function.
Other details of model fit:
VarCorr(),
coef.galamm(),
confint.galamm(),
deviance.galamm(),
factor_loadings.galamm(),
family.galamm(),
fitted.galamm(),
fixef(),
formula.galamm(),
llikAIC(),
logLik.galamm(),
nobs.galamm(),
print.VarCorr.galamm(),
ranef.galamm(),
residuals.galamm(),
response(),
sigma.galamm(),
vcov.galamm()
# Poisson GLMM
count_mod <- galamm(
formula = y ~ lbas * treat + lage + v4 + (1 | subj),
data = epilep, family = poisson
)
# Plot response versus link:
plot(
predict(count_mod, type = "link"),
predict(count_mod, type = "response")
)
# Predict on a new dataset
nd <- data.frame(lbas = c(.3, .2), treat = c(0, 1), lage = 0.2, v4 = -.2)
predict(count_mod, newdata = nd)
predict(count_mod, newdata = nd, type = "response")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.