describe_sg {suddengains}R Documentation

Show descriptives for the sudden gains datasets

Description

Descriptives might differ between the bysg and byperson data sets depending on whether multiple gains are present.

Usage

describe_sg(data, sg_data_structure = c("bysg", "byperson"))

Arguments

data

A bysg or byperson dataset created using the function create_bysg or create_byperson.

sg_data_structure

String, indicating whether the input data is a bysg or byperson dataset.

Value

A list, showing basic descriptive statistics for sudden gains within the dataset specified. Note that some numbers (e.g. percentages) will be different depending which dataset is selected, because where a participant has multiple gains, only one is selected for the byperson dataset. The list includes values for:

Examples

# Create bysg dataset
bysg <- create_bysg(data = sgdata,
                    sg_crit1_cutoff = 7,
                    id_var_name = "id",
                    tx_start_var_name = "bdi_s1",
                    tx_end_var_name = "bdi_s12",
                    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"),
                    sg_measure_name = "bdi")

# Describe bysg dataset
describe_sg(data = bysg,
            sg_data_structure = "bysg")

[Package suddengains version 0.7.2 Index]