Not understanding the difference between correlation and causation has produced false notions among scientists, statisticians, and casual observers for centuries. It is also arguably the source of superstition, much religion and pseudoscience. 

It is especially important to make a clear distinction between the two when working with statistical mathematics and programming. Correlation refers to the relationship between two variables, where one seems to change in response to the other. Causation, on the other hand, is the notion that one variable directly produces the other.

“For example, imagine that a researcher found a significant correlation between ice cream sales and shark attacks. Does this mean that eating ice cream leads to shark attacks? Of course not. Rather, the correlation between ice cream sales and shark attacks is likely due to a third variable, such as the temperature of the water or the time of year” – Research Methods and Statistics: An Integrated Approach.

Just because two variables are correlated doesn’t necessarily mean that one causes the other. 

A similar example would be the correlation between the number of programming errors and the complexity of the code. It is often observed that as a program gets longer, the number of errors also increases. 

Where in a short program the coder may make one error, in a longer program there would be multiple errors; leading to the assumption that longer programs have more bugs, so keep them short. 

But if one studies the bugs it becomes clear, for example, that it is really just variations of the same error being repeated. Therefore, it would be incorrect to assume that complexity directly causes errors in programming. The experience and attention of the programmer and quality of IDE are more likely the cause. 

That being said, sometimes correlation does equal causation. Let’s take the shark example. What if  sharks have a sweet tooth and get extra feisty when they smell Ben & Jerry’s on peoples breath?

What if a particular shark loves strawberry cheesecake vanilla more than anything and the only way to get his fix is to eat someone who just had some? In such a case more shark bites would result from more ice cream sales and the correlation would directly equal causation.

Case in point, when it comes to correlation and causation, it’s important to be cautious in our interpretations. Just because two things seem to be related, doesn’t mean that one is causing the other. But  sometimes they are.

People in media especially like to throw the term around. So the next time you hear a sensational headline proclaiming a new correlation, take a moment to think critically. And if no other causation is implied, just blame it on Ben & Jerry.