You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the NelsonAalen fitter to determine the hazard rate I came across the following two issues:
in calculating the instantaneous hazard, the time between two events is not used to determine the hazard. Normally h0 = d_j/(n_j * T_j) where d_j are the number of deaths, n_j ,the number at risk, and T_j the time between t_j and t_(j+1)
the hazard rate is also determined at censored times. The hazard is then zero. To my knowledge, hazard rates are not determined at censored times.
For a simple example see:
data = {
'duration': [2, 4, 6, 7, 8],
'event': [1, 1, 0, 1, 1],
}
The same problem in the CoxPH fitter. For determining the baseline_hazard_ dividing by delta time is not done, and the hazard is also determined at censored times.
I was also wondering why the calculation of the hazard rate based on the Kaplan Meier event table is not implemented as this seems to me the most straightforward implementation.
The text was updated successfully, but these errors were encountered:
When I use the NelsonAalen fitter to determine the hazard rate I came across the following two issues:
For a simple example see:
data = {
'duration': [2, 4, 6, 7, 8],
'event': [1, 1, 0, 1, 1],
}
df = pd.DataFrame(data)
naf = NelsonAalenFitter()
naf.fit(df['duration'], df['event'])
naf.plot_hazard(bandwidth=1, ci_show=False, label='NA hazard lifelines')
The same problem in the CoxPH fitter. For determining the baseline_hazard_ dividing by delta time is not done, and the hazard is also determined at censored times.
I was also wondering why the calculation of the hazard rate based on the Kaplan Meier event table is not implemented as this seems to me the most straightforward implementation.
The text was updated successfully, but these errors were encountered: