ctDiscretiseData: Discretise long format continuous time (ctsem) data to...

Description Usage Arguments Value Examples

View source: R/ctDiscretiseData.R

Description

Extends and rounds timing information so equal intervals, according to specified timestep, are achieved. NA's are inserted in other columns as necessary, any columns specified by TDpredNames or TIpredNames have zeroes rather than NA's inserted (because some estimation routines do not tolerate NA's in covariates).

Usage

1
2
3
4
5
6
7
8
ctDiscretiseData(
  dlong,
  timestep,
  timecol = "time",
  idcol = "id",
  TDpredNames = NULL,
  TIpredNames = NULL
)

Arguments

dlong

Long format data

timestep

Positive real value to discretise

timecol

Name of column containing absolute (not intervals) time information.

idcol

Name of column containing subject id variable.

TDpredNames

Vector of column names of any time dependent predictors

TIpredNames

Vector of column names of any time independent predictors

Value

long format ctsem data.

Examples

1
2
long <- ctDiscretiseData(dlong=ctstantestdat, timestep = .1,
TDpredNames=c('TD1'),TIpredNames=c('TI1','TI2','TI3'))

ctsem documentation built on July 23, 2021, 5:07 p.m.