CHAPTER 05 · TOPIC 03
Contingency Tables, Odds Ratios, and Relative Risks
Read 2×2 tables in context and estimate odds ratios, relative risks, and their log-scale confidence intervals.
On this page
- Structure of 2×2 contingency table
- Joint Probability, Conditional Probability, and Independence
- Study Design Determines Interpretation
- Odds and the Odds Ratio
- Estimate the OR on a logarithmic scale
- Risk and Relative Risk
- Estimate RR on a logarithmic scale
- Difference Between OR and RR
- Why the Log-Scale Variance Formulas Work: The Delta Method
- Zero Cells and Small Samples
- Reporting in Practice
A contingency table (crosstab) organizes two or more categorical variables at the same time. In particular, the 2 × 2 table is the basic form for quantifying the direction and magnitude of an association through odds ratios (ORs) and relative risks (RRs) as well as tests of independence.
Structure of 2×2 contingency table#
| With result Y=1 | No result Y=0 | total | |
| Exposure X=1 | A | B | A+B |
| No exposure X=0 | C | D | C+D |
| total | A+C | B+D | N |
A to D are cell frequencies that satisfy the simultaneous condition, and the sum of rows and columns is the marginal frequency. Although it is optional to place one in a row and one in a column, the numerator/denominator and interpretation of the effect size depend on the arrangement, so the definition should be clearly stated.
Joint Probability, Conditional Probability, and Independence#
Study Design Determines Interpretation#
| design | Sampling criteria | Quantities that are easy to estimate directly |
| Cohort/randomized trial | Tracking from exposure/intervention group | Risk, RR, risk difference, OR |
| case control study | Extract based on presence/absence of results | OR (Generally, risk and RR cannot be directly estimated) |
| cross-sectional study | Measure exposure and outcomes at a single point in time | Prevalence ratio/OR |
Even with the same four numbers, the meaning of the denominator changes depending on who is extracted from which population. Check the research design before looking at the calculation formula.
Odds and the Odds Ratio#
OR=1 indicates no association, OR>1 indicates higher odds of outcome in the exposed group, and OR<1 indicates lower odds. For example, OR=2 is not twice the probability, but twice the odds.
Estimate the OR on a logarithmic scale#
Risk and Relative Risk#
RR=1 is equal risk, RR=2 is twice the risk of the exposed group, and RR=0.5 is half the risk. It is naturally interpreted in cohort studies and trials where the follow-up period and denominator can be defined.
Estimate RR on a logarithmic scale#
Difference Between OR and RR#
| item | OR | RR |
| amount to compare | odds | risk (probability) |
| unrelated value | 1 | 1 |
| case control study | Estimable | Usually not directly estimated |
| rare results | Approximate to RR | direct |
| If the result is not rare | It tends to appear larger than RR in the direction away from 1. | Clinical interpretation is relatively intuitive |
Why the Log-Scale Variance Formulas Work: The Delta Method#
The variance of a nonlinear function is found by a first-order approximation near the estimated value. This is the basis of the log standard error of OR/RR.
Since the derivative of log(x) is 1/x, the logarithmic variance of the counts is approximately 1/x. When we add and subtract independent logarithmic cell frequencies, the variances add up and we get 1/A+1/B+1/C+1/D of log(OR). In RR, since the numerator and denominator in the same row are shared, covariance is taken into consideration, and −1/(A+B) and −1/(C+D) appear.
Zero Cells and Small Samples#
If any cell is 0, the normal OR or log standard error will be infinite or undefined. Since mechanical 0.5 addition can change the estimation target, we will consider the exact method, conditional estimation, penalized logistic regression, etc. depending on the purpose, and specify the method to be adopted.
Reporting in Practice#
- Specify row/column definitions, target population, and research design
- Check the four cells and marginal frequencies, and indicate how to handle missing values.
- Select OR, RR, and risk difference if necessary to suit your design and purpose.
- Report point estimates and 95% confidence intervals
- Explain not only the p-value of the independence test, but also the direction, magnitude, and clinical significance of the effect.
- Describes limitations of small samples, zero cells, confounding, and selection bias.