Signature
HR_L = exp(beta - z * SE_beta); HR_U = exp(beta + z * SE_beta)
| Inputs | Definition | Unit |
|---|---|---|
beta | Estimated natural logarithm of the hazard ratio, such as the Cox coefficient for treatment | log hazard ratio, no unit |
z | Standard normal value for the chosen coverage: 1.96 for 95%, 1.64 for 90% and 2.58 for 99% | none |
SE_beta | Standard error of beta, above zero | log hazard ratio, no unit |
HR_L | Lower limit of the approximate confidence interval for the hazard ratio | ratio, no unit |
|---|---|---|
HR_U | Upper limit of the approximate confidence interval for the hazard ratio | ratio, no unit |
Function
Relative hazard function
Maps the hazards of an event in a treatment group and a comparator group at the same time t to their ratio. Under proportional hazards the ratio is constant over time, and it can then be applied to a baseline survival curve or a baseline transition probability to obtain absolute outcomes for the treatment group.
Try this function
Implementations
Excel
Hazard ratio confidence limits for any coverage from named cells
With the log hazard ratio in Coef, its standard error in SE and the standard normal value in ZValue, the two formulas return the lower and upper limits, held in cells named LowerHR and UpperHR. NORM.S.INV(0.975) returns the z value for a 95% interval.
=EXP(Coef-ZValue*SE); =EXP(Coef+ZValue*SE)
Assumptions
Approximate normality of the log hazard ratio
The log hazard ratio is treated as approximately normal with the stated standard error, so the interval is an approximation that is less reliable with few events.
Estimate and standard error from the same model and reference group
beta and SE_beta come from the same analysis, with the same reference group and adjustment set as the hazard ratio being reported.
Worked examples
95% interval for a hazard ratio of 0.70 with standard error 0.155839
A log hazard ratio of minus 0.356675, the natural log of 0.70, with the standard error of 0.155839 from the person-time example, gives a 95% interval of about 0.5158 to 0.9501 (computed here for illustration).
beta = -0.356675; SE_beta = 0.155839; z = 1.96; HR_L = 0.5158; HR_U = 0.9501
Interval for a pooled hazard ratio of 0.88 from a logrank variance
In their section 11 example, which rebuilds the bladder cancer trial from its Kaplan-Meier curve and numbers at risk, Tierney and colleagues pool the time intervals to a hazard ratio of 0.88 with a logrank variance of 119.80. The log hazard ratio is about minus 0.1278 and its standard error 1 divided by the square root of 119.80, about 0.0914, giving about 0.7357 to 1.0527, the 0.74 to 1.05 they report.
beta = -0.1278; SE_beta = 0.0914; z = 1.96; HR_L = 0.7357; HR_U = 1.0527
Common errors
Adding standard errors on the hazard ratio scale
Adding and subtracting 1.96 times 0.155839 to 0.70 gives about 0.3946 to 1.0054, an interval that crosses 1, instead of 0.5158 to 0.9501 on the log scale (computed here for illustration). The standard error belongs to the log hazard ratio.
Inverting the hazard ratio without inverting and swapping its limits
When a report gives the comparator against treatment, the reciprocal of the hazard ratio and of its limits is taken, and the limits change places: 0.70 (0.5158 to 0.9501) becomes about 1.4286 (1.0525 to 1.9387), computed here for illustration.
Sources
Log-scale analysis and standard errors of ratio measures in the Cochrane Handbook
Higgins JPT, Li T, Deeks JJ (editors). Chapter 6: Choosing effect measures and computing estimates of effect (last updated August 2023). In: Higgins JPT, Thomas J, Chandler J, Cumpston M, Li T, Page MJ, Welch VA (editors). Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane; 2024. Section 6.1.2.1: ratio measures, including the hazard ratio, are analysed on the natural log scale, where confidence intervals are symmetric; section 6.3.2: for a ratio measure the confidence limits are log-transformed and the standard error of the log ratio is the difference between them divided by 3.92 for a 95% interval (3.92 = 2 x 1.96).
Hazard ratio intervals and reciprocals in summary time-to-event data
Tierney JF, Stewart LA, Ghersi D, Burdett S, Sydes MR. Practical methods for incorporating summary time-to-event data into meta-analysis. Trials. 2007;8:16. Section 3 (variance of the log hazard ratio from the interval, z of 1.96, 1.64 and 2.58 for 95%, 90% and 99% intervals; reciprocal of the hazard ratio and its interval when the reference group is reversed) and, in section 11, the bladder cancer trial rebuilt from its Kaplan-Meier curve with a pooled hazard ratio of 0.88, V of 119.80 and 95% interval of 0.74 to 1.05.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0