Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctDiscretiseData

Discretise long format continuous time (ctsem) data to specific timestep.


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

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

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

ctsem

Continuous Time Structural Equation Modelling

v3.4.3
GPL-3
Authors
Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.