Data Censoring Transformation

Description

Function for transformation of discrete survival times in censoring encoding. Prior this function the data has to be already transformed to long format. With this new generated variable, the discrete censoring process can be analysed 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

1
dataCensoring(dataSetLong, respColumn, idColumn)

Arguments

dataSetLong

Original data in transformed long format .

respColumn

Name of column of discrete survival response as character.

idColumn

Name of column of identification number of persons as character.

Details

The standard procedure is to use functions such as dataLong, dataLongTimeDep, dataLongCompRisks to augment the data set from short format to long format before using dataCensoring.

Value

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

Author(s)

Thomas Welchowski welchow@imbie.meb.uni-bonn.de

References

Ludwig Fahrmeir, (1997), Discrete failure time models, LMU Sonderforschungsbereich 386, Paper 91, http://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

contToDisc, dataLong, dataLongTimeDep, dataLongCompRisks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

# Convert to long format based on months
CostMonthsLong <- dataLong (dataSet=CostMonths, timeColumn="timeDisc", censColumn="status")
head(CostMonthsLong, 20)

# Generate censoring process variable
CostMonthsCensor <- dataCensoring (dataSetLong=CostMonthsLong, respColumn="y", idColumn="obj")
head(CostMonthsCensor)
tail(CostMonthsCensor [CostMonthsCensor$obj==1, ], 10)
tail(CostMonthsCensor [CostMonthsCensor$obj==3, ], 10)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.