count_intervals {suddengains}R Documentation

Count number of between-session intervals available to identify sudden gains

Description

Calculates the number of total between-session intervals present in the data set and the number of between-session intervals that are available to identify sudden gains talking into account the pattern of missing data.

Usage

count_intervals(data, id_var_name, sg_var_list, identify_sg_1to2 = 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.

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 sg_var_list represents a baseline measurement point, e.g. pre-intervention assessment.

Value

List with values for:

Examples

# Count between session intervals in "sgdata"
count_intervals(data = sgdata,
                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"))

[Package suddengains version 0.7.2 Index]