Usage Arguments Author(s) References Examples
View source: R/splitFillCatFns.R
1 | subdistn(survData)
|
survData |
N Green
A Proportional Hazards Model for the Subdistribution of a Competing Risk, Jason P. Fine and Robert J. Gray, Journal of the American Statistical Association, Vol. 94, No. 446 (Jun 1999), pp. 496-509.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (survData)
{
survData$time2disch <- survData$time2death <- survData$time
mtime1 <- max(survData[survData$infstatus == 1, "time"],
na.rm = TRUE)
survData$time2disch[survData$infstatus == 1 & survData$event &
survData$missingType] <- mtime1 + 1
survData$time2death[survData$infstatus == 1 & !survData$event &
survData$missingType] <- mtime1 + 1
mtime0 <- max(survData[survData$infstatus == 0, "time"],
na.rm = TRUE)
survData$time2disch[survData$infstatus == 0 & survData$event &
survData$missingType] <- mtime0 + 1
survData$time2death[survData$infstatus == 0 & !survData$event &
survData$missingType] <- mtime0 + 1
survData
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.