Learn R Programming

survMisc (version 0.4.2)

calcSurv: Calculate estimators of survival & hazard functions with variance for a Surv object describing right censored data

Description

Calculate estimators of survival & hazard functions with variance for a Surv object describing right censored data

Usage

calcSurv(s, round = 7)

Arguments

s
A Surv object
round
No. digits to which to round (for display)

Value

  • A data frame. Rows - one for each time where an event occurs. Columns are:
  • ttime
  • nno. at risk
  • eno. events
  • KMSurvival estimate by Kaplan-Meier (Product-Limit) estimator
  • KMVVariance of Kaplan-Meier estimate (Greenwoods formula)
  • SNelASurvival estimate from Nelson-Aalen estimator: $\hat{S}=e^{\hat{H}}$
  • HNelNelson-Aalen estimate of hazard function
  • HNelVVariance of Nelson-Aalen estimate
  • HKMHazard estimate from Kaplan-Meier estimator: $\hat{H}=-log{\hat{S} }$

References

First example is from: Klein J, Moeschberger M 2003 Survival Analysis, 2nd edition. New York: Springer. Table 4.3, pg 97.

See Also

tne KM Gw NelA NelAVar

Examples

Run this code
data(bmt, package="KMsurv")
b1 <- bmt[bmt$group==1, ] # ALL patients
s1 <- Surv(time=b1$t2, event=b1$d3)
calcSurv(s1)
data.frame(calcSurv(s1, round=4)[1:4],
          round(sqrt(calcSurv(s1)[5]),4),
          calcSurv(s1, round=4)[7],
          round(sqrt(calcSurv(s1)[8]),4)
          )
data(bmt, package="KMsurv")
b1 <- bmt[bmt$group==2, ] # AML patients
s1 <- Surv(time=b1$t2, event=b1$d3)
calcSurv(s1)

Run the code above in your browser using DataLab