I am running a survival analysis with descrete time. For that purpose I use the R package survival
with this function
surv.km <- survfit(formula = Surv(analyse$Time, analyse$Event) ~ 1, conf.type = "log",
conf.int = 0.95, type = "kaplan-meier", error = "greenwood", data = analyse)
In the following the terms, notation and symbols from Wikipedia are used.
I can plot the survival function S(t)
, the event function resp. cumulative density function F(t)
(fun="event"
), the cumulativ hazard function H(t)
(fun="cumhaz"
) and some other functions.
However, is there a way to calculate the density function f(t)
or the hazard function h(t)
? Both are actually defined for continuous time. At the moment I use the following formulas:
$f(t) = F(t+1) - F(t) = S(t) - S(t+1)$ where $t$ is discrete
$h(t) = \frac{f(t)}{S(t)} = 1 - \frac{S(t+1)}{S(t)}$ where $t$ is discrete
Does this make sense and is mathematical well founded? References to books or papers are welcome!