compute_change: compute_change()

Description Usage Arguments Value Examples

Description

This is a helper function that computes change in score between pre and post test. The data must be pre-processed by the followng functions: sum_weights() and id_prepost()

Usage

1
compute_change(df, col = c("subject_id", "prepost", "score"))

Arguments

df

dataframe: a dataframe returned by id_prepost()

col

character vector: name of columns to keep to compute change in scores. There should be 3 columns: A column containing participant ids, a column specifying whether this is a pre / post record, a column containing the total score.

Value

dataframe

Examples

1
2
3
4
5
6
7
tp <- laycUtils::load_txt('./my_data_folder/touchpoints.txt')
tp <- laycUtils::format_data(tp)
tp <- tp[tp$tp_name == "jrt pre-/post test", ]
tp <- sum_weights(tp)
tp <- id_prepost(tp)

compute_change(df = tp)

thelayc/laycOutcomes documentation built on May 31, 2019, 9:16 a.m.