Free tools for medical manuscripts / P value from confidence interval

P value from confidence interval calculator

Enter an odds ratio, hazard ratio, risk ratio or mean difference with its confidence interval. The calculator estimates the two-sided P value (normal approximation) and checks it against the P value and point estimate written in your paper. You can also paste a whole results paragraph, or compute a confidence interval from a P value.

Numbers and files are processed in your browser and never uploaded

Enter numbers as written in the paper; rounding is taken into account.

What it checks

  • Whether the point estimate lies inside its interval. “OR 1.37 (95% CI 1.48–1.83)” almost certainly contains a typo.
  • Whether the interval and the P value contradict each other: a 95% interval that crosses the null value (1 for ratios, 0 for differences) with P < 0.05, or an interval that clearly excludes it with P well above 0.05.
  • How far the P value derived from the interval is from the reported one.
  • Whether the interval is symmetric, as a Wald interval is: on the log scale for ratios, on the original scale for differences.

How it is calculated

The standard error is derived from the confidence interval, then z and the two-sided P value (the method of Altman and Bland, BMJ 2011;343:d2304). Ratios are log-transformed first:

SE = (ln upper − ln lower) / (2 × 1.96)     // 95% CI; 1.645 for 90%, 2.576 for 99%
z  = ln estimate / SE
P  = 2 × [1 − Φ(|z|)]                        // differences are not log-transformed

Published numbers are rounded. The calculator moves each number within its rounding range, works out the possible range of P, and compares the reported P with that range.

Limitations

  • The method assumes the estimate is approximately normally distributed on the log scale for ratios and on the original scale for differences. Exact, profile-likelihood, bootstrap and t-based methods can give somewhat different P values, so “close” and “does not match” are reported separately.
  • “Estimate outside the interval” and “interval and P value point in opposite directions” are contradictions between the numbers themselves; usually one of them was copied wrongly. Other flags need checking against the original analysis.
  • Paragraph mode only reads results that state a confidence interval in the same sentence. Bracketed numbers without “CI” are not treated as intervals.

Frequently asked questions

If the 95% confidence interval of a ratio excludes 1, is P always below 0.05?

Yes, when the interval and the P value come from the same analysis: a 95% interval that excludes the null value and a two-sided P < 0.05 say the same thing. Near the boundary, rounding can make them look inconsistent. When they clearly disagree, the cause is usually a copying or typesetting error, or the interval and the P value come from different tests.

How do I calculate a P value from an odds ratio and its confidence interval?

Take the natural log of the odds ratio and of both limits. SE = (ln upper − ln lower) / 3.92 for a 95% interval; z = ln OR / SE; the two-sided P is 2 × (1 − Φ(|z|)). The calculator above does this and allows for rounding.

Why is the calculated P value slightly different from the paper?

Rounding, or a different statistical method. An interval given to two decimals leaves a range of possible P values; if the reported P falls within that range, it is consistent with the interval.

Check statistics, percentages and references across your whole manuscript with MediCrab before you submit.

Learn about MediCrab