methods | R Documentation |
Methods for models fitted by mixed model boosting algorithms.
## S3 method for class 'mermboost'
predict(object, newdata = NULL, RE = TRUE,
type = c("link", "response", "class"), which = NULL,
aggregate = c("sum", "cumsum", "none"), ...)
## S3 method for class 'glmermboost'
predict(object, newdata = NULL, RE = TRUE,
type = c("link", "response", "class"), which = NULL,
aggregate = c("sum", "cumsum", "none"), ...)
## S3 method for class 'mermboost'
ranef(object, iteration = mstop(object), ...)
## S3 method for class 'glmermboost'
ranef(object, iteration = mstop(object), ...)
## S3 method for class 'mermboost'
VarCorr(x, sigma=1, iteration = mstop(x), ...)
## S3 method for class 'glmermboost'
VarCorr(x, sigma=1, iteration = mstop(x), ...)
## S3 method for class 'mer_cv'
mstop(object, ...)
## S3 method for class 'mer_cv'
plot(x, ...)
object |
objects of class |
newdata |
optionally, a data frame in which to look for variables with
which to predict. In case the model was fitted using the |
RE |
a logical values ( |
which |
a subset of base-learners to take into account for computing
predictions or coefficients. If |
type |
the type of prediction required. The default is on the scale
of the predictors; the alternative |
aggregate |
a character specifying how to aggregate predictions
or coefficients of single base-learners. The default
returns the prediction or coefficient for the final number of
boosting iterations. |
iteration |
an integer input that specifies from which iteration the random component is to be drawn. |
sigma |
an argument used in |
x |
a cross-validation object for |
... |
additional arguments passed to callies. |
The methods should correspond to equivalent mboost
and lme4
functions. However, additional arguments about random effects handling might be of interest.
The predict.mermboost
-methods give a vector, matrix or a list depending on the arguments.
A matrix with cluster-identifier as rownames and random effects as element results from ranef.mermboost
.
A VarrCorr.merMod
is the result of applying VarCorr.mermboost
to a mermboost
model.
To deal with cross validtion objects, class mer_cv
, mstop.mer_cv
gives a numeric value of the optimal stopping iteration while plot.mer_cv
plots cross-validation risk-paths.
mstop.mer_cv
and plot.mer_cv
data(Orthodont)
mod <- glmermboost(distance ~ age + Sex + (1 |Subject),
data = Orthodont, family = gaussian,
control = boost_control(mstop = 50))
any(predict(mod, RE = FALSE) == predict(mod, RE = TRUE))
all(predict(mod, RE = FALSE) ==
predict.glmboost(mod) + mod$nuisance()[[mstop(mod)]]$ff
)
ranef(mod)
VarCorr(mod, iteration = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.