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 ratio (Davies et al., 1998).
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 E (Pearson, 1900):
χ² = Σ (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 5. The values shown are without Yates’s continuity correction.
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 effect (Wasserstein and Lazar, 2016), 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 (Benjamini and Hochberg, 1995) limit this problem.
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 likely (Berkson, 1946).
Simpson’s paradox
An association in combined data can disappear, or reverse, within every subgroup (Simpson, 1951). This happens when a third variable is related to both exposure and outcome. 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.
References
- 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
- 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
- Davies, H. T. O., Crombie, I. K., & Tavakoli, M. (1998). When can odds ratios mislead? BMJ, 316(7136), 989–991. https://doi.org/10.1136/bmj.316.7136.989
- 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
- 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
- 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
The statistics in the figures are calculated in the browser and were checked against SciPy.
Last updated