estimate | R Documentation |
estimate
provides a unified interface to estimate all the models that can
be encapsulated within a multimedia
class. It simply calls the
multimedia object. The resulting estimates can be used for downstream direct
effect estimation.
estimate(model, exper)
model |
An object of class multimedia containing the estimated mediation and outcome models whose mediation and outcome predictions we want to compare. |
exper |
An object of class multimedia_data containing the mediation and outcome data from which the direct effects are to be estimated. |
A version of the input modified in place so that the @estimates slot has been filled.
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper) |>
estimate(exper)
# example with another dataset
exper <- demo_spline(tau = c(2, 1)) |>
mediation_data(starts_with("outcome"), "treatment", "mediator")
multimedia(exper) |>
estimate(exper)
# example with another model
exper <- demo_spline(tau = c(2, 1)) |>
mediation_data(starts_with("outcome"), "treatment", "mediator")
multimedia(exper, glmnet_model()) |>
estimate(exper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.