get_refmodel.brmsfit | R Documentation |
The get_refmodel.brmsfit
method can be used to create the reference
model structure which is needed by the projpred package for performing
a projection predictive variable selection. This method is called
automatically when performing variable selection via
varsel
or
cv_varsel
, so you will rarely need to call
it manually yourself.
get_refmodel.brmsfit(
object,
newdata = NULL,
resp = NULL,
cvfun = NULL,
dis = NULL,
latent = FALSE,
brms_seed = NULL,
...
)
object |
An object of class |
newdata |
An optional data.frame for which to evaluate predictions. If
|
resp |
Optional names of response variables. If specified, predictions are performed only for the specified response variables. |
cvfun |
Optional cross-validation function
(see |
dis |
Passed to argument |
latent |
See argument |
brms_seed |
A seed used to infer seeds for |
... |
Further arguments passed to
|
The extract_model_data
function used internally by
get_refmodel.brmsfit
ignores arguments wrhs
and orhs
(a warning is thrown if these are non-NULL
). For example, arguments
weightsnew
and offsetnew
of
proj_linpred
,
proj_predict
, and
predict.refmodel
are passed to
wrhs
and orhs
, respectively.
A refmodel
object to be used in conjunction with the
projpred package.
## Not run:
# fit a simple model
fit <- brm(count ~ zAge + zBase * Trt,
data = epilepsy, family = poisson())
summary(fit)
# The following code requires the 'projpred' package to be installed:
library(projpred)
# perform variable selection without cross-validation
vs <- varsel(fit)
summary(vs)
plot(vs)
# perform variable selection with cross-validation
cv_vs <- cv_varsel(fit)
summary(cv_vs)
plot(cv_vs)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.