Association
An association is the most general relationship between two variables. It can be measured and tested, but it can also arise from chance or from the way a sample was selected.
What an association is
Two variables are associated when knowing the value of one provides information about the value of the other.
The variables may be categories, such as diagnosed or not, or numbers, such as hours of sleep. If the distribution of one differs according to the value of the other, they are associated; otherwise they are independent. An association may reflect a cause, a common cause of both, the way participants were selected, or chance.
Two categories: the two-by-two table
When an exposure and an outcome each have two categories, the data form a table of four counts, labelled a, b, c and d.
| Below the pass mark | Passed | Total | |
|---|---|---|---|
| Slept under 6 hours | |||
| Slept 6 hours or more | |||
| Total |
- Risk
- The proportion of a group with the outcome: a / (a + b) among the exposed and c / (c + d) among the unexposed.
- Risk difference
- Risk in the exposed minus risk in the unexposed. No association gives 0.
- Risk ratio (relative risk)
- Risk in the exposed divided by risk in the unexposed. A risk ratio of 2 means the outcome is twice as common among the exposed. No association gives 1.
- Odds ratio
- The odds are the number with the outcome divided by the number without it. The odds ratio is (a / b) ÷ (c / d) = ad / bc. No association gives 1.
- Risk ratio or odds ratio
- A case–control study fixes the numbers of cases and controls, so only the odds ratio can be calculated. When the outcome is rare the two ratios are similar; when it is common, the odds ratio exaggerates the association if read as a risk ratio1.
Testing an association: chi-squared and Fisher’s exact test
A test of association asks how surprising the observed table would be if the two variables were independent. Under independence, the expected count in each cell is its row total multiplied by its column total, divided by the grand total.
Pearson’s chi-squared test
The chi-squared statistic sums the squared differences between each observed count O and its expected count E, each divided by E2,3:
χ² = Σ (O − E)² / E
For a two-by-two table it has one degree of freedom. The test is an approximation that performs poorly when any expected count is below about 53. The values shown are without Yates’s continuity correction4.
Fisher’s exact test
Fisher’s test holds the row and column totals fixed and calculates the exact probability, under independence, of every table with those totals. The two-sided p-value is the total probability of all tables as improbable as the observed one, or more so.
Strength is not significance
A p-value depends on both the strength of an association and the amount of data. With enough participants a trivial association becomes statistically significant; with too few, a large one may not. A p-value does not measure the size or importance of an effect5, so the strength of an association should be reported with its confidence interval.
Associations that are not correlations
A correlation coefficient measures only the tendency of two ordered variables to increase or decrease together. It can be close to zero when an outcome is highest at intermediate values of a variable, and it is meaningless for categories with no natural order, such as strains of mice, which can nevertheless differ in behaviour.
Misleading associations
Multiple comparisons
With no association, a test at the 5% level gives p < 0.05 about once in 20 tests, so a study that tests many brain regions or genes will find some significant results by chance. The Bonferroni correction (dividing 0.05 by the number of tests) and control of the false discovery rate limit this problem6,7.
Selection bias and Berkson’s bias
The way people enter a study can create an association that does not exist in the population. Among hospital patients two unrelated conditions can appear related, because either one makes admission more likely8,9.
Simpson’s paradox
An association in combined data can disappear, or reverse, within every subgroup10. This can happen only when a third variable is related to both exposure and outcome11. In the simulated example, rehabilitation programme A is better than B after both mild and severe strokes, yet A appears worse overall when it is given mainly to patients with severe strokes, who recover less often. Severity is a confounder here, so the comparison within severity groups is the fair one.
Practice case: is a gene variant associated with a disease?
A short conversation about one simulated study. Answer each card to continue. To plan a study of your own, use the study designer.
References
- Kim, H.-Y. (2017). Statistical notes for clinical researchers: Risk difference, risk ratio, and odds ratio. Restorative Dentistry & Endodontics, 42(1), 72–76. https://doi.org/10.5395/rde.2017.42.1.72
- Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 50(302), 157–175. https://doi.org/10.1080/14786440009463897
- Kim, H.-Y. (2017b). Statistical notes for clinical researchers: Chi-squared test and Fisher’s exact test. Restorative Dentistry & Endodontics, 42(2), 152–155. https://doi.org/10.5395/rde.2017.42.2.152
- Yates, F. (1934). Contingency tables involving small numbers and the χ² test. Supplement to the Journal of the Royal Statistical Society, 1(2), 217–235. https://doi.org/10.2307/2983604
- Wasserstein, R. L., & Lazar, N. A. (2016). The ASA statement on p-values: context, process, and purpose. The American Statistician, 70(2), 129–133. https://doi.org/10.1080/00031305.2016.1154108
- Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society, Series B, 57(1), 289–300. https://doi.org/10.1111/j.2517-6161.1995.tb02031.x
- Ranganathan, P., Pramesh, C. S., & Buyse, M. (2016). Common pitfalls in statistical analysis: the perils of multiple testing. Perspectives in Clinical Research, 7(2), 106–107. https://doi.org/10.4103/2229-3485.179436
- Berkson, J. (1946). Limitations of the application of fourfold table analysis to hospital data. Biometrics Bulletin, 2(3), 47. https://doi.org/10.2307/3002000
- Westreich, D. (2012). Berkson’s bias, selection bias, and missing data. Epidemiology, 23(1), 159–164. https://doi.org/10.1097/EDE.0b013e31823b6296
- Simpson, E. H. (1951). The interpretation of interaction in contingency tables. Journal of the Royal Statistical Society, Series B, 13(2), 238–241. https://doi.org/10.1111/j.2517-6161.1951.tb00088.x
- Tu, Y.-K., Gunnell, D., & Gilthorpe, M. S. (2008). Simpson’s paradox, Lord’s paradox, and suppression effects are the same phenomenon – the reversal paradox. Emerging Themes in Epidemiology, 5, 2. https://doi.org/10.1186/1742-7622-5-2
- Setia, M. S. (2016b). Methodology series module 2: Case-control studies. Indian Journal of Dermatology, 61(2), 146–151. https://doi.org/10.4103/0019-5154.177773
- Hellwege, J. N., Keaton, J. M., Giri, A., Gao, X., Velez Edwards, D. R., & Edwards, T. L. (2017). Population stratification in genetic association studies. Current Protocols in Human Genetics, 95, 1.22.1–1.22.23. https://doi.org/10.1002/cphg.48
- Dunn, O. J. (1961). Multiple comparisons among means. Journal of the American Statistical Association, 56(293), 52–64. https://doi.org/10.1080/01621459.1961.10482090
- Fisher, R. A. (1935). The logic of inductive inference. Journal of the Royal Statistical Society, 98(1), 39–82. https://doi.org/10.2307/2342435
- Katz, D., Baptista, J., Azen, S. P., & Pike, M. C. (1978). Obtaining confidence intervals for the risk ratio in cohort studies. Biometrics, 34(3), 469–474. https://doi.org/10.2307/2530610
- Woolf, B. (1955). On estimating the relation between blood group and disease. Annals of Human Genetics, 19(4), 251–253. https://doi.org/10.1111/j.1469-1809.1955.tb01348.x
The statistics in the figures are calculated in the browser and were checked against SciPy.
Last updated