require(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)
Run the code above in your browser using DataLab