Statistics
The Bet Test: Spotting Problems in Bayesian A/B Test Analysis
Learn more
TL;DR:
Both ice cream sales and drownings tend to rise during the summer, but while these two events might happen at the same time, it doesn’t mean one causes the other. Instead, both of these unrelated variables are more likely attributed to hotter weather in the summer months. While this example is easy to spot, it highlights a key difference between correlation and causation that can definitely be more difficult to spot in more nuanced data analysis scenarios.
Misunderstanding this difference can lead to poor decision-making, wasted resources, and incorrect conclusions. In this guide, we’ll break down the difference between correlation and causation and show how tools like Eppo can help teams accurately test and uncover causal effects via experimentation.
What You’ll Learn:
Correlation refers to a relationship where two variables move together, either in the same direction (positive correlation) or in opposite directions (negative correlation).
For example, you might notice that the more push notifications a user receives, the more time they spend in your app. This could be a statistical correlation, but it doesn’t automatically mean that the notifications are causing the increased engagement. Another explanation might be that users who are more engaged with the app are simply more likely to receive notifications.
Causation, on the other hand, is when one variable directly causes a change in another, like when you test a new feature and find that users who interact with it have higher engagement. Then you might be able to infer that the new feature is the likely cause of the increase in engagement.
The key takeaway is that correlation doesn’t automatically mean causation. Just because two variables seem linked doesn’t mean one causes the other. To confirm causality, you need more specific analysis, often through controlled experiments, where you can isolate the effect of a single variable.
To determine if two variables are correlated, the first step is to calculate their correlation coefficient. The Pearson correlation coefficient, which measures the strength and direction of the relationship between variables, is the most common tool for this. The value ranges from -1 to +1, where:
The equation to calculate the Pearson correlation coefficient is a complex one. Here it is in case you feel like flexing your mathematician muscle:
Obviously, calculating this number by hand over and over wouldn’t be an efficient use of your time, but knowing this coefficient can be an important part of your toolkit for getting insights from data. Tools like Excel, Python (using libraries like NumPy or Pandas), or R will automate this calculation making it easier for teams to test correlation without manually applying the formula.
By calculating correlation, you can start identifying patterns, but remember, correlation does not imply causation. It’s just the first step.
To test for causality, start by framing a clear hypothesis and experimentation plan. In a “Null Hypothesis Significance Test” (the most commonly-used framework for A/B testing), the null hypothesis (H₀) assumes there is no causal relationship between the variables. The alternative hypothesis (H₁) suggests that the independent variable (the one you're testing or manipulating) does cause a change in the dependent variable (the outcome you're measuring).
For example, in a product experiment, the null hypothesis might say, "Push notifications do not affect app engagement," while the alternative hypothesis would claim, "Push notifications increase app engagement."
Before diving into the experiment, it's common to use historical data or existing datasets to test the feasibility of your hypothesis and to inform the design of your experiment.
In a controlled experiment, you'll manipulate one variable while keeping others constant to isolate its effect. Here's how to set it up:
By maintaining control over other variables and only changing one at a time, you can make sure that any observed differences are most likely due to the independent variable.
A/B testing is one of the most effective ways to test causality. Using this method, you can compare two variants—Variant A (the control group) and Variant B (the experimental group)—to determine if the change you made (e.g., enabling push notifications) leads to a measurable difference in the dependent variable (e.g., app engagement).
For example, if you test two versions of an app where only one has push notifications enabled, you can measure the difference in engagement between the two groups. If Variant B (with push notifications) consistently shows higher engagement than Variant A, you may have evidence to support a causal relationship between push notifications and user engagement.
By using hypothesis testing, controlled experiments, and A/B testing, you can systematically test for causality and make more informed, data-driven decisions.
Eppo’s automated experimentation frameworks and diagnostics make it easier for teams to distinguish between correlation and causation so you can feel confident knowing your decisions are based on accurate insights. Request a demo today!