Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working

Relative risk, Risk difference and Odds ratio

When the data to be analyzed consist of counts in a cross-classification of two groups (exposed and unexposed) and two outcomes, the data can be represented in a fourfold table as follows:

 Exposed GroupUnexposed GroupTotal
Number with positive outcomeaca+c
Number with negative outcomebdb+d
Totala+bc+da+b+c+d

Several statistics can be calculated such as odds ratio (OR), relative risk (RR), and risk difference.

OR is more commonly used in case-control studies, where the true risk cannot be directly calculated.

RR is used in prospective studies, cohort studies and randomized controlled trials, where risks can be directly measured.

How to calculate Odds Ratio

The odds ratio (OR), its standard error and 95% confidence interval are calculated as follows (Altman, 1991).

The formula for odds ratio is:

Odds ratio formula$$ \begin{align} OR & = \frac {a/b} {c/d} \\ & = \frac {a \times d } { b \times c} \end{align}$$

with the standard error of the log odds ratio being

Formula for standard error of odds ratio$$ \operatorname{SE} \left \{ \operatorname{ln}\left(OR\right) \right \} = \sqrt { \frac {1}{a} + \frac {1}{b} + \frac {1}{c} + \frac {1}{d} } $$

and 95% confidence interval

Formula for confidence interval of odds ratio$$ \operatorname{95\%\text{ } CI} = \operatorname{exp} \Big( \text{ } \operatorname{ln}\left(OR\right) - 1.96 \times \operatorname{SE} \left \{ \operatorname{ln}\left(OR\right) \right \} \text{ }\Big) \quad \text{ to }\quad \operatorname{exp} \Big(\text{ } \operatorname{ln}\left(OR\right) + 1.96 \times \operatorname{SE} \left \{ \operatorname{ln}\left(OR\right) \right \} \text{ }\Big)$$

Test of significance: the P-value is calculated according to Sheskin, 2004 (p. 542). A standard normal deviate (z-value) is calculated as

$$ z = \frac {\operatorname{ln}\left(OR\right)}{\operatorname{SE} \left \{ \operatorname{ln}\left(OR\right) \right \}} $$
and the P-value is the area of the normal distribution that falls outside ± z (see Values of the Normal distribution table).

Interpretation

  • OR = 1: No association between exposure and outcome.
  • OR > 1: Exposure is associated with higher odds of the outcome.
  • OR < 1: Exposure is associated with lower odds of the outcome.

How to calculate Relative Risk

The relative risk (RR), its standard error and 95% confidence interval are calculated as follows (Altman, 1991).

The relative risk or risk ratio is given by

Formula for relative risk$$ RR = \frac {a/(a+b) } { c/(c+d) } $$

with the standard error of the log relative risk being

Formula for standard error of relative risk$$ \operatorname{SE} \left \{ \operatorname{ln}\left(RR\right) \right \} = \sqrt { \frac {1}{a} + \frac {1}{c} - \frac {1}{a+b} - \frac {1}{c+d} } $$

and 95% confidence interval

Formula for confidence interval of relative risk$$ \operatorname{95\%\text{ } CI} = \operatorname{exp} \Big( \text{ } \operatorname{ln}\left(RR\right) - 1.96 \times \operatorname{SE} \left \{ \operatorname{ln}\left(RR\right) \right \} \text{ } \Big) \quad \text{ to }\quad \operatorname{exp} \Big(\text{ } \operatorname{ln}\left(RR\right) + 1.96 \times \operatorname{SE} \left \{ \operatorname{ln}\left(RR\right) \right \} \text{ }\Big)$$

Test of significance: the P-value is calculated according to Sheskin, 2004 (p. 542). A standard normal deviate (z-value) is calculated as

$$ z = \frac {\operatorname{ln}\left(RR\right)}{\operatorname{SE} \left \{ \operatorname{ln}\left(RR\right) \right \}} $$
and the P-value is the area of the normal distribution that falls outside ± z (see Values of the Normal distribution table).

Interpretation

  • RR = 1: No association between exposure and outcome.
  • RR > 1: Exposure increases the risk of the outcome.
  • RR < 1: Exposure reduces the risk of the outcome.

Number Needed to Treat (NNT)

The number needed to treat (NNT) is the estimated number of patients who need to be treated with the new treatment rather than the standard treatment (or no treatment) for one additional patient to benefit (Altman 1998).

A negative number for the number needed to treat has been called the number needed to harm.

MedCalc uses the terminology suggested by Altman (1998) with NNT(Benefit) and NNT(Harm) being the number of patients needed to be treated for one additional patient to benefit or to be harmed respectively.

The 95% confidence interval is calculated according to Daly (1998) and is reported as suggested by Altman (1998).

Risk difference

The risk difference (RD) and its 95% confidence interval are calculated according to Newcombe & Altman (2000)

Formula for risk difference$$ RD = \frac {a} {a+b} - \frac {c} {c+d} $$

The recommended method for the calculation of the risk difference, which is a difference between proportions, requires the calculation of the confidence intervals of the two proportions separately. MedCalc calculates exact binomial confidence intervals for proportions (Armitage et al., 2002). With l1 to u1 being the 95% CI of the first proportion p1 and l2 to u2 being the 95% CI of the second proportion p2, the 95% confidence interval for the difference is given by

Formula for confidence interval of risk difference$$ \operatorname{95\%\text{ } CI} = RD - \sqrt { (p_1-l_1)^2 + (u_2-p_2)^2 } \quad \text{ to }\quad RD + \sqrt { (p_2-l_2)^2 + (u_1-p_1)^2} $$

In the context of meta-analysis, the standard error and 95% confidence interval are calculated according to Deeks & Higgins (2010), where the standard error is defined as

Formula for standard error of risk difference (meta-analysis context)$$ \operatorname{SE} \left \{ RD \right \} = \sqrt { \frac {a \times b}{ \left ( a+b \right )^3} + \frac {c\times d}{\left (c+d\right )^3} } $$

and 95% confidence interval

Formula for confidence interval of risk difference (meta-analysis context)$$ \operatorname{95\%\text{ } CI} = RD - 1.96 \times \operatorname{SE} \left \{ RD \right \} \quad \text{ to }\quad RD + 1.96 \times \operatorname{SE} \left \{ RD \right \} $$

Notes

Where zeros cause problems with computation of effects or standard errors, 0.5 is added to all cells (a, b, c, d) (Pagano & Gauvreau, 2000; Deeks & Higgins, 2010).

In meta-analysis for relative risk and odds ratio, studies where a=c=0 or b=d=0 are excluded from the analysis (Higgins & Thomas, 2021).

Literature

  • Altman DG (1991) Practical statistics for medical research. London: Chapman and Hall.
  • Altman DG (1998) Confidence intervals for the number needed to treat. British Medical Journal 317: 1309-1312. PubMed
  • Armitage P, Berry G, Matthews JNS (2002) Statistical methods in medical research. 4th ed. Blackwell Science.
  • Daly LE (1998) Confidence limits made easy: interval estimation using a substitution method. American Journal of Epidemiology 147: 783-790. PubMed
  • Deeks JJ, Higgins JPT (2010) Statistical algorithms in Review Manager 5. Retrieved from https://training.cochrane.org/
  • Higgins JPT, Thomas J (editors) (2021) Cochrane Handbook for Systematic Reviews of Interventions Version 6.2. The Cochrane Collaboration, 2021. Available from https://training.cochrane.org
  • Newcombe RG, Altman DG (2000) Proportions and their differences. In: Altman DG, Machin D, Bryant TN, Gardner MJ (Eds) Statistics with confidence, 2nd ed. BMJ Books, 2000.
  • Pagano M, Gauvreau K (2000) Principles of biostatistics. 2nd ed. Belmont, CA: Brooks/Cole.
  • Sheskin DJ (2004) Handbook of parametric and non-parametric statistical procedures. 3rd ed. Boca Raton: Chapman & Hall /CRC.