Display code
#|label: libraries
library(tidyverse)
library(readr)
library(reactable)
library(gt)
library(flextable)
library(stargazer)
Olivier Caron
May 25, 2023
Once upon a time in France, there was a remarkable tool called the Social Position Index (SPI). This index held the power to unravel the stark inequalities that existed within the realm of education for French citizens. The SPI was a product of the diligent calculations performed by the Department for Evaluation, Prospective and Performance (DEPP). It served as a mirror reflecting the socio-economic and cultural circumstances of the families whose children attended various schools across the country (Rocher 2016).
This tool, rather simple in its concept, derives its power from a complex calculation process. The Social Position Index (SPI) takes into account a multitude of factors to accurately assess the socio-economic and cultural conditions of the families associated with each school. It analyzes various indicators such as household income, parental education level, occupation, and even cultural resources within the community. These data points are meticulously collected and synthesized by the Department for Evaluation, Prospective and Performance (DEPP) to generate a comprehensive picture of the social landscape surrounding each educational institution. Through this meticulous calculation, the SPI uncovers the glaring disparities that exist within the education system, shedding light on the undeniable influence of social position on the educational opportunities available to French citizens.
ips_colleges <- read_delim("ips_colleges.csv")
ips_lycees <- read_delim("ips_lycees.csv")
ips_ecoles <- read_delim("ips_ecoles.csv")
column_names_colleges <- c("school_year", "academy", "code_department", "department", "uai", "institution_name", "insee_code_commune", "commune_name", "sector", "ips", "sd_ips")
column_names_ecoles <- c("school_year", "academy", "code_department", "department", "uai", "institution_name", "insee_code_commune", "commune_name", "sector", "ips")
column_names_lycees <- c("school_year", "academy", "code_department", "department", "uai", "institution_name", "insee_code_commune", "commune_name", "sector", "lycee_type", "ips_gt", "ipd_pro", "ips", "sd_ips_gt", "sd_ips_pro")
#modify column names
names(ips_colleges)[1:11] <- column_names_colleges
names(ips_ecoles)[1:10] <- column_names_ecoles
names(ips_lycees)[1:15] <- column_names_lycees
ips_colleges["school_type"] <- "college"
ips_ecoles["school_type"] <- "ecole"
ips_lycees["school_type"] <- "lycee"
ips_data <- bind_rows(ips_colleges,ips_lycees,ips_ecoles)
write_csv(ips_data,"ips_data.csv")
#write.csv(ips_data, "ips_data.csv", na = "", fileEncoding = "UTF-8")
select(ips_data, contains("ips")) %>% summary()
ips sd_ips ips_gt sd_ips_gt
Min. : 35.8 Min. : 0.0 Min. : 51.9 Min. : 0.00
1st Qu.: 92.6 1st Qu.:30.9 1st Qu.:105.0 1st Qu.:32.20
Median :102.8 Median :33.3 Median :113.1 Median :33.90
Mean :102.8 Mean :33.0 Mean :113.7 Mean :33.53
3rd Qu.:113.2 3rd Qu.:35.5 3rd Qu.:122.9 3rd Qu.:35.60
Max. :159.1 Max. :87.7 Max. :159.1 Max. :49.20
NA's :224699 NA's :230768 NA's :238149
sd_ips_pro
Min. : 0.0
1st Qu.:26.8
Median :28.9
Mean :28.9
3rd Qu.:31.1
Max. :49.5
NA's :239286
ips_data_reduced <- ips_data %>%
select(school_year, school_type, ips, sector, uai, institution_name, commune_name) %>%
rename(
"Year" = school_year,
"School Type" = school_type,
"IPS" = ips,
"Sector" = sector,
"School ID" = uai,
"Institution Name" = institution_name,
"Commune Name" = commune_name
) %>%
mutate(Sector = if_else(Sector == "privé sous contrat", "privé", Sector))
reactable(ips_data_reduced,
columns = list
(
Year = colDef(minWidth = 100, align = "center"),
`School Type` = colDef(minWidth = 80, align = "center"),
IPS = colDef(minWidth = 70, align = "center"),
Sector = colDef(minWidth = 80, align = "center"),
`School ID` = colDef(minWidth = 100, align = "center"),
`Institution Name` = colDef(minWidth = 350, align = "center"),
`Commune Name` = colDef(minWidth = 200, align = "center")
),
filterable = TRUE,
sortable = TRUE,
bordered = TRUE)