This is a helper that returns the names of the mediator variables in an object of class multimedia. It parses the graph in the DAG specifying the mediation analysis, and it returns all variables between treatment and outcome.
Usage
# S4 method for class 'multimedia'
mediators(object)
Examples
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper) |>
mediators()
#> [1] "ASV1" "ASV2" "ASV3" "ASV4" "ASV5"