efronlim | R Documentation |
Kaplan-Meier estimator, possibly stratified, constrained to 0 just after end of follow-up in each strata.
efronlim(formula, data, ...)
formula |
formula with on the right-hand side Hist(time,event) or Surv(time,event) and 1 or stratification variable(s) on the right-hand side. |
data |
A |
... |
additional arguments passed to |
If in any strata there is censoring at the observed time, then the dataset is updated by setting one of the censored observations to an infinitesimal later timepoint with an event instead of censoring. Then the possibly stratified Kaplan-Meier estimator is run on this updated dataset.
A prodlim
object.
library(data.table)
set.seed(1)
dt.data <- simBuyseTest(1e2, n.strata = 2)
dt.data$time1 <- pmin(dt.data$eventtime, 1)
dt.data$status1 <- dt.data$status * (dt.data$eventtime<=1)
## KM
if(require(prodlim)){
e.KM <- prodlim(Hist(time1,status1)~1, data = dt.data)
plot(e.KM)
}
e.KM0 <- efronlim(Hist(time1,status1)~1, data = dt.data)
plot(e.KM0)
## stratfied KM
if(require(prodlim)){
e.KMS <- prodlim(Hist(time1,status1)~strata, data = dt.data)
plot(e.KMS)
}
e.KMS <- efronlim(Hist(time1,status1)~strata, data = dt.data)
plot(e.KMS)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.