
Image by Editor | ChatGPT
What Is Confirmation Bias?
Confirmation bias is one of the most common cognitive traps for data professionals. We pride ourselves on objectivity as we let the numbers speak for themselves. Yet, the human brain is wired to find patterns it expects to see, a trait that can quietly undermine the most rigorous analysis. This tendency to favor information that confirms our pre-existing beliefs can lead us to misinterpret data, build flawed models, and offer misleading insights.
At its core, confirmation bias is our natural tendency to search for, interpret, and remember information that supports what we already believe. It’s a cognitive shortcut that simplifies the world and reduces mental conflict. In psychology, it’s considered a fundamental human trait that helps us process information efficiently. Instead of evaluating every piece of evidence with equal weight, we unconsciously assign more value to the pieces that fit our existing worldview, while downplaying or ignoring those that challenge it.
This isn’t a sign of intellectual weakness; it’s a feature of how our brains work. But for a data professional, this feature can quickly become a bug. As such, recognizing confirmation bias is an important elementary step toward building a more robust and honest analytical practice.
Confirmation Bias in the Wild
Consider an investor who buys stock in a new tech company, believing it’s the next big thing. To validate their decision, they start seeking out information. They avidly read news articles highlighting the company’s innovative products and positive earnings forecasts. They follow social media influencers who praise the company’s leadership.
Meanwhile, they subconsciously ignore or dismiss negative signals — reports about fierce competition, a high cash-burn rate, or technical challenges. When they encounter a critical article, they might think, “This journalist is biased” or “They don’t understand the vision.” By selectively focusing on confirming evidence, the investor reinforces their initial belief, feeling more confident in their decision while potentially becoming blind to the actual risks.
Where Data Meets the Bias
When dealing with data as professionals, confirmation bias doesn’t announce its presence. It creeps in subtly throughout the entire analytical workflow, from hypothesis generation to the final presentation.
Here are a few common ways that it can manifest:
- Hypothesis formulation: You start with a strong belief, such as “our recent marketing campaign was a huge success.” You then design your entire analysis with the goal of proving this, rather than objectively assessing its impact.
- Feature selection: When building a model, you might include certain variables because they “feel” right or support your narrative, while excluding others that might complicate the story or contradict your initial hypothesis.
- Data interpretation: An ambiguous chart with a noisy, slightly upward trend might be interpreted as “clear evidence of growth” if that’s what you were hoping to find. Another analyst without that initial bias might see the same chart and conclude the results are inconclusive.
- Stopping rule: You run an A/B test and eagerly watch the results. As soon as the variant you favor shows a statistically significant lift, you stop the test and declare a winner, without letting it run for the pre-determined duration. This is a classic case of seeing what you want to see.
A Data-Driven Example: The Perils of P-Hacking
One of the most concrete examples of confirmation bias in action is p-hacking, also known as data dredging. More precisely, p-hacking is a set of practices that operationalize confirmation bias tendencies in analysis. It’s also a very common problem in analytics, and something with which most data professionals are aware of, making it a good example for our purposes.
P-hacking occurs when an analyst, eager to find a statistically significant result, runs multiple tests on the same dataset until they find a p-value that falls below the conventional 0.05 threshold. Imagine an analyst wants to prove that a new website layout increases user engagement. They define their hypothesis: “The new layout will improve the average session duration.” They run an A/B test and find the result is not statistically significant ($p = 0.21$).
Disappointed but not defeated, the analyst decides to test other metrics: click-through rate, scroll depth, bounce rate, and time on page for users on mobile devices. After running several tests, they find that the bounce rate for mobile users has a p-value of $0.048$. They then report this single positive result as proof of the new layout’s success, ignoring all the non-significant results. This wasn’t a discovery; it was a hunt for confirmation.
By running multiple tests, they increased the probability of finding a significant result purely by chance. The following Python code demonstrates how easily this can happen. We’ll generate two identical distributions (meaning there’s no real difference) and test them repeatedly.
import numpy as np
from scipy.stats import ttest_ind
# Set a seed for reproducibility
np.random.seed(42)
significant_results = 0
num_experiments = 100
for i in range(num_experiments):
# Generate two samples from the exact same distribution
# There is no real difference between group_A and group_B
group_A = np.random.randn(100)
group_B = np.random.randn(100)
# Perform an independent t-test
t_stat, p_value = ttest_ind(group_A, group_B)
# Check if the result is "significant"
if p_value < 0.05:
significant_results += 1
print(f"Experiment {i+1}: Found a significant result! p-value = {p_value:.4f}")
print(f"\nTotal experiments: {num_experiments}")
print(f"Number of 'significant' results found by chance: {significant_results}")
print(f"False positive rate: {significant_results / num_experiments * 100:.2f}%")
And the output:
Experiment 8: Found a significant result! p-value = 0.0126 Experiment 27: Found a significant result! p-value = 0.0200 Experiment 30: Found a significant result! p-value = 0.0330 Experiment 58: Found a significant result! p-value = 0.0264 Experiment 69: Found a significant result! p-value = 0.0297 Experiment 88: Found a significant result! p-value = 0.0169 Experiment 90: Found a significant result! p-value = 0.0398 Total experiments: 100 Number of 'significant' results found by chance: 7 False positive rate: 7.00%
As the output shows, around 5% of the time, we find a "significant" result even when no true effect exists. An analyst driven by confirmation bias will latch onto that false positive and report it as a genuine finding.
Why It Matters for Data Professionals
Confirmation bias isn't just an academic concept; it has real-world consequences.
- Misleading insights: It leads to reporting spurious correlations as causal facts, providing a distorted view of reality.
- Wasted resources: Businesses may invest heavily in initiatives based on flawed, biased analysis, only to see no return on investment. The "successful" website redesign might be rolled out company-wide at great expense, with zero actual impact on user engagement.
- Erosion of trust: When data-driven recommendations consistently fail to deliver on their promises, it undermines the credibility of the entire data science team and the value of data-driven decision-making.
Staying Vigilant: How to Fight Confirmation Bias
Mitigating confirmation bias requires conscious effort and structured processes. It's not about being smarter; it's about being more disciplined.
Pre-Register Your Hypothesis
Before you even touch the data, clearly write down your hypothesis, the primary metric you will use to test it, and the criteria for success (e.g. a p-value threshold and a minimum detectable effect). This prevents you from shifting the goalposts after the fact.
Actively Seek Disconfirming Evidence
Adopt the mindset of a scientist trying to disprove their own theory. Ask yourself, "What evidence would convince me that I'm wrong?" Then, actively look for that evidence. If your hypothesis survives a genuine attempt to falsify it, your confidence in it will be much more robust.
Embrace Peer Review
Have a colleague — ideally one who doesn't share your initial assumptions — review your analysis. Encourage them to be critical and play devil's advocate. A fresh pair of eyes can spot biases and flawed reasoning that you've become blind to.
Use Blind Analysis
Whenever possible, perform your analysis without knowing which data belongs to the control group and which belongs to the treatment group. For example, a colleague can relabel your "new design" and "old design" groups to "group 1" and "group 2." You conduct the analysis and only reveal the labels at the very end. This makes it impossible to subconsciously nudge the results toward your desired outcome.

Image by Editor | ChatGPT
Closing Thought
Data doesn't speak for itself; it speaks through the lens of the person analyzing it. Confirmation bias is a powerful filter that can color that lens without us ever realizing it. Our job as data professionals is not to find evidence that proves we are right, but to follow the evidence to find out what is right. By building awareness and adopting disciplined analytical habits, we can ensure our work illuminates the truth, rather than just reflecting our own assumptions.
