Skip to contents

standardize.df0 does the following:

  • remaps IDs to consecutive integers

  • sorts the dataframe by ID and time

  • replaces categorical variables that have more than two levels with dummy indicators

Usage

standardize.df0(df0, id, t, from, to, i.covlist, c.covlist)

Arguments

df0

The original input dataframe

id

Quoted column name from df0 containing subject ids

t

Quoted column name from df0 containing the time variable

from

Quoted column name from df0 containing the "from" state for the event in that row

to

Quoted column name from df0 containing the "to" state for the event in that row

i.covlist

A character vector containing quoted column names from df0 for categorical covariates

c.covlist

A character vector containing quoted column names from df0 for continuous covariates

Value

A list containing the standardized dataframe and a character vector of standardized column names for covariates