weightedKM | R Documentation |
This function estimates S(t) where sampling weights are permitted.
weightedKM(Stime, status, wt=NULL, entry=NULL)
Stime |
Survival times when right censored data is considered. In case of interval censored data this is the end point for the time interval. |
status |
Survival status |
wt |
weight, default is unweighted |
entry |
entry times in case of interval censored data, default is NULL when right censored data is considered |
This function obtains survival function estimate where sampling weights are permitted.
Returns a list of following items:
time |
ordered unique failure times |
survival |
survival estimate at the unique failure times |
Patrick J. Heagerty
Heagerty, P.J., Zheng Y. (2005) Survival Model Predictive Accuracy and ROC curves Biometrics, 61, 92 – 105
data(pbc) ## considering only randomized patients pbc1 <- pbc[1:312,] ## create new censoring variable combine 0,1 as 0, 2 as 1 survival.status <- ifelse( pbc1$status==2, 1, 0) survival.time <- pbc1$fudays kout <- weightedKM(Stime=survival.time, status=survival.status) KM.plot(kout$time,kout$survival)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.