ThisCalculator

Everyday

Confidence Interval for Hazard Ratio: Explained

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Confidence Interval for Hazard Ratio: Explained

A confidence interval for a hazard ratio gives the range of values within which the true hazard ratio is likely to fall, with a specified level of confidence (usually 95%). To calculate it, you take the point estimate of the hazard ratio, compute its standard error from the log of the hazard ratio, and then form the interval as exp(log(HR) ± z × SE(log(HR))).

Formula

The hazard ratio (HR) is the ratio of two hazard rates, often from a Cox proportional hazards model or a survival analysis. The confidence interval is computed on the log scale because the sampling distribution of the log hazard ratio is approximately normal. The formula is:

  • Lower limit = exp(ln(HR) − z × SE(ln(HR)))
  • Upper limit = exp(ln(HR) + z × SE(ln(HR)))

Where:

  • HR = the estimated hazard ratio (unitless)
  • SE(ln(HR)) = the standard error of the natural logarithm of the hazard ratio (unitless)
  • z = the critical value from the standard normal distribution for the desired confidence level (e.g., 1.96 for 95% confidence, 1.645 for 90%)

Because the HR is exponentiated, the interval is asymmetric around the point estimate. For example, if HR = 1.5 and SE(ln(HR)) = 0.2, the 95% interval is exp(ln(1.5) ± 1.96×0.2) = exp(0.4055 ± 0.392) = (1.014, 2.225). The point estimate 1.5 is not in the center of the interval.

Worked Example

Using the default values from the calculator: HR = 1.5, SE = 0.2, and confidence level = 95%.

  1. Compute ln(HR) = ln(1.5) = 0.4055 (rounded to 4 decimals).
  2. Find the z-value for 95% confidence: 1.96.
  3. Calculate the margin of error: 1.96 × 0.2 = 0.392.
  4. Lower limit = exp(0.4055 − 0.392) = exp(0.0135) = 1.0136, which rounds to 1.014.
  5. Upper limit = exp(0.4055 + 0.392) = exp(0.7975) = 2.2196, which rounds to 2.220.

So the 95% confidence interval for the hazard ratio is (1.014, 2.220). The calculator gives 1.0136 and 2.2196, which round to 1.014 and 2.220 when displayed with 4 decimals. Note: the exact value may differ slightly due to rounding in intermediate steps.

When to Use This Interval

You need a confidence interval for a hazard ratio whenever you have a point estimate from a survival analysis, typically from a Cox proportional hazards model. The hazard ratio itself tells you the relative risk of an event occurring at any given time point between two groups. The confidence interval tells you how precise that estimate is. A narrow interval indicates a precise estimate; a wide interval indicates uncertainty, often due to a small sample size or few events.

Common situations include:

  • Clinical trials comparing time to recovery or time to death between treatment groups.
  • Observational studies examining the effect of a risk factor on disease onset.
  • Meta-analyses pooling hazard ratios from multiple studies.

The interval is also used to test hypotheses. If the interval excludes 1, the hazard ratio is statistically significant at the chosen level (e.g., 0.05). If it includes 1, there is no significant difference in hazard between groups.

How to Read the Result

Interpret the interval in the context of the hazard ratio. A hazard ratio of 1 means no difference in hazard between groups. Values greater than 1 indicate a higher hazard (worse outcome) for the numerator group; values less than 1 indicate a lower hazard (better outcome).

For example, an HR of 1.5 with 95% CI (1.014, 2.220) means the treatment group has an estimated 50% higher hazard than the control group, but the true hazard ratio could be as low as 1.014 (almost no effect) or as high as 2.220 (more than double). Because the lower limit is above 1, the effect is statistically significant at the 5% level.

Always report the confidence level. A 95% CI is standard, but 90% or 99% intervals are sometimes used. The calculator lets you choose the confidence level; the z-value changes accordingly (1.645 for 90%, 2.576 for 99%).

Common Mistakes and Pitfalls

  • Using the wrong standard error: The SE must be for the log hazard ratio, not the hazard ratio itself. Many software outputs give both; use the one labeled “SE(log HR)” or “standard error of the log hazard ratio.”
  • Assuming symmetry: The interval on the original HR scale is not symmetric. Do not compute it as HR ± 1.96×SE(HR); that is only valid on the log scale.
  • Confusing hazard ratio with risk ratio: The hazard ratio is a ratio of instantaneous event rates, not a ratio of cumulative probabilities. They are related but not identical, especially when the event rate changes over time.
  • Rounding too early: Round the final interval, not intermediate steps. In the example, rounding ln(1.5) to 0.41 and then exponentiating gives a slightly different interval.
  • Ignoring the proportional hazards assumption: The hazard ratio from a Cox model assumes the hazard ratio is constant over time. If that assumption is violated, the confidence interval may be misleading.

Limitations of the Formula

This formula relies on the normal approximation of the log hazard ratio, which works well when the sample size is large and the number of events is not too small. With few events, the approximation may be poor, and alternative methods (like profile likelihood or bootstrap) are recommended.

The interval only reflects sampling variability, not systematic bias. If the study has confounding, selection bias, or measurement error, the true hazard ratio may be outside the calculated interval. Also, the interval is conditional on the model being correct; if the model is misspecified, the interval may be too narrow or too wide.

For time-varying hazard ratios, the Cox model’s assumption of proportionality may not hold, and the single hazard ratio may not adequately summarize the data. In such cases, consider a time-dependent model or a restricted mean survival time approach.

Frequently Asked Questions

What does a 95% confidence interval mean exactly?

If you repeated the study many times and calculated a 95% confidence interval each time, about 95% of those intervals would contain the true hazard ratio. It is not the probability that the true HR lies in a given interval—that probability is either 0 or 1, but you don’t know which.

Why is the interval not symmetric around the hazard ratio?

Because the hazard ratio is exponentiated from the log scale. The log hazard ratio is approximately normally distributed, so its interval is symmetric on the log scale. Exponentiating that interval gives an asymmetric interval on the original HR scale.

Can I calculate the interval if I only have the hazard ratio and its p-value?

Yes, but you need the standard error. From the p-value, you can back-calculate the z-value and then solve for SE. For a two-sided p-value, z = Φ⁻¹(1 − p/2), and SE = |ln(HR) / z|. Then use the formula above. However, this is only approximate if the p-value was rounded.

What if the hazard ratio is less than 1? Does the formula still work?

Yes. The formula works for any positive hazard ratio. For example, HR = 0.8, ln(0.8) = −0.2231. The interval will be symmetric on the log scale, and after exponentiation, the lower limit will be less than the upper limit, both below 1 if the HR is significantly less than 1.

How do I get the standard error from statistical software?

In R, after fitting a Cox model with coxph(), use summary(model) to see the coefficient and its standard error. The coefficient is the log hazard ratio, and the standard error is for that coefficient. In SPSS, the output includes “SE” for the “B” coefficient, which is the log HR. In SAS, the “Parameter Estimate” and “Standard Error” from PROC PHREG give the same values.

Is a hazard ratio of 1.5 with CI (1.0, 2.2) the same as a p-value of 0.05?

Not exactly. A 95% CI that just touches 1 corresponds to a two-sided p-value of 0.05. If the lower limit is exactly 1, the p-value is exactly 0.05. If the lower limit is above 1, the p-value is less than 0.05. In the example, the lower limit is 1.014, so the p-value is slightly less than 0.05.

Related

Formula used
in hr | Hazard ratio | - | 1.5 | 0
in se | Standard error of log(HR) | - | 0.2 | 0
in cl | Confidence level (%) | % | 95 | 0
out ci_low | Lower limit | - | exp(log(hr) - (cl / 100 > 0.5 ? 1.96 : 1.645) * se) | 4
out ci_high | Upper limit | - | exp(log(hr) + (cl / 100 > 0.5 ? 1.96 : 1.645) * se) | 4
out log_hr | log(HR) | - | log(hr) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.