multimedia | R Documentation |
multimedia
Constructormultimedia
objects encapsulate the model and data that underlie a mediation
analysis, together with metadata (like graph structure) that contextualize
the estimation. This function can be used to construct a new multimedia
instances from a mediation_data
dataset and pair of estimators.
multimedia(
mediation_data,
outcome_estimator = lm_model(),
mediation_estimator = lm_model()
)
mediation_data |
An object of class |
outcome_estimator |
An object of class |
mediation_estimator |
An object of class |
An object of class multimedia
encapsulating the full mediation
model and data.
multimedia-class
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper)
exper <- demo_spline(tau = c(2, 1)) |>
mediation_data(starts_with("outcome"), "treatment", "mediator")
multimedia(exper)
# real data example with a pretreatment variable
data(mindfulness)
exper <- mediation_data(
mindfulness,
phyloseq::taxa_names(mindfulness),
"treatment",
starts_with("mediator"),
"subject"
)
multimedia(exper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.