gimme_list: Turns Long Data Into a List of Data Frames

Description Usage Arguments Value Examples

Description

The function turns long data into a list of data frames that can be used as input for the command gimmeSEM.

Usage

1
gimme_list(data, state_vars, id_var, min_Ti)

Arguments

data

The data in long format

state_vars

The state_variables (level 1) that should be extracted from the data set and kept for the list. Must not contain the ID-variable

id_var

The ID/group variable that identifies participants on level-2

min_Ti

The minimum number of measurement occasions required for each participant Participants with less measurement occasions will be dropped

Value

Returns a list of data frames as required by gimmeSEM. Each entry in the list is a data frame for one participant/group.

Examples

1
2
3
4
5
## simulate data
data_long <- data.frame(ID = sort(rep(letters[1:10], 3)),
                       var1 = sort(rep(1:10, 3)),
                       var2 = sort(rep(11:20, 3)))
gimme_list(data_long, state_vars = c("var1", "var2"), id_var = "ID", min_Ti = 2)

kthorstmann/horst documentation built on May 20, 2019, 7:04 p.m.