PTT推薦

Re: [問卦] 台灣新冠死亡率百萬分之0.2的計算方法?

看板Gossiping標題Re: [問卦] 台灣新冠死亡率百萬分之0.2的計算方法?作者
cybergenie
()
時間推噓 5 推:7 噓:2 →:9

※ 引述《bendee (李)》之銘言:
: 不知道大家有沒有看到下面這則新聞,
: 阿中部長說台灣新冠死亡發生率是百萬分之0.2,想請問這數字是怎麼算出來的啊?
: 隨著本土染疫人數升高,國內曾出現幾天單日死亡率破千分之1,引來各界關注。針對台: 灣死亡率是否高於其他國家,中央流行疫情指揮官陳時中31日秀出數字,強調台灣目前死: 亡發生率是每百萬分之0.2,低於日本和新加坡的0.6,也低於紐西蘭1.4、南韓2.4、香港: 8.3,與其他國家相比沒有比較高。
: ※ 八卦板務請到 GossipPicket 檢舉板實名詢問
: ※ a.張貼問卦請注意,充實文章內容、是否有專板,本板並非萬能問板。
: ※ b.一天只能張貼 "兩則" 問卦,自刪及被刪也算兩篇之內,
: ※ 超貼者將被水桶,請注意!
: ※ c.本看板嚴格禁止政治問卦,發文問卦前請先仔細閱讀相關板規。
: ※ d.未滿30繁體中文字水桶3個月,嚴重者以鬧板論,請注意!
: ※ (↑看完提醒請刪除ctrl + y)

就是啊,宅宅我閒來無事,來幫台灣防疫中心以及未來的台北市長甚至總統,偉大的
clock陳作點驗算工作。

直接講重點:依陳時中所言,台灣每百萬人平均死亡率為 0.2 非常優秀,世界怎麼跟得上台灣。
https://imgur.com/9kxBc6V

本文証明了其實世界有71個國家可以跟上台灣。
https://imgur.com/8TnZYcM

八卦:依照同樣算法,中國的每百萬人死亡率是0.002743,比台灣強一百倍左右。


先作點準備工作

import seaborn as sns
import pandas as pd
from matplotlib import pyplot


我們使用OWID提供的資料。可至
https://ourworldindata.org/coronavirus#explore-the-global-situation 下載

df = pd.read_csv('owid-covid-data.csv')


首先,先將非國家地區資料去除。

loc_list = list(set(df[pd.notnull(df['continent'])]['location'].to_list()))


接下來,我們使用與台灣防疫中心一樣的方式,計算
一,1/1-5/29期間,每日(每十萬人口)全人口七日移動發生率加總後之平均值
二,1/1-5/29期間,每日(每百萬人口)全人口七日移動死亡率加總後之平均值

new_cases_smoothed_per_million = []
new_deaths_smoothed_per_million = []
for l in loc_list:
df1 = df[(df['location']==l) & (pd.to_datetime(df['date'])>=pd.Timestamp(2022,1,1))& (pd.to_datetime(df['date'])<=pd.Timestamp(2022,5,29))]
new_cases_smoothed_per_million.append(df1['new_cases_smoothed_per_million'].mean()/10)
new_deaths_smoothed_per_million.append(df1['new_deaths_smoothed_per_million'].mean())


將上述兩結果製成表格。

res_df = pd.DataFrame({'location': loc_list, 'new_cases_smoothed_per_million': new_cases_smoothed_per_million, 'new_deaths_smoothed_per_million': new_deaths_smoothed_per_million})
res_df = res_df[pd.notnull(res_df['new_cases_smoothed_per_million']) & pd.notnull(res_df['new_deaths_smoothed_per_million'])]


檢驗一下台灣部份的數據:

https://imgur.com/n5W3alM


每日(每十萬人口)全人口七日移動發生率加總後之平均值為45.732837,四捨五入至整數後為46,每日(每百萬人口)全人口七日移動死亡率加總後之平均值為0.239664,四捨五入至小數點後一位為46。與台灣防疫中心數據相符。

接下來,列出台灣防疫中心手版中所選定的國家:

https://imgur.com/BPdMC8g


接下來,列出台灣防疫中心手版中所選的國家,數據大致相符。除了New Zealand與
Singapore每日(每十萬人口)全人口七日移動發生率加總後之平均值略有出入
(147<->153與124<->111),俱體原因未知。

https://imgur.com/BPdMC8g


依照陳時中部長邏輯,這兩個數字愈小愈好。我們來看看台灣防疫是否真為世界第一?
世界是否真的跟不上台灣?

先從每日(每十萬人口)全人口七日移動發生率加總後之平均值開始

fig, ax = pyplot.subplots(figsize=(10,40))
sns.barplot(ax=ax, x="new_cases_smoothed_per_million", y="location", data=res_df.sort_values(by='new_cases_smoothed_per_million'))
fig.savefig('new_cases_smoothed_per_million.png')

https://imgur.com/TSIaG4d


看來還真是不少。這世界有救了。那俱體有哪些國家呢?

tw_record = res_df[res_df['location']=='Taiwan']['new_cases_smoothed_per_million'].to_numpy()[0]
res_df[res_df['new_cases_smoothed_per_million']<tw_record][['location','new_cases_smoothed_per_million']].sort_values(by='new_cases_smoothed_per_million')

https://imgur.com/9oendpJ


全世界至少有133個國家在每日(每十萬人口)全人口七日移動發生率加總後之平均值這一項上是比台灣還優。那俱體有哪些國家呢?

res_df[res_df['new_cases_smoothed_per_million']<tw_record]['location'].to_list()

['South Sudan', 'Armenia', 'Fiji', 'Paraguay', 'Uzbekistan', 'Mexico', 'Guinea-Bissau', 'Laos', 'United Arab Emirates', 'El Salvador', 'Central African Republic', 'Gabon', 'Colombia', 'Malaysia', 'Cuba', 'Niger', 'Algeria', 'Kiribati', 'Kazakhstan', 'Malawi', 'Guatemala', 'Saint Vincent and the Grenadines', 'Bulgaria', 'Bosnia and Herzegovina', 'Togo', 'Madagascar', 'Poland', 'Wallis and Futuna', 'Eswatini', 'Kosovo', 'Mauritania', 'Jamaica', 'Nepal', 'Rwanda', 'Saint
Kitts and Nevis', 'Mozambique', 'Zambia', 'Botswana', 'Lebanon', 'Moldova', 'Japan', 'Romania', 'Burundi', 'Azerbaijan', 'Congo', 'Tajikistan', 'Guyana', 'Afghanistan', 'Saudi Arabia', 'Belize', 'North Korea', 'Palestine', 'Philippines', 'Uganda', 'Papua New Guinea', 'Sierra Leone', 'Tunisia', 'China', 'Cape Verde', 'Lesotho', 'Costa Rica', 'North Macedonia', 'Sudan', 'Bolivia', 'Samoa', 'Somalia', 'Suriname', 'Trinidad and Tobago', 'Liberia', 'Eritrea',
'Bangladesh', 'Haiti', 'Kenya', 'Sao Tome and Principe', 'Turkey', 'South Africa', 'India', 'Pakistan', 'Oman', 'Belarus', 'Vanuatu', 'Egypt', 'Saint Lucia', 'Democratic Republic of Congo', 'Thailand', 'Benin', 'Angola', 'Namibia', 'Senegal', 'Brazil', 'Peru', 'Antigua and Barbuda', 'Gambia', 'Sri Lanka', 'Nicaragua', 'Djibouti', 'Guinea', 'Nigeria', 'Libya', 'Solomon Islands', 'Kyrgyzstan', 'Iraq', 'Venezuela', 'Ethiopia', 'Canada', 'Chad', 'Ghana', 'Zimbabwe',
'Honduras', 'Tanzania', 'Cambodia', 'Ecuador', 'Indonesia', 'Jordan', 'Morocco', 'Mali', 'Syria', 'Ukraine', 'Qatar', 'Albania', 'Russia', 'Comoros', 'Timor', "Cote d'Ivoire", 'Iran', 'Burkina Faso', 'Dominican Republic', 'Equatorial Guinea', 'Yemen', 'Myanmar', 'Kuwait', 'Bahamas', 'Cameroon']


接下來看看陳時中部長引以為豪的「百萬分之0.2」,有哪些國家表現比台灣更好呢?

fig, ax = pyplot.subplots(figsize=(10,40))
sns.barplot(ax=ax, x="new_deaths_smoothed_per_million", y="location", data=res_df.sort_values(by='new_deaths_smoothed_per_million'))
fig.savefig('new_deaths_smoothed_per_million.png')

https://imgur.com/8TnZYcM

tw_record = res_df[res_df['location']=='Taiwan']['new_deaths_smoothed_per_million'].to_numpy()[0]
res_df[res_df['new_deaths_smoothed_per_million']<tw_record][['location','new_deaths_smoothed_per_million']].sort_value(by='new_deaths_smoothed_per_million')

https://imgur.com/x9pwdDJ


全世界有71個國家可以跟得上台灣

res_df[res_df['new_deaths_smoothed_per_million']<tw_record][['location','new_deaths_smoothed_per_million']].sort_values(by='new_deaths_smoothed_per_million')['location'].to_list()

['Burundi', 'Wallis and Futuna', 'Tajikistan', 'Djibouti', 'Benin', 'Sierra Leone', 'South Sudan', 'China', 'Nigeria', 'Chad', 'Liberia', 'Niger', 'Democratic Republic of Congo', 'Somalia', 'Tanzania', 'Central African Republic', 'Cambodia', 'Cameroon', 'Burkina Faso', 'Nicaragua', 'Togo', 'Congo', 'Myanmar', "Cote d'Ivoire", 'Mali', 'Guinea', 'Angola', 'Uzbekistan', 'Ethiopia', 'Ghana', 'Kenya', 'Yemen', 'Equatorial Guinea', 'Senegal', 'Bangladesh', 'Pakistan',
'Timor', 'Uganda', 'Papua New Guinea', 'Mozambique', 'Gabon', 'Saudi Arabia', 'Eritrea', 'Comoros', 'Rwanda', 'Afghanistan', 'Gambia', 'Guinea-Bissau', 'Haiti', 'Nepal', 'North Korea', 'Dominican Republic', 'Madagascar', 'Algeria', 'Venezuela', 'Zambia', 'United Arab Emirates', 'Syria', 'Malawi', 'Lesotho', 'Cuba', 'Kuwait', 'Qatar', 'Bhutan', 'Mauritania', 'Iraq', 'Oman', 'Kyrgyzstan', 'Egypt', 'India', 'Morocco']


看來這些國家的防疫策略真值得我們學習呢。來節錄幾個重點國家

res_df[res_df['location']=='China']

https://imgur.com/LIRKLpr

res_df[res_df['location']=='India']

https://imgur.com/JGaUs0s

res_df[res_df['location']=='Madagascar']

https://imgur.com/brvgU0V

res_df[res_df['location']=='Ethiopia']

https://imgur.com/xwQjOYt

res_df[res_df['location']=='North Korea']

https://imgur.com/T5IXcrO


請問,這樣我有資格加入五漢報時台了嗎?

--

※ PTT留言評論
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 172.58.25.79 (美國)
PTT 網址

YO0779Y 06/01 16:22寫三小 看不懂

memory2007 06/01 16:29準了 你立刻報到

bbaad 06/01 16:36同路人

psykl 06/01 16:39認真推

eggeggyayaya 06/01 16:40太專業塔綠班不懂

jerry7668 06/01 16:53直接上色 china 保證有人氣

好建議 XD

Piin 06/01 16:56結論就是指揮中心這個數字根本不值得參考

是的。

wastetheone 06/01 17:15不是阿,你把落落長的程式碼貼上來幹

wastetheone 06/01 17:16嘛,誰管你程式怎麼跑的,重點只在

wastetheone 06/01 17:16有沒有隱匿疫情或是醫療崩潰,失真

wastetheone 06/01 17:16的數字不能用,就這樣而已

我爽

harukay08 06/01 17:32太認真了推

sunwardmud 06/01 17:38分母是2300萬人?

應該是。資料庫中沒有這資訊。

yitniya 06/01 19:49太認真,這樣塔綠班會直接老羞成怒

urldream 06/01 20:19大致看懂這數據是怎麼算的了,但為什麼

urldream 06/01 20:19不直接用1/1至今的總死亡數除以總人口

urldream 06/01 20:19數不是更簡單嗎?

別搞了。你以為正好找到這些國家,正好找到這個時間範圍來突顯台灣好棒棒是件容易的 事嗎?

sungtau 06/01 20:50CDC就是令人感到噁心

※ 編輯: cybergenie (75.80.143.61 美國), 06/02/2022 01:10:10