On Correlation: Ice Cream and Sunburn
Correlation doesn't imply causation.
Ice cream sales are correlated with sunburn rates. So banning ice cream sales should decrease sunburns and the risk of skin cancer? No.
We deal with data in the form of charts when viewing server metrics, stock prices, or temperature graphs. Two similar lines on a chart, connected by a story, can lead us to believe something that is not true.
Don’t be fooled by good-looking charts.
Correlation
Correlation is a measure of the relationship between two variables. The better we can predict changes in the second variable by looking at the first one, the stronger the correlation is.
Clients were insisting on adding 3 more engineers, expecting delivery to speed up proportionally. My favourite answer was that 9 women are not going to deliver a baby in 1 month. It comes with the simple assumption that if one developer can write x lines of code, then n developers can write n * x lines of code, which simply doesn’t work for software engineers.
Correlation is just a statistical measure of two variables, nothing else. Two variables can be correlated without one causing the other.
Spurious Correlations
Spurious correlation occurs when two variables appear to be statistically related but have no real-world connection. The relationship is purely coincidental.
Take a look at these charts (all charts are made by Tyler Vigen, author of the database of spurious correlations):
I like to make up stories to back up the real causation behind it, but it’s all just random. It’s probable our ancestors who assumed that rustling grass meant a predator survived, which was about reacting fast, not verifying the cause.
Searching for meaning by default is a human trait, even if there is no meaning. No matter how beautiful the graph looks, it does not mean it represents causation.
Causation
Causation is the relationship between two things where one event directly influences the other. To understand reality, we need to understand causation, and while correlation can help us with this, it shouldn’t alone act as the defining measurement.
Both ice cream sales and sunburn are correlated, but it is not because eating ice cream gets people burned. There is a third invisible thing: temperature. With higher temperatures, people buy more ice cream and go outside, which may lead to more cases of sunburn. The third thing is a confounding variable. It’s the invisible force that pulls the strings on both metrics, even if they have no direct effect on each other.
Causation can run in reverse, too. It’s tempting to assume that creating dashboards causes issues, since teams with more dashboards report more incidents. But it also runs the other way: incidents cause teams to build more dashboards.
The example of ice cream consumption affecting sunburn rates illustrates how looking beyond data can help us understand reality. When thinking in systems, we treat sunburn, skin cancer, and ice cream sales as part of a larger system.
Testing Causation
Tools to test whether we are dealing with causation or just correlation:
Isolation: Does isolating one from another influence how they behave? For example: Turning off one module after another to debug what causes the problems.
Chronology: Does changing the order of events change how they behave?
Systems Thinking: How does the whole complex system behave? Aim to connect and understand all the components and interactions within the system. In this example: human behaviour, the effects of weather, and the roles of ice cream and sunburn.
Final Thoughts
Correlations are valuable as they point out where we can look for solutions. But we have to understand what is happening behind the data, which is often invisible unless we uncover it. Reality is far too complex to put in a simple chart or map and assume that’s all there is.
When was the last time that you confused correlation with causation?
Thanks for reading,
— Michał
P.S. The Database of spurious correlations prepared by Tyler Vigen is an amazing source of correlations that are just random coincidences.
Post Notes
Discover Weekly
Articles worth your time
Podcast (Live Sessions)
Homepage | Spotify | YouTube | Apple Podcasts | Castbox | Pocket Casts
Connect
LinkedIn | Substack Profile | TopMate | X | Bsky





