effect_summary: Average Effects across j

View source: R/contrast.R

effect_summaryR Documentation

Average Effects across j

Description

This averages direct or indirect effects across settings j, leading to the effect estimates given in equation (10) of the preprint.

Usage

effect_summary(effects)

Arguments

effects

The output from direct_effect or indirect_effect. A data.frame containing effect estimates for each variable and indirect/direct setting along rows.

Value

A version of the input with all indirect/direct settings averaged over.

See Also

direct_effect indirect_effect

Examples

# example with null data
exper <- demo_joy() |>
    mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper) |>
    estimate(exper) |>
    direct_effect() |>
    effect_summary()

# 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()

multimedia documentation built on Sept. 30, 2024, 9:28 a.m.