identify_sl {suddengains} | R Documentation |
Identify sudden losses.
Description
Function to identify sudden losses in longitudinal data structured in wide format.
Usage
identify_sl(
data,
id_var_name,
sg_var_list,
sg_crit1_cutoff,
sg_crit2_pct = 0.25,
sg_crit3 = TRUE,
sg_crit3_alpha = 0.05,
sg_crit3_adjust = TRUE,
sg_crit3_critical_value = 2.776,
identify_sg_1to2 = FALSE,
crit123_details = FALSE
)
Arguments
data |
A data set in wide format including an ID variable and variables for each measurement point. |
id_var_name |
String, specifying the name of the ID variable. Each row should have a unique value. |
sg_var_list |
Vector, specifying the variable names of each measurement point sequentially. |
sg_crit1_cutoff |
Numeric, specifying the negative cut-off value to be used for the first sudden losses criterion, see examples below.
The function |
sg_crit2_pct |
Numeric, specifying the percentage change to be used for the second sudden losses criterion.
If set to |
sg_crit3 |
Logical, if set to |
sg_crit3_alpha |
Numeric, alpha for the student t-test (two-tailed) to determine the critical value to be used for the third criterion. Degrees of freedom are based on the number of available data in the three sessions preceding the loss and the three sessions following the loss. |
sg_crit3_adjust |
Logical, specify whether critical value gets adjusted for missingness, see Lutz et al. (2013) and the documentation of this R package for further details.
This argument is set to |
sg_crit3_critical_value |
Numeric, if the argument |
identify_sg_1to2 |
Logical, indicating whether to identify sudden losses from measurement point 1 to 2.
If set to TRUE, this implies that the first variable specified in |
crit123_details |
Logical, if set to |
Value
A wide data set indicating whether sudden losses are present for each session to session interval for all cases in data
.
References
Lutz, W., Ehrlich, T., Rubel, J., Hallwachs, N., Röttger, M.-A., Jorasz, C., … Tschitsaz-Stucki, A. (2013). The ups and downs of psychotherapy: Sudden gains and sudden losses identified with session reports. Psychotherapy Research, 23(1), 14–24. doi:10.1080/10503307.2012.693837.
Tang, T. Z., & DeRubeis, R. J. (1999). Sudden gains and critical sessions in cognitive-behavioral therapy for depression. Journal of Consulting and Clinical Psychology, 67(6), 894–904. doi:10.1037/0022-006X.67.6.894.
Examples
# Identify sudden losses
identify_sl(data = sgdata,
# Negative cut-off value to identify sudden losses
sg_crit1_cutoff = -7,
id_var_name = "id",
sg_var_list = c("bdi_s1", "bdi_s2", "bdi_s3",
"bdi_s4", "bdi_s5", "bdi_s6",
"bdi_s7", "bdi_s8", "bdi_s9",
"bdi_s10", "bdi_s11", "bdi_s12"))