For my meta-analysis I have to obtain univariate analyses (HR, 95% CI, p value) from different studies. I came across one study with a given HR: 1.19 and 95% CI: 0.46 - 2.51. By surfing on the internet I found this article about calculating the P value from a confidence interval.

Their method is the following:

The calculation is trickier for ratio measures, such as risk ratio, odds ratio, and hazard ratio. We need to log transform the estimate and confidence limits, so that Est, l, and u in the box are the logarithms of the published values.

For example, in a meta-analysis of several studies comparing single versus bilateral mammary artery coronary bypass grafts Taggart et al presented a hazard ratio of 0.81; 95% CI 0.70 to 0.94.5 They did not quote the P value.

Following the steps in the box we calculate P as follows:

Est = log(0.81) = −0.211

l = log(0.70) = −0.357, u = log (0.94) = −0.062

SE = [−0.062 − (−0.357)]/(2×1.96) = 0.0753.

z = −0.211/0.0753 = −2.802. We take the positive value of z, 2.802.

P = exp(−0.717×2.802 − 0.416×2.8022) = 0.005.

I have used excel to calculate the P value

While it looks like it worked when testing it with data that has already given the p value I noticed that it isn't 100% accurate.

Example: HR: 1.79 (95% CI: 1.04 - 3.13, P 0.048)

These are the formulas I used in excel written in one line:

=EXP(-0.717 * LOG(B2) / ((LOG(B4) - LOG(B3)) / (2 * 1.96)) - 0.416 * (LOG(B2) / ((LOG(B4) - LOG(B3)) / (2 * 1.96)))^2)

with B2 = HR, B3 = 95% CI: low, B4 = 95% CI: high

I also tried this formula with WolframAlpha:

exp(-0.717 * log(1.19) / ((log(2.51) - log(0.46)) / (2 * 1.96)) - 0.416 * (log(1.19) / ((log(2.51) - log(0.46)) / (2 * 1.96)))^2)

Currently I don't know where the problem lies. I did notice that the more decimals I used for the HR and 95% CI the more accurate the formula is.

  1. Did I type the formula wrong?

  2. Is the formula not 100% accurate?

  3. Does the problem lie with the data due to authors rounding the numbers up to 2-3 decimals?

I would really appreciate any help. Thanks in advance.

  • $\begingroup$ What makes you think you need a $p$-value to do your meta-analysis? The log HR and its standard error should be sufficient. $\endgroup$
    – mdewey
    Sep 16, 2018 at 15:54
  • $\begingroup$ You are right, I thought it was necessary to calculate ln(HR) and se(ln(HR)), but I just noticed that when using Tierney's HR estimation sheet I forgot to write the range of cofidence interval (95%). Thank you. $\endgroup$
    – Huzeyfe
    Sep 16, 2018 at 16:01

1 Answer 1


While eventually I didn't need this formula the mistake I made was simple: The formula uses ln (also known as natural log) instead of normal log. When changing all log to ln the formula is accurate in calculating the p value.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.