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

作者: cybergenie ((不要看這裏))   2022-06-01 16:19:43
※ 引述《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 非常優秀,世界怎麼跟得
上台灣。

本文証明了其實世界有71個國家可以跟上台灣。

八卦:依照同樣算法,中國的每百萬人死亡率是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'])]
檢驗一下台灣部份的數據:

每日(每十萬人口)全人口七日移動發生率加總後之平均值為45.732837,四捨五入至整數
後為46,每日(每百萬人口)全人口七日移動死亡率加總後之平均值為0.239664,四捨五
入至小數點後一位為46。與台灣防疫中心數據相符。
接下來,列出台灣防疫中心手版中所選定的國家:

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

依照陳時中部長邏輯,這兩個數字愈小愈好。我們來看看台灣防疫是否真為世界第一?
世界是否真的跟不上台灣?
先從每日(每十萬人口)全人口七日移動發生率加總後之平均值開始
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')

看來還真是不少。這世界有救了。那俱體有哪些國家呢?
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')

全世界至少有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')

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')

全世界有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']

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

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

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

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

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

Links booklink

Contact Us: admin [ a t ] ucptt.com