library(here)
library(tidyverse)
library(lubridate)
library(huxtable)
Packages nécessaires
D’où proviennent les données ?
Ces données ont été rassemblées sur le site Our World in Data (Mathieu et al. 2020). Elles s’appuient sur le travail de nombreux chercheurs, notamment Karlinsky et Kobak (2021). Leur production est expliquée en détail sur cette page.
Les télécharger
= here("data", "excess_mortality.rds") excess_mortality_path
read_csv("https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/excess_mortality/excess_mortality.csv") |>
write_rds(excess_mortality_path)
Lire les données
= read_rds(excess_mortality_path) |>
excess_mortality mutate(date = ymd(date)) |>
select(location,
date,
projected_deaths_since_2020_all_ages, excess_proj_all_ages)
Vérifications
Pour certains pays, la périodicité des données est hebdomadaire (ex : Australie, Autriche, Belgique, Colombie, Afrique du Sud, Espagne, Suisse). La mortalité observée est alors renseignée tous les dimanches à compter du 5 janvier 2020. Il y a donc 52 enregistrements pour chaque pays en 2020.
Pour d’autre, la périodicité est mensuelle ( ex : Albanie, Biélorussie, Brésil, Philippines). La mortalité observée est renseignée le dernier jour de chaque mois, à compter du 31 janvier 2020. Il y a donc 12 enregistrements pour chaque pays en 2020, sauf pour le Salvador où il n’y en a que 8. Les dernières données disponibles pour ce pays sont celles du mois d’août 2020.
= excess_mortality |>
periodicity filter(year(date) == 2020,
!is.na(excess_proj_all_ages)) |>
group_by(location) |>
summarise(n = n(),
date_min = min(date),
date_max = max(date))
Deux fonctions simples
= function(date_beginn, date_end) {
summarise_excess_mortality |>
excess_mortality filter(between(date, date_beginn, date_end)) |>
group_by(location) |>
summarise(p_score = sum(excess_proj_all_ages, na.rm = T) /
sum(projected_deaths_since_2020_all_ages, na.rm = T) * 100)
}
= function(data) {
huxtable_excess_mortality |>
data arrange(desc(p_score)) |>
mutate(p_score = round(p_score)) |>
as_huxtable()
}
Classement du 1er mars au 1er juin 2020
= summarise_excess_mortality(ymd(20200301), ymd(20200601)) excess_mortality_spring
|>
excess_mortality_spring huxtable_excess_mortality() |>
theme_blue()
location | p_score |
Ecuador | 109 |
Andorra | 73 |
San Marino | 61 |
Nicaragua | 57 |
Kuwait | 47 |
Peru | 46 |
Mayotte | 46 |
United Arab Emirates | 46 |
Spain | 43 |
United Kingdom | 37 |
Tajikistan | 34 |
Italy | 31 |
Belgium | 28 |
Bermuda | 23 |
Sweden | 20 |
Netherlands | 20 |
Mexico | 19 |
Iran | 18 |
United States | 17 |
Ireland | 17 |
Monaco | 16 |
France | 15 |
Brazil | 15 |
Egypt | 12 |
Saint Vincent and the Grenadines | 11 |
Chile | 10 |
Qatar | 10 |
Canada | 9 |
Switzerland | 8 |
Portugal | 8 |
Cyprus | 7 |
Belarus | 7 |
Russia | 6 |
Saint Kitts and Nevis | 5 |
Lithuania | 4 |
Puerto Rico | 4 |
Austria | 4 |
Albania | 4 |
Guadeloupe | 4 |
Israel | 3 |
North Macedonia | 3 |
Cuba | 3 |
Finland | 3 |
Luxembourg | 2 |
Malta | 2 |
Maldives | 2 |
Singapore | 2 |
Iceland | 2 |
Australia | 1 |
Turkey | 1 |
Greece | 1 |
Aruba | 1 |
Armenia | 1 |
Antigua and Barbuda | 0 |
Algeria | 0 |
Jordan | 0 |
Serbia | 0 |
Norway | 0 |
Estonia | 0 |
Germany | 0 |
Martinique | 0 |
Slovakia | 0 |
Kosovo | -1 |
Paraguay | -1 |
Hungary | -1 |
Azerbaijan | -1 |
Croatia | -2 |
Slovenia | -2 |
Czechia | -2 |
Bolivia | -2 |
Romania | -2 |
Poland | -2 |
Thailand | -2 |
South Korea | -2 |
Denmark | -2 |
Liechtenstein | -3 |
Japan | -3 |
Bosnia and Herzegovina | -3 |
Moldova | -3 |
Georgia | -3 |
Hong Kong | -3 |
French Polynesia | -3 |
New Caledonia | -4 |
Colombia | -4 |
New Zealand | -4 |
Barbados | -4 |
Argentina | -4 |
Brunei | -4 |
Mauritius | -4 |
Reunion | -5 |
Latvia | -5 |
Uruguay | -5 |
Transnistria | -5 |
Bulgaria | -5 |
Bahamas | -5 |
Montenegro | -6 |
Jamaica | -6 |
Cape Verde | -6 |
Lebanon | -6 |
Taiwan | -7 |
Bhutan | -7 |
Palestine | -7 |
Macao | -7 |
Costa Rica | -7 |
Ukraine | -8 |
South Africa | -8 |
Philippines | -8 |
Tunisia | -8 |
Malaysia | -9 |
Uzbekistan | -9 |
Belize | -10 |
Dominican Republic | -10 |
Oman | -11 |
Mongolia | -12 |
Suriname | -12 |
Guatemala | -14 |
Kazakhstan | -18 |
Kyrgyzstan | -19 |
Gibraltar | -21 |
Faroe Islands | -22 |
Panama | -24 |
Seychelles | -26 |
Greenland | -26 |
French Guiana | -27 |
El Salvador | -37 |
England & Wales | NaN |
Northern Ireland | NaN |
Scotland | NaN |
Classement du 1er mars 2020 au 1er mars 2021
= summarise_excess_mortality(ymd(20200301), ymd(20210301)) excess_mortality_2020
|>
excess_mortality_2020 huxtable_excess_mortality() |>
theme_green()
location | p_score |
Peru | 68 |
Ecuador | 60 |
Mexico | 59 |
Bolivia | 57 |
Kuwait | 47 |
Armenia | 42 |
Kosovo | 39 |
Albania | 39 |
Azerbaijan | 36 |
San Marino | 34 |
Nicaragua | 32 |
North Macedonia | 32 |
Andorra | 32 |
Mayotte | 32 |
Iran | 30 |
Colombia | 29 |
Tajikistan | 29 |
Algeria | 27 |
Belarus | 27 |
Panama | 26 |
Lebanon | 26 |
Russia | 26 |
Kazakhstan | 23 |
Slovakia | 23 |
Czechia | 22 |
Kyrgyzstan | 22 |
Egypt | 22 |
South Africa | 22 |
Lithuania | 21 |
Bosnia and Herzegovina | 21 |
United States | 21 |
Liechtenstein | 20 |
Spain | 20 |
Monaco | 20 |
United Kingdom | 19 |
Brazil | 19 |
Moldova | 18 |
Italy | 18 |
Poland | 18 |
Portugal | 18 |
Slovenia | 17 |
Serbia | 17 |
Qatar | 17 |
Jordan | 17 |
Chile | 17 |
Montenegro | 16 |
Bulgaria | 16 |
Turkey | 16 |
Belgium | 16 |
Romania | 16 |
United Arab Emirates | 15 |
Oman | 15 |
Argentina | 15 |
Guatemala | 15 |
Switzerland | 14 |
Maldives | 14 |
Aruba | 14 |
Transnistria | 13 |
Uzbekistan | 13 |
Croatia | 13 |
Georgia | 12 |
Palestine | 12 |
Netherlands | 12 |
El Salvador | 11 |
Sweden | 11 |
Hungary | 10 |
Paraguay | 10 |
France | 10 |
Austria | 10 |
Malta | 9 |
Israel | 9 |
Bahamas | 9 |
Ukraine | 8 |
Latvia | 8 |
Ireland | 8 |
Saint Kitts and Nevis | 8 |
Belize | 8 |
Bermuda | 8 |
Puerto Rico | 7 |
Tunisia | 7 |
Cape Verde | 7 |
Gibraltar | 7 |
Costa Rica | 6 |
Dominican Republic | 6 |
Germany | 6 |
Guadeloupe | 5 |
Canada | 5 |
Luxembourg | 5 |
Cyprus | 4 |
Estonia | 4 |
Cuba | 3 |
Greece | 3 |
Hong Kong | 3 |
French Polynesia | 2 |
Jamaica | 2 |
Saint Vincent and the Grenadines | 2 |
Finland | 1 |
Suriname | 1 |
Philippines | 0 |
Thailand | 0 |
Denmark | 0 |
Martinique | 0 |
Iceland | 0 |
Macao | -1 |
South Korea | -1 |
Norway | -1 |
Singapore | -1 |
Reunion | -1 |
Japan | -2 |
Australia | -2 |
Greenland | -3 |
Taiwan | -3 |
Mauritius | -4 |
French Guiana | -4 |
Uruguay | -5 |
Bhutan | -5 |
Brunei | -5 |
Antigua and Barbuda | -5 |
New Zealand | -6 |
New Caledonia | -7 |
Barbados | -7 |
Malaysia | -8 |
Faroe Islands | -10 |
Mongolia | -10 |
Seychelles | -18 |
England & Wales | NaN |
Northern Ireland | NaN |
Scotland | NaN |
Les références
Citation
@online{boulakia2024,
author = {Boulakia, Théo and Mariot, Nicolas},
title = {Quels ont été les pays les plus touchés par la pandémie\,?},
date = {2024-10-03},
url = {https://l-attestation.github.io/excercices/exces-mortalite/},
langid = {fr}
}