Set analysis variables in an scdf
Usage
set_vars(data, dvar, mvar, pvar)
set_dvar(data, dvar)
set_mvar(data, mvar)
set_pvar(data, pvar)Arguments
- data
 A single-case data frame. See
scdf()to learn about this format.- dvar
 Character string. Name of the dependent variable.
- mvar
 Character string. Name of the measurement-time variable.
- pvar
 Character string. Name of the phase variable.
See also
Other data manipulation functions:
add_l2(),
as.data.frame.scdf(),
as_scdf(),
fill_missing(),
moving_median(),
outlier(),
ranks(),
rescale(),
scdf(),
select_cases(),
shift(),
smooth_cases(),
standardize(),
truncate_phase()
Examples
exampleAB_add |>
  set_dvar("depression") |>
  describe()
#> Describe Single-Case Data
#> 
#>                           Rolf
#> Design         Base-Medication
#> n.Base                      15
#> n.Medication                25
#> mis.Base                     0
#> mis.Medication               0
#> 
#>                    Rolf
#> m.Base                5
#> m.Medication       4.36
#> md.Base               6
#> md.Medication         3
#> sd.Base           2.673
#> sd.Medication     3.252
#> mad.Base          2.965
#> mad.Medication    2.965
#> min.Base              0
#> min.Medication        0
#> max.Base              9
#> max.Medication       10
#> trend.Base        0.114
#> trend.Medication -0.051
#> 
#> The following variables were used in this analysis:
#> 'depression' as dependent variable, 'phase' as phase variable, and 'day' as measurement-time variable.
