built_ms: Prepare multi-state data

Description Usage Arguments Examples

Description

This function calls 'mstate::msprep()' with the appropriate argument for the transition matrix on an array of events (as returned by 'get_evmat()') by calling 'as.data.frame()' returns a 'msdata' object (consisting of a table in long format and the coresponding transistion matrix)

Usage

1
2
built_ms(id_sample = NULL, evmat = NULL, df_vars = NULL, min_n = 16,
  max_n = 1000)

Arguments

id_sample

A sample of IDs (will be sample from, if length(id_sample)> max_n)

evmat

An event matrix

df_vars

Optional dataframe containing predictor variables

min_n

Minimum number of cases per transtition to state under observation (Default to 16)

max_n

Maximum number of total cases (Default to 1000)

Examples

1
2
3
4
5
6
7
## Not run: 
df_ind <- get_exmpl_df()
df_fam <- data.frame(idf = c(0,unique(df_ind$momid[df_ind$momid>0])), fall = "C")
evmat <- get_evmat(df_ind, df_fam)
ms1 <- built_ms(evmat)

## End(Not run)

johow/kinlab documentation built on July 5, 2019, 4:23 p.m.