buildQuasiObsForComparison: Expand discrete time survival data into quasi observations...

Description Usage Arguments Examples

Description

This function assumes time starts at 1 and counts unit increments. The returned frame has the actual event data and expands to observationWindowWidth to imitiate future application. Quasi observation events past event or censoring are NA.

Usage

1
2
3
buildQuasiObsForComparison(d, observationWindowWidth, numberOfObservations,
  eventIndex, idColumnName, indexColumnName, eventColumnName,
  parallelCluster = NULL)

Arguments

d

data.frame to expand

observationWindowWidth

scalar, step number to expand to

numberOfObservations

vector (entries >=1) for each row of d up to what step number did we observe

eventIndex

vector for each row of d at what time did event occur. Event i is considered censored if eventIndex[[i]] is NA or out of range of 1:numberOfObservations.

idColumnName

character scalar, column to write original row ids in

indexColumnName

character scalar, column to write quasi event indices into

eventColumnName

character scalar, column to write quasi events indicator into. If NA, write no such column.

parallelCluster,

if not NULL parallel cluster to perform the work.

Examples

1
2
3
d <- data.frame(lifetime=c(2,1,2),censored=c(FALSE,FALSE,TRUE))
buildQuasiObsForComparison(d,5,d$lifetime,ifelse(d$censored,NA,d$lifetime),
   'origRow','sampleAge','deathEvent')

WinVector/QSurvival documentation built on May 9, 2019, 10:59 p.m.