timesTokeep: Function to keep all event times

Description Usage Arguments Value References See Also Examples

Description

Function to keep all event times

Usage

1
timesTokeep(data, id, tstart, tstop, mes.cov, time.cov)

Arguments

data

dataframe containing the following variables

id

patient's id

tstart

date of the beginning of the follow-up (in Date format)

tstop

date of the end of the follow-up (in Date format)

mes.cov

list of vectors, each of them must contain the names (in character format) of the repeated measurements related to one time-dependent covariate

time.cov

list of vectors, each of them must contain the times (in Date format) of the date when the abovementioned measurements were done

Value

list of two lists, one in Date format the other in numeric format. Each of them contains, for each patient, the event time and the times of changes in time-varying covariates

References

Graffeo, N., Latouche, A., Le Tourneau C., Chevret, S. "An R Package for IPCW: Application to switches in clinical trials" (submitted)

See Also

SHIdat

Examples

1
2
3
4
5
6
7
8
kept.t <- timesTokeep(toydata, id = "id",
tstart = "randt", tstop = "lastdt",
mes.cov = list(c("ps1", "ps2", "ps3")),
time.cov = list(c("randt", "dt2", "dt3")))
# For example, for patient id=3, to obtain the kept times in Date format:
kept.t[[1]][[3]]
# To obtain the kept times in numeric format:
kept.t[[2]][[3]]

ipcwswitch documentation built on May 16, 2019, 1:12 a.m.