Skip to contents

This is an getter method for outcomes in an S4 object, usually of class mediation_data.

Usage

outcomes(object)

Arguments

object

An object whose outcomes slot to modify.

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"))
outcomes(exper)
#>              PHQ
#> 1   -0.454202366
#> 2    0.437905684
#> 3   -0.256128673
#> 4    1.845623455
#> 5   -0.169915212
#> 6    0.073263802
#> 7    0.872209338
#> 8    1.113772231
#> 9   -0.658390303
#> 10   0.497950024
#> 11  -0.690771876
#> 12  -1.346408838
#> 13  -0.704586755
#> 14   0.319124806
#> 15  -0.493429611
#> 16  -0.381008327
#> 17   1.496434681
#> 18   0.122197573
#> 19   2.555540613
#> 20   0.987499611
#> 21  -0.502205316
#> 22  -0.816717013
#> 23   1.108151454
#> 24   0.551284215
#> 25   0.728188603
#> 26  -0.329554905
#> 27   1.023212329
#> 28   0.056541586
#> 29   0.389589009
#> 30  -1.225694759
#> 31  -0.672920336
#> 32   1.208047629
#> 33  -1.734351945
#> 34   0.224827767
#> 35  -0.388510645
#> 36   0.147485866
#> 37  -0.624314521
#> 38   1.267542223
#> 39  -0.370722232
#> 40  -0.581935932
#> 41   0.320956629
#> 42  -0.649744448
#> 43  -1.571427342
#> 44  -1.055057587
#> 45   1.802511847
#> 46  -0.698073040
#> 47  -0.497381735
#> 48   0.341866139
#> 49   1.085055362
#> 50  -1.045170008
#> 51   0.070615460
#> 52   1.006307828
#> 53   0.697309874
#> 54  -1.304807829
#> 55  -0.206175024
#> 56  -0.355278601
#> 57   1.025090579
#> 58   0.163675178
#> 59   0.538416358
#> 60   1.229206594
#> 61  -1.070991751
#> 62   0.819489453
#> 63  -0.590840640
#> 64  -0.020125287
#> 65   0.293891407
#> 66   0.473714661
#> 67  -1.396131761
#> 68  -0.605244652
#> 69   0.214401773
#> 70  -2.811010082
#> 71   1.993842470
#> 72   0.829996808
#> 73   0.654924289
#> 74  -0.348366562
#> 75   0.525815091
#> 76  -0.112211305
#> 77   0.109235870
#> 78  -0.005204802
#> 79   0.972972716
#> 80   0.887797748
#> 81  -0.321000813
#> 82   0.369080738
#> 83  -0.477092633
#> 84  -0.074214485
#> 85   0.074502847
#> 86   1.513738798
#> 87   0.363674289
#> 88   1.104216525
#> 89   0.578271103
#> 90   0.870153280
#> 91   0.281689138
#> 92   1.145785720
#> 93  -1.287255334
#> 94   0.533066383
#> 95   0.344178001
#> 96   0.032935648
#> 97   0.758337902
#> 98  -0.956187533
#> 99  -1.132971053
#> 100 -2.059790437