A spurious correlation is a statistical association that does not represent a causal relationship. Two variables may move together because a third factor affects both, so prediction alone cannot establish what would happen after an intervention. section 1.2
Population, revenue, and doctorates
A synthetic dataset generates population first, then makes arcade revenue and computer-science doctorates depend on population independently. Revenue and doctorates nevertheless show a correlation of 0.95. The association is strong, but it does not by itself prove that population is the actual explanation in a real setting. section 1.4.1
When image backgrounds mislead a classifier
If training images commonly show dogs against green backgrounds and fish against blue ones, a classifier may learn the background rather than the animal. A dog jumping against blue may then be predicted as a fish because the model exploits a spurious correlation. section 4.3.3
Use the concept to separate predictive success from causal understanding:
- Treat a high correlation or accurate prediction as evidence of association, not proof that changing one variable will change the other. section 1.2
- Use synthetic data to test whether an apparent relationship can arise from a hidden data-generating process. section 1.4.1
- Consider confounders, assumptions, goals, and limitations before drawing causal conclusions. section 1.2
Listing 1.1 (R) Building a synthetic dataset that creates spurious correlations
set.seed(1234)
time <- 2000:2009
population <- 280 + 3 * (time - 2000) +
rnorm(n=length(time), sd=0.1) #1
revenue <- 1.25 + (population - 280) * 0.015 +
rnorm(n=length(time), sd=0.05) #2
)
doctorates <- 700 + (population - 280) * 30 +
rnorm(n=length(time), sd=10) #3
cor(doctorates, revenue)
Run the R listing to generate population, revenue, and doctorate variables and inspect the resulting correlation. section 1.4.1
