Prestations sociales

Data - IPP

The following packages are a base install and will not be unloaded:

The following packages were not previously loaded:

Le chargement a nécessité le package : scales
Le chargement a nécessité le package : knitr
Le chargement a nécessité le package : kableExtra
Le chargement a nécessité le package : lubridate

Attachement du package : 'lubridate'
Les objets suivants sont masqués depuis 'package:base':

    date, intersect, setdiff, union
Le chargement a nécessité le package : viridis
Le chargement a nécessité le package : viridisLite

Attachement du package : 'viridis'
L'objet suivant est masqué depuis 'package:scales':

    viridis_pal
Le chargement a nécessité le package : ggrepel
Le chargement a nécessité le package : ggplot2
Le chargement a nécessité le package : DT
Le chargement a nécessité le package : rsdmx
Le chargement a nécessité le package : insee
Le chargement a nécessité le package : broom
Le chargement a nécessité le package : tidyverse
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr   1.1.4     ✔ stringr 1.5.1
✔ forcats 1.0.0     ✔ tibble  3.2.1
✔ purrr   1.0.2     ✔ tidyr   1.3.1
✔ readr   2.1.5     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ readr::col_factor() masks scales::col_factor()
✖ purrr::discard()    masks scales::discard()
✖ dplyr::filter()     masks stats::filter()
✖ dplyr::group_rows() masks kableExtra::group_rows()
✖ dplyr::lag()        masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Le chargement a nécessité le package : ggimage

Le chargement a nécessité le package : data.table


Attachement du package : 'data.table'


Les objets suivants sont masqués depuis 'package:dplyr':

    between, first, last


L'objet suivant est masqué depuis 'package:purrr':

    transpose


Les objets suivants sont masqués depuis 'package:lubridate':

    hour, isoweek, mday, minute, month, quarter, second, wday, week,
    yday, year

Liste

Code
i_g("bib/ipp/prestations-sociales.png")

Retenue Etat

Table

Code
ret_etat %>%
  print_table_conditional
date taux_employeur_explicite.ati taux_employeur_explicite.pensions_civils taux_employeur_explicite.pensions_militaires taux_implicite
2024-04-21 0.0032 0.7428 1.2607 NA
2014-01-01 0.0032 0.7428 1.2607 NA
2013-12-01 0.0032 0.4428 1.2607 NA
2013-01-01 0.0032 0.7428 1.2607 NA
2012-01-01 0.0033 0.6859 1.2155 NA
2011-01-01 0.0033 0.6539 1.1414 NA
2010-01-01 0.0033 0.6214 1.0863 NA
2009-12-01 0.0032 0.4014 1.0839 NA
2009-01-01 0.0032 0.6014 1.0839 NA
2008-01-01 0.0031 0.5571 1.0350 NA
2007-01-01 0.0031 0.5074 1.0105 NA
2006-01-01 0.0030 0.4990 1.0000 NA
2005-01-01 NA NA NA 0.594
2004-01-01 NA NA NA 0.568
2003-01-01 NA NA NA 0.527
2002-01-01 NA NA NA 0.523
2001-01-01 NA NA NA 0.487
2000-01-01 NA NA NA 0.492
1999-01-01 NA NA NA 0.486
1997-01-01 NA NA NA 0.474
1996-01-01 NA NA NA 0.462
1995-01-01 NA NA NA 0.486

Pensions civiles, militaires

Code
ret_etat %>%
  select(date, 
         `Taux pensions civiles` = taux_employeur_explicite.pensions_civils,
         `Taux pensions militaires` = taux_employeur_explicite.pensions_militaires) %>%
  mutate(date = as.Date(date)) %>%
  add_row(date = as.Date("2022-09-05"),
          `Taux pensions civiles` = 0.7428,
          `Taux pensions militaires` = 1.2607) %>%
  mutate(date = as.Date(date)) %>%
  arrange(desc(date)) %>%
  gather(variable, value, -date) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  na.omit %>%
  ggplot() + geom_line(aes(x = date, y = value, color = variable)) + theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-200, 200, 5),
                     labels = percent_format(acc = 1)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme(legend.title = element_blank(),
        legend.position = c(0.7, 0.8)) +
  ylab("Taux employeur explicite") + xlab("")

Pensions civiles, militaires

Code
ret_etat %>%
  select(date, 
         `Taux pensions civiles` = taux_employeur_explicite.pensions_civils,
         `Taux pensions militaires` = taux_employeur_explicite.pensions_militaires,
         `Taux implicite` = taux_implicite) %>%
  mutate(date = as.Date(date)) %>%
  add_row(date = as.Date("2022-09-05"),
          `Taux pensions civiles` = 0.7428,
          `Taux pensions militaires` = 1.2607,
          `Taux implicite` = NA) %>%
  mutate(date = as.Date(date)) %>%
  arrange(desc(date)) %>%
  gather(variable, value, -date) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  na.omit %>%
  mutate(value = ifelse(variable == "Taux implicite" & date >= as.Date("2006-01-01"), NA, value)) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = variable)) + theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-200, 200, 5),
                     labels = percent_format(acc = 1)) +
  scale_color_manual(values = viridis(4)[1:3]) +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.8)) +
  ylab("Taux employeur explicite") + xlab("") + 
  geom_hline(yintercept = 0.15, linetype = "dashed")

RMI

Table

Code
rmi_m %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  ggplot() + geom_line(aes(x = date, y = value)) +
  scale_color_manual(values = viridis(8)[1:7]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI en euros") + xlab("")

RSA

Table

Code
rsa_m %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

Code
rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  ggplot() + geom_line(aes(x = date, y = value)) +
  scale_color_manual(values = viridis(8)[1:7]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RSA en euros") + xlab("")

RMI / RSA

Table

Code
rsa_m %>%
  bind_rows(rmi_m) %>%
  select(date, montant_base_rsa, 
         montant_base_rmi, date_parution_jo) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

All

Valeur

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1992)") + xlab("")

1992

Valeur

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1992-01-01")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1992-01-01")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1992)") + xlab("")

1996

Valeur

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1996-01-01")) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(300, 700, 10),
                     labels = dollar_format(accuracy = 1, suffix = " €", prefix = "")) + 
  ylab("Montant du RMI / RSA en euros") + xlab("")

Base 100 (+53%)

Code
rmi_m %>%
  select(date, montant_base_rmi) %>%
  gather(variable, value, -date) %>%
  bind_rows(rsa_m %>%
  select(date, montant_base_rsa) %>%
  gather(variable, value, -date)) %>%
  filter(!is.na(value)) %>%
  mutate(value = ifelse(value >= 2000, value/6.55957, value)) %>%
  group_by(variable) %>%
  complete(date = seq.Date(min(date), max(date), by = "day")) %>%
  fill(value) %>%
  mutate(Variable = ifelse(variable == "montant_base_rmi", "RMI (avant le 1er juin 2009)",
                           "RSA (après le 1er juin 2009)")) %>%
  filter(date >= as.Date("1996-01-01")) %>%
  ungroup %>%
  arrange(date) %>%
  mutate(value = 100*value/value[1]) %>%
  ggplot() + geom_line(aes(x = date, y = value, color = Variable)) +
  scale_color_manual(values = viridis(3)[1:2]) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.3, 0.8),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 700, 10)) + 
  ylab("Montant du RMI / RSA (100 = 1996)") + xlab("")