This averages direct or indirect effects across settings j, leading to the effect estimates given in equation (10) of the preprint.
Examples
# example with null data
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper) |>
estimate(exper) |>
direct_effect() |>
effect_summary()
#> # A tibble: 1 × 2
#> outcome direct_effect
#> <chr> <dbl>
#> 1 PHQ -0.0389
# example with another dataset
exper <- demo_spline(tau = c(2, 1)) |>
mediation_data(starts_with("outcome"), "treatment", "mediator")
multimedia(exper) |>
estimate(exper) |>
direct_effect() |>
effect_summary()
#> # A tibble: 2 × 2
#> outcome direct_effect
#> <chr> <dbl>
#> 1 outcome_1 -1.97
#> 2 outcome_2 -0.776