# Understanding hazard, hazard rates, and the Kaplan Meier Estimate using a simple example

I'm struggling with understanding hazard in the context of survival analysis. Unfortunately I can't find any example calcuations online with simple values, and I struggle with the respective equations, so I invented an example and would be very grateful for comments if I understood the matter correctly. Let's assume participants can either leave a study (censored) or get diagnosed with a disease (event).

$$\begin{array}{c|c|c|} & \text{day of exam t} & \text{sample size n(t)} & \text{events} & \text{proportion surviving p(t)} & \text{\hat S(t)}\\ \hline \text{} & 0 & 20 & 0 & 1 & 1\\ \hline \text{} & 1 & 20 & 1 & 19/20 & 1*19/20 = 19/20\\ \hline \text{} & 3 & 19 & 1 & 18/19 & 19/20*(18/19)=9/10\\ \hline \text{} & 20 & 18 & 0 & 18/18=1 & 9/10*1=9/10\\ \hline \end{array}$$ $$\hat S(t)$$ denotes the Kaplan Meier estimate. Let $$h(t)$$ be the hazard at time point $$t$$

At day 30, one patient has been censored (left the sample without event recorded).

I'm not sure how to calculate the hazard from these values, and if ths is even meaningful. My first intuition was to calculate the probability of an event during one day, under the condition of having survived without an event up to the respective time point. For day 1, this would yield a hazard of $$h(1)=1/20$$. Given this understanding is correct, I'm not sure how to proceed to day 3. Since the conditional probability of survival up to day 3, given the participant has survived up to day 1, is $$p(3)=18/19$$, the conditional probability of the event is 1/19. To my understanding the conditional probability of the event at day 3 is still different from the hazard $$h(3)$$, which has to take the number of days into account.

As a sidenote, I'm not sure if there is a difference between the terms "hazard rate" (not hazard ratio) and "hazard" and would be grateful for an explanation.

The hazard as a function of time is the probability of having an event given that an individual has survived up to that time. So your understanding is correct, as are your hazard calculations for the two times that show events. With a Kaplan-Meier estimate, there is 0 hazard at times between events or after the last event.

The trick to get survival estimates over time is taking into account the total survival curve prior to each event time. In your case, at t = 3 the total survival prior to that time was $$1 - \frac{1}{20}=\frac{19}{20}$$. The total survival after t = 3, at which you correctly calculated the hazard as $$\frac{18}{19}$$, is thus $$\frac{19}{20} *\frac{18}{19}$$, or 0.9. At every event time you similarly calculate the hazard at that time, then multiply that hazard by the prior cumulative survival.

The "hazard rate" terminology can be confusing. I suppose it can be used colloquially to represent the hazard as a function of time. Or does it mean the rate of change of the hazard with time? You'll have to try to discern from the context just what a particular author means with that terminology.