Skip to contents

This is an setter method for the treatments slot in a mediation data object. It lets you supply a new treatments data.frame for the object.

Usage

# S4 method for class 'mediation_data'
treatments(object) <- value

Arguments

object

An object of class mediation_data.

value

The new treatment values for the object.

Value

A version of object whose treatment slot has been replaced.

Examples

exper <- demo_joy() |>
    mediation_data("PHQ", "treatment", starts_with("ASV"))
treatments(exper) <- data.frame(t = rep(0, 10))
exper
#> [Mediation Data] 
#> 100 samples with measurements for, 
#> 1 treatment: t 
#> 5 mediators: ASV1, ASV2, ... 
#> 1 outcome: PHQ