lifelines
lifelines copied to clipboard
Are there some errors when compute baseline_hazard in cox model?
https://github.com/CamDavidsonPilon/lifelines/blob/519bd3abe6051bd9fb5da0dfffce24ab86171f3f/lifelines/fitters/coxph_fitter.py#L2171
In this function,we compute the baseline_hazard.and the comment indicates that the method is refer to https://stats.stackexchange.com/questions/46532/cox-baseline-hazard.
but i found some bugs in the implement of the functiion.
I think code in 2179 lines should be
ind_hazards_summed_over_durations["E"] / ind_hazards_summed_over_durations["P"][::-1], columns=[name]
Hi @shiyadonggithub, can you explain why you think it should be that way? (Note that in a line above, I do reverse the order)