Set the Pretreatments in a Mediation Data Object
Source:R/lookup.R
pretreatments-set-mediation_data-method.Rd
This is an setter method for the pretreatments slot in a mediation data object. It lets you supply a new pretreatments data.frame for the object.
Usage
# S4 method for class 'mediation_data'
pretreatments(object) <- value
Examples
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
pretreatments(exper) <- data.frame(x = 1:10)
exper
#> [Mediation Data]
#> 100 samples with measurements for,
#> 1 treatment: treatment
#> 5 mediators: ASV1, ASV2, ...
#> 1 outcome: PHQ
#> 1 pretreatment: x