epi.insthaz {epiR} | R Documentation |
Compute the instantaneous hazard on the basis of a Kaplan-Meier survival function.
epi.insthaz(survfit.obj, conf.level = 0.95)
survfit.obj |
a survfit object, computed using the survival package. |
conf.level |
magnitude of the returned confidence interval. Must be a single number between 0 and 1. |
Computes the instantaneous hazard of failure, equivalent to the proportion of the population failing per unit time.
A data frame with three elements: time
the observed failure times, est
the proportion of the population failing per unit time, lower
the lower bounds of the confidence interval, and upper
the upper bounds of the confidence interval.
Venables W, Ripley B (2002). Modern Applied Statistics with S, fourth edition. Springer, New York, pp. 353 - 385.
Singer J, Willett J (2003). Applied Longitudinal Data Analysis Modeling Change and Event Occurrence. Oxford University Press, London, pp. 348.
library(survival) ovarian.km <- survfit(Surv(futime,fustat) ~ 1, data = ovarian) ovarian.haz <- epi.insthaz(ovarian.km, conf.level = 0.95) plot(ovarian.haz$time, ovarian.haz$est, xlab = "Days", ylab = "Instantaneous hazard", type = "b", pch = 16)