Bayesian Reading of Hazard Ratios

Turn the hazard ratio and 95% confidence interval from TriNetX, or any observational study, into the probability that the effect is large enough to matter, after allowing for bias.

1. Enter the study result

Try an example:

Enter the ratio and its 95% CI as reported. A ratio below 1 is assumed to favor the treatment.

2. Choose the clinical thresholds

Choose these before looking at the result. 0.90 means a 10% lower hazard. The harm threshold defaults to 1 divided by the benefit threshold.

3. Choose the assumptions

Results

Enter a result and press Calculate and interpret.

Guide

Why this tool exists

Large health record networks such as TriNetX compare tens of thousands of patients. In samples this size, a tiny difference, for example a hazard ratio of 0.95, becomes statistically significant (P < 0.05). A small P value means the result would be unusual if the true hazard ratio were 1.00. It does not say whether the effect is large enough to change practice.

The confidence interval has a second blind spot. It reflects random error only, which shrinks as cohorts grow. It ignores systematic error from residual confounding or misclassified outcomes, which does not shrink. A very narrow interval can therefore look far more certain than it is.

This calculator answers the question clinicians actually ask: how likely is it that the treatment lowers risk by an amount worth acting on, given that the study may be biased?

How it works, in diagnostic-test terms

Think of a pretest probability, a test result, and a post-test probability. Here the prior is the pretest probability (what was expected before the study), the TriNetX hazard ratio is the test result, and the posterior is the post-test probability. The calculator also widens the study's uncertainty by the bias allowance you choose, because bias does not get smaller in larger cohorts.

Calculation: SE = [ln(upper) − ln(lower)] / 3.92. Total variance = SE² + bias SD². With a normal prior on ln(HR), the posterior is normal with variance 1 / (1/prior SD² + 1/total variance) and mean equal to that variance × (prior mean / prior SD² + ln(HR) / total variance). Probabilities are areas of this posterior below, between, and above the thresholds. The default harm threshold is exactly 1 divided by the benefit threshold (1/0.90, shown as 1.11). For a hazard ratio, absolute risk uses 1 − (1 − comparator risk)HR under proportional hazards; for a risk ratio, it uses comparator risk × RR, capped at 100%. Both are applied to the reported ratio and, for the Bayesian estimate, to the posterior median and credible limits.

How to use it, step by step
  1. Copy the hazard ratio and its 95% confidence interval from the TriNetX output (Compare Outcomes, Hazard Ratio panel), or from any paper.
  2. Enter the risk in the comparator group at the same time point (the Kaplan–Meier or risk estimate), if you want events per 1,000 patients.
  3. Set the smallest benefit that would matter for this outcome. Decide this before looking at the result.
  4. Choose a bias allowance. This is a sensitivity setting, not an estimate of the bias in your study; 0.10 is a reasonable starting point for a propensity-matched observational study. Look at the sensitivity table to see how much the answer depends on it.
  5. Keep the skeptical prior unless you have a clear reason. Compare with the weakly informative prior to check that the conclusion does not depend on the prior.
  6. Press Calculate and interpret. Copy the suggested sentence into your Results section and report your assumptions.
Key terms

Meaningful benefit: a reduction large enough to change practice. Too small to matter: effects between the benefit and harm thresholds. Posterior median HR: the middle value of the updated distribution; half the plausible values lie on each side. Credible interval (CrI): the range containing the true effect with 95% probability, given the assumptions. Systematic error: error from confounding, selection, or misclassification that more patients cannot fix.

Limitations

Results depend on the stated assumptions. The bias allowance is centered on zero; if bias is known to favor one group, the calculator cannot correct its direction. The normal approximation is less accurate when events are few. The events per 1,000 assume proportional hazards. A single observational study can rarely establish a meaningful benefit with high probability once bias is allowed for; consistent results from several designs are more convincing.

Free to use, no data leave your browser. Not affiliated with or endorsed by TriNetX, LLC. Accompanies the article “Interpreting Hazard Ratios From TriNetX: A Bayesian Method, Simulation, and Calculator” (in submission). Code released under the MIT License: source code. Version 1.0, November 2026.