# Odds ratio

The odds ratio[1][2][3] is a measure of effect size, describing the strength of association or non-independence between two binary data values. It is used as a descriptive statistic, and plays an important role in logistic regression. Unlike other measures of association for paired binary data such as the relative risk, the odds ratio treats the two variables being compared symmetrically, and can be estimated using some types of non-random samples.

## Definition and basic properties

### Definition in terms of group-wise odds

The odds ratio is the ratio of the odds of an event occurring in one group to the odds of it occurring in another group. The term is also used to refer to sample-based estimates of this ratio. These groups might be men and women, an experimental group and a control group, or any other dichotomous classification. If the probabilities of the event in each of the groups are p1 (first group) and p2 (second group), then the odds ratio is:

${ p_1/(1-p_1) \over p_2/(1-p_2)}={ p_1/q_1 \over p_2/q_2}=\frac{\;p_1q_2\;}{\;p_2q_1\;},$

where qx = 1 − px. An odds ratio of 1 indicates that the condition or event under study is equally likely to occur in both groups. An odds ratio greater than 1 indicates that the condition or event is more likely to occur in the first group. And an odds ratio less than 1 indicates that the condition or event is less likely to occur in the first group. The odds ratio must be nonnegative if it is defined. It is undefined if p2q1 equals zero, i.e., if p2 equals zero or p1 equals one.

### Definition in terms of joint and conditional probabilities

The odds ratio can also be defined in terms of the joint probability distribution of two binary random variables. The joint distribution of binary random variables X and Y can be written

 Y = 1 Y = 0 X = 1 $p_{11}$ $p_{10}$ X = 0 $p_{01}$ $p_{00}$

where p11, p10, p01 and p00 are non-negative "cell probabilities" that sum to one. The odds for Y within the two subpopulations defined by X = 1 and X = 0 are defined in terms of the conditional probabilities given X:

 Y = 1 Y = 0 X = 1 $p_{11}/(p_{11}+p_{10})$ $p_{10}/(p_{11}+p_{10})$ X = 0 $p_{01}/(p_{01}+p_{00})$ $p_{00}/(p_{01}+p_{00})$

Thus the odds ratio is

${ \dfrac{p_{11}/(p_{11}+p_{10})}{p_{10}/(p_{11}+p_{10})} \bigg / \dfrac{p_{01}/(p_{01}+p_{00})}{p_{00}/(p_{01}+p_{00})}} = \dfrac{p_{11}p_{00}}{p_{10}p_{01}}.$

The simple expression on the right, above, is easy to remember as the product of the probabilities of the "concordant cells" (X = Y) divided by the product of the probabilities of the "discordant cells" (X ≠ Y). However note that in some applications the labeling of categories as zero and one is arbitrary, so there is nothing special about concordant versus discordant values in these applications.

### Symmetry

If we had calculated the odds ratio based on the conditional probabilities given Y,

 Y = 1 Y = 0 X = 1 $p_{11}/(p_{11}+p_{01})$ $p_{10}/(p_{10}+p_{00})$ X = 0 $p_{01}/(p_{11}+p_{01})$ $p_{00}/(p_{10}+p_{00})$

we would have gotten the same result

${ \dfrac{p_{11}/(p_{11}+p_{01})}{p_{01}/(p_{11}+p_{01})} \bigg / \dfrac{p_{10}/(p_{10}+p_{00})}{p_{00}/(p_{10}+p_{00})}} = \dfrac{p_{11}p_{00}}{p_{10}p_{01}}.$

Other measures of effect size for binary data such as the relative risk do not have this symmetry property.

### Relation to statistical independence

If X and Y are independent, their joint probabilities can be expressed in terms of their marginal probabilities px =  P(X = 1) and py =  P(Y = 1), as follows

 Y = 1 Y = 0 X = 1 $p_xp_y$ $p_x(1-p_y)$ X = 0 $(1-p_x)p_y$ $(1-p_x)(1-p_y)$

In this case, the odds ratio equals one, and conversely the odds ratio can only equal one if the joint probabilities can be factored in this way. Thus the odds ratio equals one if and only if X and Y are independent.

### Recovering the cell probabilities from the odds ratio and marginal probabilities

The odds ratio is a function of the cell probabilities, and conversely, the cell probabilities can be recovered given knowledge of the odds ratio and the marginal probabilities P(X = 1) = p11 + p10 and P(Y = 1) = p11 + p01. If the odds ratio R differs from 1, then

$p_{11} = \frac{1 + (p_{1\cdot}+p_{\cdot 1})(R-1) - S}{2(R-1)}$

where p1• = p11 + p10,  p•1 = p11 + p01, and

$S = \sqrt{(1+(p_{1\cdot}+p_{\cdot 1})(R-1))^2 + 4R(1-R)p_{1\cdot}p_{\cdot 1}}.$

In the case where R = 1, we have independence, so p11 = p1•p•1.

Once we have p11, the other three cell probabilities can easily be recovered from the marginal probabilities.

## Example

A graph showing how the log odds ratio relates to the underlying probabilities of the outcome X occurring in two groups, denoted A and B. The log odds ratio shown here is based on the odds for the event occurring in group B relative to the odds for the event occurring in group A. Thus, when the probability of X occurring in group B is greater than the probability of X occurring in group A, the odds ratio is greater than 1, and the log odds ratio is greater than 0.

Suppose that in a sample of 100 men, 90 drank wine in the previous week, while in a sample of 100 women only 20 drank wine in the same period. The odds of a man drinking wine are 90 to 10, or 9:1, while the odds of a woman drinking wine are only 20 to 80, or 1:4 = 0.25:1. The odds ratio is thus 9/0.25, or 36, showing that men are much more likely to drink wine than women. The detailed calculation is:

${ 0.9/0.1 \over 0.2/0.8}=\frac{\;0.9\times 0.8\;}{\;0.1\times 0.2\;} ={0.72 \over 0.02} = 36.$

This example also shows how odds ratios are sometimes sensitive in stating relative positions: in this sample men are 90/20 = 4.5 times more likely to have drunk wine than women, but have 36 times the odds. The logarithm of the odds ratio, the difference of the logits of the probabilities, tempers this effect, and also makes the measure symmetric with respect to the ordering of groups. For example, using natural logarithms, an odds ratio of 36/1 maps to 3.584, and an odds ratio of 1/36 maps to −3.584.

## Statistical inference

A graph showing the minimum value of the sample log odds ratio statistic that must be observed to be deemed significant at the 0.05 level, for a given sample size. The three lines correspond to different settings of the marginal probabilities in the 2x2 contingency table (the row and column marginal probabilities are equal in this graph).

Several approaches to statistical inference for odds ratios have been developed.

One approach to inference uses large sample approximations to the sampling distribution of the log odds ratio (the natural logarithm of the odds ratio). If we use the joint probability notation defined above, the population log odds ratio is

${\log\left(\frac{p_{11}p_{00}}{p_{01}p_{10}}\right) = \log(p_{11}) + \log(p_{00}\big) - \log(p_{10}) - \log(p_{01})}.\,$

If we observe data in the form of a contingency table

 Y = 1 Y = 0 X = 1 $n_{11}$ $n_{10}$ X = 0 $n_{01}$ $n_{00}$

then the probabilities in the joint distribution can be estimated as

 Y = 1 Y = 0 X = 1 $\hat{p}_{11}$ $\hat{p}_{10}$ X = 0 $\hat{p}_{01}$ $\hat{p}_{00}$

where p̂ = nij / n, with n = n11 + n10 + n01 + n00 being the sum of all four cell counts. The sample log odds ratio is

${L=\log\left(\dfrac{\hat{p}_{11}\hat{p}_{00}}{\hat{p}_{10}\hat{p}_{01}}\right) = \log\left(\dfrac{n_{11}n_{00}}{n_{10}n_{01}}\right)}$.

The distribution of the log odds ratio is approximately normal with:

$X\ \sim\ \mathcal{N}(\log (OR),\,\sigma^2). \,$

The standard error for the log odds ratio is approximately

${{\rm SE} = \sqrt{\dfrac{1}{n_{11}} + \dfrac{1}{n_{10}} + \dfrac{1}{n_{01}} + \dfrac{1}{n_{00}}}}$.

This is an asymptotic approximation, and will not give a meaningful result if any of the cell counts are very small. If L is the sample log odds ratio, an approximate 95% confidence interval for the population log odds ratio is L ± 1.96SE.[4] This can be mapped to exp(L − 1.96SE), exp(L + 1.96SE) to obtain a 95% confidence interval for the odds ratio. If we wish to test the hypothesis that the population odds ratio equals one, the two-sided p-value is 2P(Z< −|L|/SE), where P denotes a probability, and Z denotes a standard normal random variable.

An alternative approach to inference for odds ratios looks at the distribution of the data conditionally on the marginal frequencies of X and Y. An advantage of this approach is that the sampling distribution of the odds ratio can be expressed exactly.

### Tests for homogeneity

In applications of the odds ratio the relationship between exposure and outcome may be different for different strata. Such cases may be described by a k x 2 x 2 table. The homogeneity of the odds ratios in such a case may be tested with the Breslow Day statistic[5] with the Tarone adjustment which is distributed asymptotically as a chi-squared variable with degrees of freedom equal to k - 1.[6] The test statistic is

$BD = \sum{ \frac{ x_{ 1k } - E( x_{ 1k } | OR_{ MH } ) }{ V( x_{ 1k } | OR_{ MH } ) } }$

where ORMH is the Mantel-Haenszel estimator of common odds ratio. E( x1k | ORMH) and V( x1k | ORMH ) are the expected value (mean) and variance of x1k under the null hypothesis of homogeneity of odds ratios respectively. The sum is taken over the k tables.

Testing of homogeneity in k x n x m tables cannot be done with this statistic: log linear regression may be used instead.[citation needed]

Other tests that may be useful include the Mantel-Haenszel common odds ratio estimate. This test was originally developed by Cochran[7] and was modified by Mantel and Haenszel.[8] It is known either as the Cochran–Mantel–Haenszel or the Mantel–Haenszel test. The test statistic is

$\chi^2_{ CMH or MH } = \frac{ ( | \sum[ a - \frac{ ( a + b )( a + c ) }{ n } ] | - 0.5 )^2 } { \sum[ \frac{ ( a + b )( a + c ) ( b + d )( c + d )}{ n^3 - n } ] }$

where a, b, c and d are the values in the 2 x 2 table and n is the sample size. The subscript CMH or MH refers to the name of the test - either the Cochran–Mantel–Haenszel or Mantel–Haenszel. The statistic χ2 is distributed as a chi squared variate with one degree of freedom. The -0.5 is a continuity correction.

The numerator contains the absolute value of the difference between the observed value in one cell (a) and the expected value under the null hypothesis - ( a + b )( a + c ) / n - so the numerator is the squared sum of deviations between the observed and expected values. The choice of cell is arbitrary as the value of the statistic is the same for all 2 x 2 tables. This test is sometimes used without the continuity correction. In published work it should be made clear if this correction was or was not used.

## Role in logistic regression

Logistic regression is one way to generalize the odds ratio beyond two binary variables. Suppose we have a binary response variable Y and a binary predictor variable X, and in addition we have other predictor variables Z1, ..., Zp that may or may not be binary. If we use multiple logistic regression to regress Y on X, Z1, ..., Zp, then the estimated coefficient $\hat{\beta}_x$ for X is related to a conditional odds ratio. Specifically, at the population level

$\exp(\beta_x) = \frac{P(Y=1|X=1, Z_1, \ldots, Z_p)/P(Y=0|X=1, Z_1, \ldots, Z_p)}{P(Y=1|X=0, Z_1, \ldots, Z_p)/P(Y=0|X=0, Z_1, \ldots, Z_p)},$

so $\exp(\hat{\beta}_x)$ is an estimate of this conditional odds ratio. The interpretation of $\exp(\hat{\beta}_x)$ is as an estimate of the odds ratio between Y and X when the values of Z1, ..., Zp are held fixed.

## Insensitivity to the type of sampling

If the data form a "population sample", then the cell probabilities p̂ij are interpreted as the frequencies of each of the four groups in the population as defined by their X and Y values. In many settings it is impractical to obtain a population sample, so a selected sample is used. For example, we may choose to sample units with X = 1 with a given probability f, regardless of their frequency in the population (which would necessitate sampling units with X = 0 with probability 1 − f). In this situation, our data would follow the following joint probabilities:

 Y = 1 Y = 0 X = 1 $fp_{11}/(p_{11}+p_{10})$ $fp_{10}(p_{11}+p_{10})$ X = 0 $(1-f)p_{01}/(p_{01}+p_{00})$ $(1-f)p_{00}/(p_{01}+p_{00})$

The odds ratio p11p00 / p01p10 for this distribution does not depend on the value of f. This shows that the odds ratio (and consequently the log odds ratio) is invariant to non-random sampling based on one of the variables being studied. Note however that the standard error of the log odds ratio does depend on the value of f. This fact is exploited in two important situations:

• Suppose it is inconvenient or impractical to obtain a population sample, but it is practical to obtain a convenience sample of units with different X values, such that within the X = 0 and X = 1 subsamples the Y values are representative of the population (i.e. they follow the correct conditional probabilities).
• Suppose the marginal distribution of one variable, say X, is very skewed. For example, if we are studying the relationship between high alcohol consumption and pancreatic cancer in the general population, the incidence of pancreatic cancer would be very low, so it would require a very large population sample to get a modest number of pancreatic cancer cases. However we could use data from hospitals to contact most or all of their pancreatic cancer patients, and then randomly sample an equal number of subjects without pancreatic cancer (this is called a "case-control study").

In both these settings, the odds ratio can be calculated from the selected sample, without biasing the results relative to what would have been obtained for a population sample.

## Use in quantitative research

Due to the widespread use of logistic regression, the odds ratio is widely used in many fields of medical and social science research. The odds ratio is commonly used in survey research, in epidemiology, and to express the results of some clinical trials, such as in case-control studies. It is often abbreviated "OR" in reports. When data from multiple surveys is combined, it will often be expressed as "pooled OR".

## Relation to relative risk

In clinical studies, as well as in some other settings, the parameter of greatest interest is often the relative risk rather than the odds ratio. The relative risk is best estimated using a population sample, but if the rare disease assumption holds, the odds ratio is a good approximation to the relative risk — the odds is p / (1 − p), so when p moves towards zero, 1 − p moves towards 1, meaning that the odds approaches the risk, and the odds ratio approaches the relative risk.[9] When the rare disease assumption does not hold, the odds ratio can overestimate the relative risk.[10][11][12]

If the absolute risk in the control group is available, conversion between the two is calculated by:[10]

$RR \approx \frac{OR}{1 - R_C + (R_C \times OR)}$

where:

• RR = relative risk
• OR = odds ratio
• RC = absolute risk in the unexposed group, given as a fraction (for example: fill in 10% risk as 0.1)

### Confusion and exaggeration

Odds ratios have often been confused with relative risk in medical literature. For non-statisticians, the odds ratio is a difficult concept to comprehend, and it gives a more impressive figure for the effect.[13] However, most authors consider that the relative risk is readily understood.[14] In one study, members of a national disease foundation were actually 3.5 times more likely than nonmembers to have heard of a common treatment for that disease - but the odds ratio was 24 and the paper stated that members were ‘more than 20-fold more likely to have heard of’ the treatment.[15] A study of papers published in two journals reported that 26% of the articles that used an odds ratio interpreted it as a risk ratio.[16]

This may reflect the simple process of uncomprehending authors choosing the most impressive-looking and publishable figure.[14] But its use may in some cases be deliberately deceptive.[17] It has been suggested that the odds ratio should only be presented as a measure of effect size when the risk ratio can not be estimated directly.[13]

## Invertibility and invariance

The odds ratio has another unique property of being directly mathematically invertible whether analyzing the OR as either disease survival or disease onset incidence - where the OR for survival is direct reciprocal of 1/OR for risk.[citation needed] This is known as the 'invariance of the odds ratio'. In contrast, the relative risk does not possess this mathematical invertible property when studying disease survival vs. onset incidence.[citation needed] This phenomenon of OR invertibility vs. RR non-invertibility is best illustrated with an example:

Suppose in a clinical trial, one has an adverse event risk of 4/100 in drug group, and 2/100 in placebo... yielding a RR=2 and OR=2.04166 for drug-vs-placebo adverse risk. However, if analysis was inverted and adverse events were instead analyzed as event-free survival, then the drug group would have a rate of 96/100, and placebo group would have a rate of 98/100—yielding a drug-vs-placebo a RR=0.9796 for survival, but an OR=0.48979. As one can see, a RR of 0.9796 is clearly not the reciprocal of a RR of 2. In contrast, an OR of 0.48979 is indeed the direct reciprocal of an OR of 2.04166.

This is again what is called the 'invariance of the odds ratio', and why a RR for survival is not the same as a RR for risk, while the OR has this symmetrical property when analyzing either survival or adverse risk. The danger to clinical interpretation for the OR comes when the adverse event rate is not rare, thereby exaggerating differences when the OR rare-disease assumption is not met. On the other hand, when the disease is rare, using a RR for survival (e.g. the RR=0.9796 from above example) can clinically hide and conceal an important doubling of adverse risk associated with a drug or exposure.[citation needed]

## Alternative estimators of the odds ratio

The sample odds ratio n11n00 / n10n01 is easy to calculate, and for moderate and large samples performs well as an estimator of the population odds ratio. When one or more of the cells in the contingency table can have a small value, the sample odds ratio can be biased and exhibit high variance. A number of alternative estimators of the odds ratio have been proposed to address this issue. One alternative estimator is the conditional maximum likelihood estimator, which conditions on the row and column margins when forming the likelihood to maximize (as in Fisher's exact test).[18] Another alternative estimator is the Mantel-Haenszel estimator.

## Numerical examples

The following four contingency tables contain observed cell counts, along with the corresponding sample odds ratio (OR) and sample log odds ratio (LOR):

OR = 1, LOR = 0 OR = 1, LOR = 0 OR = 4, LOR = 1.39 OR = 0.25, LOR = −1.39
Y = 1 Y = 0 Y = 1 Y = 0 Y = 1 Y = 0 Y = 1 Y = 0
X = 1 10 10 100 100 20 10 10 20
X = 0 5 5 50 50 10 20 20 10

The following joint probability distributions contain the population cell probabilities, along with the corresponding population odds ratio (OR) and population log odds ratio (LOR):

OR = 1, LOR = 0 OR = 1, LOR = 0 OR = 16, LOR = 2.77 OR = 0.67, LOR = −0.41
Y = 1 Y = 0 Y = 1 Y = 0 Y = 1 Y = 0 Y = 1 Y = 0
X = 1 0.2 0.2 0.4 0.4 0.4 0.1 0.1 0.3
X = 0 0.3 0.3 0.1 0.1 0.1 0.4 0.2 0.4

## Worked example

Example 1: risk reduction Example 2: risk increase
Experimental group (E) Control group (C) Total (E) (C) Total
Events (E) EE = 15 CE = 100 115 EE = 75 CE = 100 175
Non-events (N) EN = 135 CN = 150 285 EN = 75 CN = 150 225
Total subjects (S) ES = EE + EN = 150 CS = CE + CN = 250 400 ES = 150 CS = 250 400
Event rate (ER) EER = EE / ES = 0.1, or 10% CER = CE / CS = 0.4, or 40% EER = 0.5 (50%) CER = 0.4 (40%)
Equation Variable Abbr. Example 1 Example 2
CER − EER < 0: absolute risk reduction ARR (−)0.3, or (−)30% N/A
> 0: absolute risk increase ARI N/A 0.1, or 10%
(CER − EER) / CER < 0: relative risk reduction RRR (−)0.75, or (−)75% N/A
> 0: relative risk increase RRI N/A 0.25, or 25%
1 / (CER − EER) < 0: number needed to treat NNT (−)3.33 N/A
> 0: number needed to harm NNH N/A 10
EER / CER relative risk RR 0.25 1.25
(EE / EN) / (CE / CN) odds ratio OR 0.167 1.5
EER − CER attributable risk AR (−)0.30, or (−)30% 0.1, or 10%
(RR − 1) / RR attributable risk percent ARP N/A 20%
1 − RR (or 1 − OR) preventive fraction PF 0.75, or 75% N/A

## References

1. ^ Cornfield, J (1951). "A Method for Estimating Comparative Rates from Clinical Data. Applications to Cancer of the Lung, Breast, and Cervix". Journal of the National Cancer Institute 11: 1269–1275. PMID 14861651.
2. ^ Mosteller, Frederick (1968). "Association and Estimation in Contingency Tables". Journal of the American Statistical Association (American Statistical Association) 63 (321): 1–28. doi:10.2307/2283825. JSTOR 2283825.
3. ^ Edwards, A.W.F. (1963). "The measure of association in a 2x2 table". Journal of the Royal Statistical Society, Series A (Blackwell Publishing) 126 (1): 109–114. doi:10.2307/2982448. JSTOR 2982448.
4. ^ Morris and Gardner; Gardner, MJ (1988). "Calculating confidence intervals for relative risks (odds ratios) and standardised ratios and rates". British Medical Journal 296 (6632): 1313–1316. doi:10.1136/bmj.296.6632.1313. PMC 2545775. PMID 3133061.
5. ^ Breslow N, Day NE (1980) "Classical methods of analysis of grouped data". In: Statistical Methods in Cancer Research. The analysis of case-control studies. Vol 1. Lyon: International Agency for Research on Cancer. pp 122-159
6. ^ I-Ming Liu (2005) "Breslow–Day Test". Encyclopedia of Biostatistics. John Wiley & Sons, Ltd. doi: 10.1002/0470011815.b2a10009
7. ^ Cochran WG (1954) "Some methods for strengthening the common χ2 tests". Biometrics, 10: 417-451
8. ^ Mantel N, Haenszel W (1959) "Statistical aspects of the analysis of data from retrospective studies of disease". J Natl Cancer Inst 22: 719-774
9. ^ Viera AJ (July 2008). "Odds ratios and risk ratios: what's the difference and why does it matter?". South. Med. J. 101 (7): 730–4. doi:10.1097/SMJ.0b013e31817a7ee4. PMID 18580722.
10. ^ a b Zhang J, Yu KF (November 1998). "What's the relative risk? A method of correcting the odds ratio in cohort studies of common outcomes". JAMA 280 (19): 1690–1. doi:10.1001/jama.280.19.1690. PMID 9832001.
11. ^ Robbins AS, Chao SY, Fonseca VP (October 2002). "What's the relative risk? A method to directly estimate risk ratios in cohort studies of common outcomes". Ann Epidemiol 12 (7): 452–4. doi:10.1016/S1047-2797(01)00278-2. PMID 12377421.
12. ^ Nurminen, Markku (1995). "To Use or Not to Use the Odds Ratio in Epidemiologic Analyses?". European Journal of Epidemiology 11 (4): 365–371. doi:10.1007/BF01721219. JSTOR 3582428.
13. ^ a b "On the use, misuse and interpretation of odds ratios". Dirk Taeger, Yi Sun, Kurt Straif. 10 August 1998. doi: 10.1136/bmj.316.7136.989 http://www.bmj.com/content/316/7136/989?tab=responses
14. ^ a b "Against all odds? Improving the understanding of risk reporting". A'Court, Christine; Stevens, Richard; Heneghan, Carl. British Journal of General Practice, Volume 62, Number 596, March 2012, pp. e220-e223(4). doi:10.3399/bjgp12X630223
15. ^ Nijsten T, Rolstad T, Feldman SR, Stern RS. Members of the national psoriasis foundation: more extensive disease and better informed about treatment options. Archives of Dermatology 2005;141(1): 19–26, p24 table 3 and text. http://archderm.ama-assn.org/cgi/reprint/141/1/19.pdf
16. ^ Holcomb WL, Chaiworapongsa T, Luke DA, Burgdorf KD. (2001) "An Odd Measure of Risk: Use and Misuse of the Odds Ratio". Obstetrics and Gynecology, 98(4): 685–688.
17. ^ "The trouble with odds ratios". Thabani Sibanda. 1 May 2003 doi: 10.1136/bmj.316.7136.989 http://www.bmj.com/content/316/7136/989?tab=responses
18. ^ Rothman, Kenneth J.; Greenland, Sander; Lash, Timothy L. (2008). Modern Epidemiology. Lippincott Williams & Wilkins. ISBN 0-7817-5564-6.