This is an getter method for treatments in an S4 object, usually of class mediation_data.
Value
The output depends on the S4 class of the input object. If it is a multimedia model object, it will return a character vector of the outcome variable names. Otherwise it returns the outcome data.
Examples
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
treatments(exper)
#> treatment
#> 1 Treatment
#> 2 Control
#> 3 Control
#> 4 Control
#> 5 Treatment
#> 6 Treatment
#> 7 Treatment
#> 8 Control
#> 9 Control
#> 10 Treatment
#> 11 Treatment
#> 12 Treatment
#> 13 Control
#> 14 Treatment
#> 15 Control
#> 16 Control
#> 17 Treatment
#> 18 Treatment
#> 19 Treatment
#> 20 Treatment
#> 21 Control
#> 22 Treatment
#> 23 Control
#> 24 Treatment
#> 25 Control
#> 26 Control
#> 27 Treatment
#> 28 Control
#> 29 Control
#> 30 Control
#> 31 Treatment
#> 32 Control
#> 33 Control
#> 34 Treatment
#> 35 Control
#> 36 Treatment
#> 37 Treatment
#> 38 Treatment
#> 39 Control
#> 40 Treatment
#> 41 Treatment
#> 42 Control
#> 43 Control
#> 44 Control
#> 45 Treatment
#> 46 Treatment
#> 47 Treatment
#> 48 Treatment
#> 49 Treatment
#> 50 Control
#> 51 Treatment
#> 52 Treatment
#> 53 Control
#> 54 Control
#> 55 Treatment
#> 56 Treatment
#> 57 Control
#> 58 Treatment
#> 59 Control
#> 60 Control
#> 61 Treatment
#> 62 Treatment
#> 63 Treatment
#> 64 Treatment
#> 65 Control
#> 66 Treatment
#> 67 Control
#> 68 Treatment
#> 69 Control
#> 70 Control
#> 71 Control
#> 72 Control
#> 73 Control
#> 74 Control
#> 75 Treatment
#> 76 Treatment
#> 77 Control
#> 78 Control
#> 79 Control
#> 80 Control
#> 81 Treatment
#> 82 Control
#> 83 Treatment
#> 84 Control
#> 85 Treatment
#> 86 Treatment
#> 87 Treatment
#> 88 Treatment
#> 89 Control
#> 90 Treatment
#> 91 Treatment
#> 92 Control
#> 93 Treatment
#> 94 Treatment
#> 95 Control
#> 96 Treatment
#> 97 Treatment
#> 98 Treatment
#> 99 Treatment
#> 100 Control