View source: R/legacy_methods.R
| evaluate_predictor | R Documentation |
Evaluate component effects or expressions, based on a bru model and one or several states of the latent variables and hyperparameters.
evaluate_predictor(
model,
state,
data,
data_extra,
effects,
predictor,
used = NULL,
format = "auto",
n_pred = NULL
)
state |
A list where each element is a list of named latent state
information, as produced by |
data |
A |
data_extra |
Additional data for the predictor evaluation. Variables
with the same name as in |
effects |
A list where each element is list of named evaluated effects,
each computed by |
predictor |
Either a formula or bru_pred_expr expression |
used |
A |
format |
character; determines the storage format of the output. Available options:
Default: "auto" |
n_pred |
integer. If provided, scalar predictor results are expanded to
vectors of length |
For each component, e.g. "name", the latent state values are
available as name_latent, and arbitrary evaluation can be done with
name_eval(...), see bru_comp_eval().
The evaluation supports several rlang::as_data_pronoun() data masking
pronouns, to access variables from different data sources, and some of
these also have corresponding full objects, with an appended . in the
name. The full objects can be passed as arguments to functions.
refers to the effects vectors
refers to the latent state vectors
refers to the main data argument
refers to the data_extra argument
refers to the evaluation environment of the predictor
A list or matrix is returned, as specified by format
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.