<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Statistics on kenji.blog</title><link>http://kenji.blog/en/categories/statistics/</link><description>Recent content in Statistics on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Thu, 10 Sep 2026 21:00:00 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/categories/statistics/index.xml" rel="self" type="application/rss+xml"/><item><title>Does 'Testing Positive' = 'Sick'? The Base Rate Fallacy</title><link>http://kenji.blog/en/p/base-rate-fallacy/</link><pubDate>Thu, 10 Sep 2026 21:00:00 +0900</pubDate><guid>http://kenji.blog/en/p/base-rate-fallacy/</guid><description>&lt;img src="http://kenji.blog/p/base-rate-fallacy/img/base_rate_fallacy.jpg" alt="Featured image of post Does 'Testing Positive' = 'Sick'? The Base Rate Fallacy" />&lt;p>Anyone would panic if they received a &amp;ldquo;positive (abnormal)&amp;rdquo; result on a health checkup or cancer screening.
However, with knowledge of statistics and probability, you might be able to take a deep breath and stay calm. This is because &lt;strong>&amp;ldquo;testing positive on a highly accurate test&amp;rdquo; does not necessarily mean &amp;ldquo;there is a high probability of actually having the disease.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>This is a typical cognitive bias called the &lt;strong>&amp;ldquo;Base Rate Fallacy&amp;rdquo;&lt;/strong> or &amp;ldquo;Base Rate Neglect,&amp;rdquo; where human intuition significantly misjudges probability calculations.&lt;/p>
&lt;h2 id="the-terrifying-health-checkup-problem">The Terrifying Health Checkup Problem
&lt;/h2>&lt;p>Imagine the following situation.&lt;/p>
&lt;p>In a certain town, there is an unknown disease that infects 1 in 10,000 people (0.01%).
To detect this disease, an excellent test kit with &lt;strong>&amp;ldquo;99% accuracy&amp;rdquo;&lt;/strong> has been developed.
(* 99% accuracy means that if a sick person takes the test, there is a 99% chance it will correctly determine &amp;ldquo;positive,&amp;rdquo; and if a healthy person takes the test, there is a 99% chance it will correctly determine &amp;ldquo;negative.&amp;rdquo;)&lt;/p>
&lt;p>You happen to take this test, and the result is &lt;strong>&amp;ldquo;positive.&amp;rdquo;&lt;/strong>
Now, what is the &lt;strong>actual probability that you are infected with this disease&lt;/strong>?&lt;/p>
&lt;p>Many people intuitively answer, &amp;ldquo;Since the test accuracy is 99%, the probability that I am sick must also be 99%.&amp;rdquo;
However, the mathematically correct answer is &lt;strong>&amp;ldquo;about 0.98% (less than 1%).&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>Why on earth does the actual probability become less than 1% even with 99% accuracy?&lt;/p>
&lt;h2 id="bayes-theorem-and-visualizing-the-whole">Bayes&amp;rsquo; Theorem and Visualizing the Whole
&lt;/h2>&lt;p>The key to solving this problem lies in considering not only the accuracy of the test but also &lt;strong>&amp;ldquo;how rare the disease originally is (base rate / prior probability).&amp;rdquo;&lt;/strong>
Let&amp;rsquo;s visualize this counter-intuitive phenomenon using a large population of 1 million people.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Total Population&lt;/strong>: 1,000,000 people&lt;/li>
&lt;li>&lt;strong>Actually Sick People&lt;/strong> (1 in 10,000): 100 people&lt;/li>
&lt;li>&lt;strong>Healthy People&lt;/strong>: 999,900 people&lt;/li>
&lt;/ul>
&lt;p>We administer the &amp;ldquo;99% accurate&amp;rdquo; test to all 1 million of these people.&lt;/p>
&lt;h3 id="1-when-actually-sick-people-100-take-the-test">1. When Actually Sick People (100) Take the Test
&lt;/h3>&lt;p>Since the accuracy is 99%, those correctly determined as &amp;ldquo;positive&amp;rdquo; are:
100 people × 99% = &lt;strong>99 people&lt;/strong> (True Positives)&lt;/p>
&lt;h3 id="2-when-healthy-people-999900-take-the-test">2. When Healthy People (999,900) Take the Test
&lt;/h3>&lt;p>Since the accuracy is 99%, there are people who are incorrectly determined as &amp;ldquo;positive&amp;rdquo; with a 1% probability (false positives):
999,900 people × 1% = &lt;strong>9,999 people&lt;/strong> (False Positives)&lt;/p>
&lt;div class="mermaid">graph TD
A["Total Population (1,000,000 people)"] --> B["Sick People (100 people)"]
A --> C["Healthy People (999,900 people)"]
B -->|99% Correct| B1["True Positives (99 people)"]
B -->|1% Failure| B2["False Negatives (1 person)"]
C -->|99% Correct| C1["True Negatives (989,901 people)"]
C -->|1% Failure| C2["False Positives (9,999 people)"]
B1 -.-> D{"Total Number of People Told 'Positive': 10,098 people"}
C2 -.-> D
style A fill:#ECEFF1,stroke:#333
style B fill:#FFCDD2,stroke:#333
style C fill:#C8E6C9,stroke:#333
style B1 fill:#F44336,stroke:#333,color:#fff
style C2 fill:#FF9800,stroke:#333,color:#fff
style D fill:#FFF9C4,stroke:#333,stroke-width:2px&lt;/div>
&lt;h2 id="the-real-probability-that-you-are-sick">The Real Probability That You Are Sick
&lt;/h2>&lt;p>Now, you have been told by the doctor, &amp;ldquo;You are positive.&amp;rdquo;
This means that you have entered the group &amp;ldquo;Total Number of People Told &amp;lsquo;Positive&amp;rsquo; (10,098 people)&amp;rdquo; at the bottom right of the diagram.&lt;/p>
&lt;p>What is the proportion of &lt;strong>&amp;ldquo;people who are actually sick (True Positives)&amp;rdquo;&lt;/strong> within this group?&lt;/p>
$$ \text{Probability of actually being sick} = \frac{\text{True Positives}}{\text{Everyone told they are positive}} = \frac{99}{99 + 9,999} = \frac{99}{10,098} \approx 0.0098 $$
&lt;p>The calculated result is &lt;strong>about 0.98%&lt;/strong>.
Despite being told &amp;ldquo;positive,&amp;rdquo; the probability that you are healthy (False Positive) is overwhelmingly higher (about 99%).&lt;/p>
&lt;h2 id="why-does-intuition-make-mistakes">Why Does Intuition Make Mistakes?
&lt;/h2>&lt;p>This phenomenon is mathematically explained by &lt;strong>&amp;ldquo;Bayes&amp;rsquo; Theorem,&amp;rdquo;&lt;/strong> which calculates conditional probability, but the human brain is very poor at this calculation.&lt;/p>
&lt;p>The reason we make mistakes is that we are distracted by the specific, intense information provided right in front of us (&amp;ldquo;Your test result is positive! The accuracy is 99%!&amp;rdquo;), and we ignore the vast, boring statistical background data (&amp;ldquo;In the first place, only 1 in 10,000 people has this disease (base rate)&amp;rdquo;).&lt;/p>
&lt;p>&lt;strong>Because the &amp;ldquo;rarity of the disease (0.01%)&amp;rdquo; is much more extreme than the &amp;ldquo;inaccuracy of the test (1%),&amp;rdquo; the slight testing errors quickly swallow up the actual number of sick people.&lt;/strong>&lt;/p>
&lt;h2 id="the-base-rate-fallacy-hidden-in-society">The &amp;ldquo;Base Rate Fallacy&amp;rdquo; Hidden in Society
&lt;/h2>&lt;p>This illusion causes panic and incorrect judgments not only in medical care but in various situations.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Facial Recognition Systems and Terrorists&lt;/strong>:
Even if a facial recognition camera with 99.9% accuracy finds a &amp;ldquo;terrorist&amp;rdquo; at an airport, because the base probability of terrorists is extremely low, almost everyone caught will be innocent civilians with similar faces (False Positives).&lt;/li>
&lt;li>&lt;strong>Traffic Accidents and Elderly Drivers&lt;/strong>:
Even if you feel it&amp;rsquo;s dangerous seeing news that &amp;ldquo;XX% of cars that caused accidents were driven by elderly people,&amp;rdquo; unless you consider the &amp;ldquo;proportion of elderly people among all drivers on the road in the first place (base rate),&amp;rdquo; you cannot know if a specific age group is truly more prone to causing accidents.&lt;/li>
&lt;/ul>
&lt;p>The &amp;ldquo;Base Rate Fallacy&amp;rdquo; teaches us the importance of statistical thinking: especially when we see shocking numbers or individual cases, we should step back and consider &lt;strong>&amp;ldquo;how likely is that to happen within the whole in the first place (base rate).&amp;rdquo;&lt;/strong>&lt;/p></description></item><item><title>Simpson's Paradox: The Mysterious Phenomenon of Winning in the Parts but Losing in the Whole</title><link>http://kenji.blog/en/p/simpsons-paradox/</link><pubDate>Thu, 10 Sep 2026 07:00:00 +0900</pubDate><guid>http://kenji.blog/en/p/simpsons-paradox/</guid><description>&lt;img src="http://kenji.blog/p/simpsons-paradox/img/simpsons_paradox.jpg" alt="Featured image of post Simpson's Paradox: The Mysterious Phenomenon of Winning in the Parts but Losing in the Whole" />&lt;h2 id="1-which-hospital-should-you-get-surgery-at">1. Which hospital should you get surgery at?
&lt;/h2>&lt;p>You have fallen seriously ill and must undergo surgery.
Before you, there are two choices: Hospital A and Hospital B. You requested the &amp;ldquo;success rate&amp;rdquo; data for surgeries at each hospital.&lt;/p>
&lt;p>&lt;strong>[Overall Success Rate]&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A&lt;/strong>: 900 out of 1000 people succeeded (Success rate &lt;strong>90%&lt;/strong>)&lt;/li>
&lt;li>&lt;strong>Hospital B&lt;/strong>: 800 out of 1000 people succeeded (Success rate &lt;strong>80%&lt;/strong>)&lt;/li>
&lt;/ul>
&lt;p>Looking at this, anyone would think &amp;ldquo;Hospital A is better!&amp;rdquo;
However, since you have a cautious personality, you decided to investigate in more detail how the data changes depending on the state of the disease (mild or severe).&lt;/p>
&lt;p>&lt;strong>[Success Rate for Mild Patients]&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A&lt;/strong>: 99 out of 100 people succeeded (Success rate &lt;strong>99%&lt;/strong>)&lt;/li>
&lt;li>&lt;strong>Hospital B&lt;/strong>: 870 out of 900 people succeeded (Success rate &lt;strong>96%&lt;/strong>)
$\rightarrow$ For mild cases, &lt;strong>Hospital A wins (99% &amp;gt; 96%)&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>[Success Rate for Severe Patients]&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A&lt;/strong>: 801 out of 900 people succeeded (Success rate &lt;strong>89%&lt;/strong>)&lt;/li>
&lt;li>&lt;strong>Hospital B&lt;/strong>: 70 out of 100 people succeeded (Success rate &lt;strong>70%&lt;/strong>)
$\rightarrow$ Even for severe cases, &lt;strong>Hospital A wins (89% &amp;gt; 70%)&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>Wait? Don&amp;rsquo;t you think something is strange?&lt;/p>
&lt;p>For &amp;ldquo;mild&amp;rdquo; patients, Hospital A has a higher success rate.
For &amp;ldquo;severe&amp;rdquo; patients, Hospital A has a higher success rate.
And yet, when you calculate the &amp;ldquo;overall&amp;rdquo; success rate for all patients combined&amp;hellip;?&lt;/p>
&lt;ul>
&lt;li>Hospital A Overall: $(99 + 801) / 1000 =$ &lt;strong>90%&lt;/strong>&lt;/li>
&lt;li>Hospital B Overall: $(870 + 70) / 1000 =$ &lt;strong>94%&lt;/strong>&amp;hellip; Wait, according to the previous calculation, wasn&amp;rsquo;t it &lt;strong>80%?&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>Wait a minute, let&amp;rsquo;s look at the first data again.
The first data was like this.&lt;/p>
&lt;ul>
&lt;li>Hospital A Overall Success Rate: &lt;strong>90%&lt;/strong>&lt;/li>
&lt;li>Hospital B Overall Success Rate: &lt;strong>80%&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>However, if we recalculate using the broken-down data,
Hospital B&amp;rsquo;s overall success rate should be $(870 + 70) / 1000 = 940 / 1000 = $ &lt;strong>94%&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>&amp;hellip;Well, you&amp;rsquo;ve been fooled!&lt;/strong>
Actually, this trick of numbers is exactly the terrifying trap of statistics that we will explain this time.
Let me show you the correct data once more.&lt;/p>
&lt;hr>
&lt;h2 id="2-to-you-who-were-fooled-the-real-data">2. To you who were fooled: The real data
&lt;/h2>&lt;p>&lt;strong>[Success Rate for Mild Patients]&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A&lt;/strong>: 870 out of 900 people succeeded (Success rate &lt;strong>96%&lt;/strong>)&lt;/li>
&lt;li>&lt;strong>Hospital B&lt;/strong>: 99 out of 100 people succeeded (Success rate &lt;strong>99%&lt;/strong>)
$\rightarrow$ For mild cases, &lt;strong>Hospital B wins (99% &amp;gt; 96%)&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>[Success Rate for Severe Patients]&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A&lt;/strong>: 30 out of 100 people succeeded (Success rate &lt;strong>30%&lt;/strong>)&lt;/li>
&lt;li>&lt;strong>Hospital B&lt;/strong>: 315 out of 900 people succeeded (Success rate &lt;strong>35%&lt;/strong>)
$\rightarrow$ Even for severe cases, &lt;strong>Hospital B wins (35% &amp;gt; 30%)&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>In other words, whether mild or severe, &lt;strong>Hospital B is overwhelmingly superior&lt;/strong>.&lt;/p>
&lt;p>Now, let&amp;rsquo;s combine this into an &amp;ldquo;overall&amp;rdquo; figure.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Hospital A Overall&lt;/strong>: $(870 + 30) / (900 + 100) = 900 / 1000 =$ &lt;strong>Success rate 90%&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Hospital B Overall&lt;/strong>: $(99 + 315) / (100 + 900) = 414 / 1000 =$ &lt;strong>Success rate 41%&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>Surprisingly, even though Hospital B wins in everything when looking at the &amp;ldquo;parts&amp;rdquo;, Hospital A overwhelmingly wins when combining into the &amp;ldquo;whole&amp;rdquo;!
This is the phenomenon known as &lt;strong>&amp;ldquo;Simpson&amp;rsquo;s Paradox&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;div class="mermaid">graph TD
subgraph "Partial data (B wins)"
Light["Mild: Hospital B wins (99% > 96%)"]
Heavy["Severe: Hospital B wins (35% > 30%)"]
end
subgraph "Overall data (A wins)"
Total["Overall sum: Hospital A overwhelmingly wins (90% > 41%)"]
end
Light -->|Summing them up somehow reverses the result| Total
Heavy -->|Summing them up somehow reverses the result| Total
style Total fill:#ff9999,stroke:#333,stroke-width:2px&lt;/div>
&lt;hr>
&lt;h2 id="3-why-does-this-bizarre-reversal-occur">3. Why does this bizarre reversal occur?
&lt;/h2>&lt;p>The true nature of this paradox lies in &lt;strong>&amp;ldquo;bias in the denominator (population size)&amp;rdquo;&lt;/strong> and &lt;strong>&amp;ldquo;hidden variables (confounding factors)&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;p>Look closely at the data.&lt;/p>
&lt;ul>
&lt;li>Hospital A accepts &lt;strong>a massive number of &amp;ldquo;mild patients who are easy to cure&amp;rdquo; (900 people)&lt;/strong>.&lt;/li>
&lt;li>Hospital B accepts &lt;strong>a massive number of &amp;ldquo;severe patients who are difficult to cure&amp;rdquo; (900 people)&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;p>Because Hospital B has highly skilled doctors, it was like a &amp;ldquo;last resort&amp;rdquo; hospital taking in many difficult severe patients turned away by others. Naturally, the success rate for severe patients is lower (35%). Hospital B&amp;rsquo;s &amp;ldquo;overall success rate&amp;rdquo; was dragged down by the low success rate of this massive number of severe patients, making it appear lower overall (41%).&lt;/p>
&lt;p>Conversely, since Hospital A handles mostly simple mild patients, its overall success rate appeared high (90%), but when compared under the same conditions (severe vs. severe, mild vs. mild), its skills were inferior to Hospital B.&lt;/p>
&lt;p>Expressed in mathematical formulas, the cause is the property of adding fractions.
In general, even if $\frac{a}{b} &lt; \frac{A}{B}$ and $\frac{c}{d} &lt; \frac{C}{D}$,
&lt;/p>
$$ \frac{a+c}{b+d} &lt; \frac{A+C}{B+D} $$
&lt;p>
does not always hold true. When the sizes of the denominators are extremely different, the direction of the inequality sign can reverse.&lt;/p>
&lt;hr>
&lt;h2 id="4-simpsons-paradox-occurring-in-the-real-world">4. &amp;ldquo;Simpson&amp;rsquo;s Paradox&amp;rdquo; occurring in the real world
&lt;/h2>&lt;p>This paradox is not merely an arithmetic puzzle; it frequently occurs in real society and has sparked major controversies.&lt;/p>
&lt;h3 id="the-1973-uc-berkeley-gender-bias-suspicions">The 1973 UC Berkeley Gender Bias Suspicions
&lt;/h3>&lt;p>When investigating the admission rates for graduate school at UC Berkeley, the &amp;ldquo;male admission rate (44%)&amp;rdquo; was significantly higher than the &amp;ldquo;female admission rate (35%)&amp;rdquo;, which became an issue as apparent discrimination against women.
However, when the data was broken down and analyzed &amp;ldquo;by department&amp;rdquo;, an astonishing fact came to light.
In almost all departments, &lt;strong>the admission rate for women was higher than for men&lt;/strong>.&lt;/p>
&lt;p>Why did the overall numbers reverse?
Actually, women applied in large numbers to &amp;ldquo;departments with low admission rates (highly competitive)&amp;rdquo;, while men applied in large numbers to &amp;ldquo;departments with high admission rates (easier to get into)&amp;rdquo;.&lt;/p>
&lt;h3 id="efficacy-data-of-covid-19-vaccines">Efficacy Data of COVID-19 Vaccines
&lt;/h3>&lt;p>There was a time when data circulated stating &amp;ldquo;people who received the vaccine have a higher mortality rate than those unvaccinated&amp;rdquo;, which caused an uproar.
This was also the result of ignoring data by age group (a hidden variable).
Because the vaccine was prioritized for &amp;ldquo;the elderly (who inherently have a higher mortality rate)&amp;rdquo;, simply summing up the overall mortality rate caused an extreme skew of elderly people in the vaccinated group, making the mortality rate appear artificially higher.&lt;/p>
&lt;p>When comparing by age group, it was confirmed that &amp;ldquo;people who received the vaccine had a lower mortality rate&amp;rdquo; in all age groups.&lt;/p>
&lt;hr>
&lt;h2 id="5-conclusion-data-doesnt-lie-but-people-can-lie-with-data">5. Conclusion: Data doesn&amp;rsquo;t lie, but people can lie with data
&lt;/h2>&lt;p>Simpson&amp;rsquo;s Paradox warns of &lt;strong>&amp;ldquo;the danger of making judgments based solely on overall data like averages or totals&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;p>The world is overflowing with companies, politicians, and media that cherry-pick only &amp;ldquo;overall numbers&amp;rdquo; to appeal in ways convenient to them.
Even if told &amp;ldquo;Our Product A has higher overall satisfaction than Competitor&amp;rsquo;s Product B!&amp;rdquo;, if you break it down into &amp;ldquo;young demographics&amp;rdquo; and &amp;ldquo;elderly demographics&amp;rdquo;, Competitor&amp;rsquo;s Product B might be winning in both groups.&lt;/p>
&lt;p>When looking at data, having a skeptical eye that doesn&amp;rsquo;t get fooled by superficial &amp;ldquo;overall&amp;rdquo; numbers and asks, &amp;ldquo;Is there an extreme bias in the proportion of groups due to variables hidden behind (age, gender, severity, etc.)?&amp;rdquo; becomes the strongest weapon for surviving the modern information society.&lt;/p></description></item></channel></rss>