辛普森悖論_所謂的辛普森悖論

辛普森悖論

We all know the Simpsons family from Disneyland, but have you heard about the Simpson’s Paradox from statistic theory? This article will illustrate the definition of Simpson’s Paradox with an example, and show you how can it harm your statistical tests and analysis.

我們都知道迪斯尼樂園的辛普森一家,但您是否從統計理論中聽說過辛普森悖論? 本文將通過一個示例說明Simpson's Paradox的定義,并向您展示它如何危害您的統計測試和分析。

What is Simpson’s Paradox?

什么是辛普森悖論?

Simpson’s paradox refers to the situations in which a trend or relationship that is observed within multiple groups disappears or reverses when the groups are combined. The quick answer to why there is Simpson's paradox is the existence of confounding variables. I will illustrate it with the example below.

辛普森悖論是指當組合在一起時,在多個組中觀察到的趨勢或關系消失或逆轉的情況。 為何存在辛普森悖論的快速答案是存在混雜變量。 我將通過以下示例進行說明。

An example of Simpson’s Paradox

辛普森悖論的一個例子

Let’s take a simple example from a study analyzing the mortality rate difference between smokers and non-smokers, which was conducted by Appleton, French, and Vanderpump in 1996. Here is the data they have collected in the study:

讓我們舉一個簡單的例子,該研究是由Appleton,French和Vanderpump于1996年進行的一項分析吸煙者和非吸煙者之間的死亡率差異的研究。以下是他們在研究中收集的數據:

Image for post
the mortality rate for smokers and non-smokers
吸煙者和非吸煙者的死亡率

One would expect the mortality rate to be higher for smokers compared to non-smokers due to the harm caused by smoking. However, the data shows that the mortality rate is higher for non-smokers. The relationship is better represented here:

人們會認為,由于吸煙造成的危害,與不吸煙者相比,吸煙者的死亡率更高。 但是,數據顯示,非吸煙者的死亡率較高。 該關系在這里可以更好地表示:

Image for post
mortality rate chart
死亡率表

The grey line in the chart represents the mortality rate, and it is higher for non-smokers. Why is that? Let’s bring down the data into multiple groups by ages:

圖表中的灰線代表死亡率,非吸煙者死亡率更高。 這是為什么? 讓我們按年齡將數據分為多個組:

Image for post

Here is the chart plotting the mortality rate by age groups and by smoking or not:

這是按年齡組和吸煙與否繪制死亡率的圖表:

Image for post

The chart shows that in the dataset, the mortality rate increase as age increases for both smokers and non-smokers. It is reasonable to conclude that age is positively correlated with the mortality rate, no matter by the evidence from this data, or from common sense.

圖表顯示,在數據集中,吸煙者和非吸煙者的死亡率都隨著年齡的增長而增加。 可以合理地得出結論,無論是根據該數據還是常識,年齡與死亡率呈正相關。

In the meantime, if we compare the smoking rate across different age groups, as the chart presented below:

同時,如果我們比較不同年齡段的吸煙率,如下圖所示:

Image for post

There are more smokers than non-smokers for all age groups except 65–74, and 75+. 27% of the non-smokers are older than 65, and only 8% of the smokers are older than 65. Thus, the chart shows that the age distributions are substantially different between smokers and non-smokers. The smoking population is younger than the non-smoking population from the data. In other words, age is negatively correlated with the probability of being in the smoking group or not.

除了65-74歲和75歲以上的年齡段外,所有年齡段的吸煙者都比不吸煙者多。 27%的不吸煙者年齡在65歲以上,只有8%的吸煙者年齡在65歲以上。因此,圖表顯示,吸煙者與不吸煙者之間的年齡分布存在很大差異。 根據數據,吸煙人口比非吸煙人口年輕。 換句話說,年齡與是否參加吸煙組負相關。

The previous evidence supports the statement that when we examine the relationship between smoking and mortality rate, we cannot ignore age, which is called a confounding variable(or a lurking variable). Age is positively correlated with mortality rate but is negatively correlated with smoking. Older groups have a higher mortality rate, but fewer of them are smokers. Thus, a greater proportion of older non-smokers, with a 100% mortality rate in this dataset, pushes up the average mortality rate for the non-smoker group. That is why we observe that the mortality rate is lower for the non-smokers across all age groups, but it is higher in the non-smoker group when we combine all groups together. This example perfectly illustrates what is Simpson’s Paradox, and why it happens.

先前的證據支持這樣的說法:當我們檢查吸煙與死亡率之間的關系時,我們不能忽略年齡,這被稱為混雜變量(或潛伏變量)。 年齡與死亡率呈正相關,但與吸煙呈負相關。 年齡較大的人群死亡率較高,但吸煙者較少。 因此,在此數據集中具有較高死亡率的年齡較大的不吸煙者比例為100%,從而推高了不吸煙者群體的平均死亡率。 這就是為什么我們觀察到所有年齡段的不吸煙者的死亡率都較低,但將所有年齡段的人群合并在一起,則不吸煙者的死亡率較高。 這個例子完美地說明了什么是辛普森悖論,以及它為什么發生。

How to deal with Simpson’s Paradox?

如何應對辛普森悖論?

Now we know what and why, it is time to know how to fix it. Simpson’s Paradox can cause great harm for statistical analyses or tests because of the reversed or insignificant relationship when ignoring the confounding variables. Thus, the way to deal with Simpson’s Paradox is to find the confounding variable and control it during your analysis. Take the previous data as an example, you cannot jump to the conclusion that non-smokers have a higher mortality rate thus smoking is good for health, when you are only observing the results from group averages. Breaking down the data into different age groups will give you a better understanding of the relationship.

現在我們知道了什么以及為什么,現在該知道如何修復它了。 辛普森悖論可能會給統計分析或測試造成極大傷害,因為當忽略混淆變量時,它們之間的關系相反或無關緊要。 因此,處理辛普森悖論的方法是找到混淆變量,并在分析過程中對其進行控制。 以以前的數據為例,當您僅觀察小組平均值的結果時,您無法得出結論,即非吸煙者的死亡率較高,因此吸煙有益于健康。 將數據分為不同年齡段可以使您更好地了解這種關系。

Hope this article helps you understand Simpson’s Paradox. Thank you for reading!

希望本文能幫助您理解辛普森悖論。 感謝您的閱讀!

翻譯自: https://medium.com/the-innovation/the-so-called-simpsons-paradox-6d0efdca6fdc

辛普森悖論

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/389939.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389939.shtml
英文地址,請注明出處:http://en.pswp.cn/news/389939.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

查看NVIDIA使用率工具目錄

2019獨角獸企業重金招聘Python工程師標準>>> C:\Program Files\NVIDIA Corporation\Display.NvContainer\NVDisplay.Container.exe 轉載于:https://my.oschina.net/u/2430809/blog/1927560

2043. 簡易銀行系統

2043. 簡易銀行系統 你的任務是為一個很受歡迎的銀行設計一款程序,以自動化執行所有傳入的交易(轉賬,存款和取款)。銀行共有 n 個賬戶,編號從 1 到 n 。每個賬號的初始余額存儲在一個下標從 0 開始的整數數組 balance…

余弦相似度和歐氏距離_歐氏距離和余弦相似度

余弦相似度和歐氏距離Photo by Markus Winkler on UnsplashMarkus Winkler在Unsplash上拍攝的照片 This is a quick and straight to the point introduction to Euclidean distance and cosine similarity with a focus on NLP.這是對歐氏距離和余弦相似度的快速而直接的介紹&…

bzoj2152 聰聰可可

題目描述 聰聰和可可是兄弟倆,他們倆經常為了一些瑣事打起來,例如家中只剩下最后一根冰棍而兩人都想吃、兩個人都想玩兒電腦(可是他們家只有一臺電腦)……遇到這種問題,一般情況下石頭剪刀布就好了,可是他們…

七、 面向對象(二)

匿名類對象 創建的類的對象是匿名的。當我們只需要一次調用類的對象時,我們就可以考慮使用匿名的方式創建類的對象。特點是創建的匿名類的對象只能夠調用一次! package day007;//圓的面積 class circle {double radius;public double getArea() {// TODO…

機器學習 客戶流失_通過機器學習預測流失

機器學習 客戶流失介紹 (Introduction) This article is part of a project for Udacity “Become a Data Scientist Nano Degree”. The Jupyter Notebook with the code for this project can be downloaded from GitHub.本文是Udacity“成為數據科學家納米學位”項目的一部分…

2044. 統計按位或能得到最大值的子集數目

2044. 統計按位或能得到最大值的子集數目 給你一個整數數組 nums ,請你找出 nums 子集 按位或 可能得到的 最大值 ,并返回按位或能得到最大值的 不同非空子集的數目 。 如果數組 a 可以由數組 b 刪除一些元素(或不刪除)得到&…

redis系列:分布式鎖

1 介紹 這篇博文講介紹如何一步步構建一個基于Redis的分布式鎖。會從最原始的版本開始,然后根據問題進行調整,最后完成一個較為合理的分布式鎖。 本篇文章會將分布式鎖的實現分為兩部分,一個是單機環境,另一個是集群環境下的Redis…

Qt中的坐標系統

轉載:原野追逐 Qt使用統一的坐標系統來定位窗口部件的位置和大小。 以屏幕的左上角為原點即(0, 0)點,從左向右為x軸正向,從上向下為y軸正向,這整個屏幕的坐標系統就用來定位頂層窗口; 此外,窗口內部也有自己…

預測股票價格 模型_建立有馬模型來預測股票價格

預測股票價格 模型前言 (Preface) If you are reading this, it’s most likely because you love to solve puzzles. I’m a very competitive person by nature. The Mt. Everest of puzzles, in my opinion, is trying to find excess returns through active trading in th…

Python 模塊 timedatetime

time & datetime 模塊 在平常的代碼中,我們常常需要與時間打交道。在Python中,與時間處理有關的模塊就包括:time,datetime,calendar(很少用,不講),下面分別來介紹。 在開始之前,首先要說明幾…

大數模板Java

import java.util.*; import java.math.BigInteger; public class Main{public static void main(String args[]){Scanner cinnew Scanner(System.in);BigInteger a,b;acin.nextBigInteger();bcin.nextBigInteger();System.out.println(a.add(b));//加法System.out.println(a.…

檸檬工會_工會經營者

檸檬工會Hey guys! This week we’ll be going over some ways to work with result sets in MySQL. These result sets are the outputs of your everyday queries, such as:大家好! 本周,我們將介紹一些在MySQL中處理結果集的方法。 這些結果集是您日常…

229. 求眾數 II

229. 求眾數 II 給定一個大小為 n 的整數數組,找出其中所有出現超過 ? n/3 ? 次的元素。 示例 1:輸入:[3,2,3] 輸出:[3]示例 2:輸入:nums [1] 輸出:[1]示例 3:輸入:…

寫給Java開發者看的JavaScript對象機制

幫助面向對象開發者理解關于JavaScript對象機制 本文是以一個熟悉OO語言的開發者視角,來解釋JavaScript中的對象。 對于不了解JavaScript 語言,尤其是習慣了OO語言的開發者來說,由于語法上些許的相似會讓人產生心理預期,JavaScrip…

Pythonic---------詳細講解

作者:半載流殤 鏈接:https://zhuanlan.zhihu.com/p/35219750 來源:知乎 著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。Pythonic,簡言之就是以Python這門語言獨特的方式寫出既簡潔又優美的代碼…

大數據ab 測試_在真實數據上進行AB測試應用程序

大數據ab 測試Hello Everyone!大家好! I am back with another article about Data Science. In this article, I will write about what is A-B testing and how to use it on real life data-set to compare two advertisement methods.我回來了另一篇有關數據科…

492. 構造矩形

492. 構造矩形 作為一位web開發者, 懂得怎樣去規劃一個頁面的尺寸是很重要的。 現給定一個具體的矩形頁面面積,你的任務是設計一個長度為 L 和寬度為 W 且滿足以下要求的矩形的頁面。要求: 你設計的矩形頁面必須等于給定的目標面積。 寬度 …

node:爬蟲爬取網頁圖片

前言 周末自己在家閑著沒事,刷著微信,玩著手機,發現自己的微信頭像該換了,就去網上找了一下頭像,看著圖片,自己就想著作為一個碼農,可以把這些圖片都爬取下來做成一個微信小程序,說干…

如何更好的掌握一個知識點_如何成為一個更好的講故事的人3個關鍵點

如何更好的掌握一個知識點You’re launching a digital transformation initiative in the middle of the ongoing pandemic. You are pretty excited about this big-ticket investment, which has the potential to solve remote-work challenges that your organization fac…