contrast_predictions | R Documentation |
Given a fitted multimedia model, contrast the mediation and outcome predictions associated wtih two treatment profiles.
contrast_predictions(model, profile1, profile2, ...)
model |
An object of class multimedia containing the estimated mediation and outcome models whose mediation and outcome predictions we want to compare. |
profile1 |
An object of class |
profile2 |
An object of class |
... |
Additional arguments to pass to |
A list with two elements, mediators
and outcomes
, containing the
differences in the predicted M(T') - M(T) and Y(T', M(T')) - Y(T, M(T))
between the two profiles T and T'.
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
model <- multimedia(exper) |>
estimate(exper)
t1 <- data.frame(treatment = factor("Treatment"))
t2 <- data.frame(treatment = factor("Control"))
profile1 <- setup_profile(model, t1, t1)
profile2 <- setup_profile(model, t2, t2)
contrast_predictions(model, profile1, profile2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.