EpiData-dk / analysis

EpiData Analysis
2 stars 0 forks source link

Error in estimation of hazard ratio (survival) when number at risk reaches 1 #95

Open charlesknightsbridge opened 5 months ago

charlesknightsbridge commented 5 months ago

There is a problem when the last row of a stratified survival table has 1 person at risk. The estimate of hazard ratio uses r in the denominator, where r is the number at risk at any time. when r=1 in the final time period, the denominator of that row's contribution to the variance of the hazard ratio includes the term r r (r-1), which is 0. Even though the numerator at this point is also 0, the calculation 0/0 returns nan.

The code for hazard ratio estimate was taken from classic analysis, but I don't have a reference. While I'm inclined to just not use this final term (0/0) as it is non-informative, I'd like to be able to back this up.

We need a proper source for validation of the estimated hazard ratio for stratified survival analysis.

JLepidata commented 5 months ago

Received here. I will try to find a source Bw Jens

⁣Hent BlueMail til Android ​

Den 23. jun. 2024 22.00, fra 22.00, Jamie @.***> skrev:

There is a problem when the last row of a stratified survival table has 1 person at risk. The estimate of hazard ratio uses r in the denominator, where r is the number at risk at any time. when r=1 in the final time period, the denominator of that row's contribution to the variance of the hazard ratio includes the term r r (r-1), which is

  1. Even though the numerator at this point is also 0, the calculation 0/0 returns nan.

The code for hazard ratio estimate was taken from classic analysis, but I don't have a reference. While I'm inclined to just not use this final term (0/0) as it is non-informative, I'd like to be able to back this up.

We need a proper source for validation of the estimated hazard ratio for stratified survival analysis.

-- Reply to this email directly or view it on GitHub: https://github.com/EpiData-dk/analysis/issues/95 You are receiving this because you were assigned.

Message ID: @.***>

JLepidata commented 4 months ago

I querid Andrew Dean for the author of survival part of EpiInfo Classic