Learn R Programming

discSurv (version 1.4.2)

dataCensoringShort: Data Censoring Transformation for short formats

Description

Function for transformation of discrete survival times in censoring encoding. In contrast to dataCensoring this function needs the original data in short format as argument. With the new generated variable "yCens", the discrete censoring process can be analyzed instead of the discrete survival process. In discrete survival analysis this information is used to constructs weights for predictive evaluation measures. It is applicable in single event survival analysis.

Usage

dataCensoringShort(dataSet, eventColumns, timeColumn)

Arguments

dataSet

Original data in transformed long format.

eventColumns

Name of columns of event columns (character vector). The event columns have to be in binary format. If the sum of all events equals zero in a row, then this observation is interpreted as censored.

timeColumn

Name of column with discrete time intervals (character scalar).

Value

Original data set as argument *dataSet*, but with added censoring process as first variable in column "yCens".

References

Gerhard Tutz and Matthias Schmid, (2016), Modeling discrete time-to-event data, Springer series in statistics, Doi: 10.1007/978-3-319-28158-2

Ludwig Fahrmeir, (1997), Discrete failure time models, LMU Sonderforschungsbereich 386, Paper 91, https://epub.ub.uni-muenchen.de/

W. A. Thompson Jr., (1977), On the Treatment of Grouped Observations in Life Studies, Biometrics, Vol. 33, No. 3

See Also

dataCensoring, contToDisc, dataLong, dataLongTimeDep, dataLongCompRisks

Examples

Run this code
# NOT RUN {
library(pec)
data(cost)
head(cost)
IntBorders <- 1:ceiling(max(cost$time)/30)*30
subCost <- cost [1:100, ]

# Convert from days to months
CostMonths <- contToDisc (dataSet=subCost, timeColumn="time", intervalLimits=IntBorders)
head(CostMonths)

# Generate censoring process variable in short format
CostMonthsCensorShort <- dataCensoringShort (dataSet=CostMonths, 
eventColumns="status", timeColumn="time")
head(CostMonthsCensorShort)
# }

Run the code above in your browser using DataLab