Skip to content

Commit

Permalink
Files needed to replicate benchmarking from Lozano Gracia, Rossitti, …
Browse files Browse the repository at this point in the history
…Sanchez (2021)
  • Loading branch information
Giuseppe Rossitti committed May 18, 2021
1 parent 34836dd commit 12cd715
Show file tree
Hide file tree
Showing 312 changed files with 2,083 additions and 11,053 deletions.
Binary file removed Benchmarking/Benchmarking Variables_V1205.xlsx
Binary file not shown.
556 changes: 0 additions & 556 deletions Benchmarking/Benchmarking_db_V1.Rmd

This file was deleted.

1,076 changes: 0 additions & 1,076 deletions Benchmarking/Benchmarking_db_V2.Rmd

This file was deleted.

1,490 changes: 0 additions & 1,490 deletions Benchmarking/Benchmarking_graphs_V1.Rmd

This file was deleted.

1,912 changes: 0 additions & 1,912 deletions Benchmarking/Benchmarking_graphs_V2_EGYnolgbt.Rmd

This file was deleted.

6 changes: 3 additions & 3 deletions Benchmarking/Benchmarking_graphs_V3.Rmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "Benchmarking_Graphs"
title: "RISE Benchmarking Graphs"
author: "Giuseppe Rossitti & Evelyn Sanchez"
date: "12/05/2020"
output: html_document
---

```{r setup, include=FALSE}
#knitr::opts_knit$set(root.dir = "C:/Users/####/OneDrive/")
knitr::opts_knit$set(root.dir = "/Users/eves/Dropbox/MENA/Data/Benchmarking2/")
#knitr::opts_knit$set(root.dir = "/Users/eves/Dropbox/MENA/Data/Benchmarking2/")
```

```{r}
Expand All @@ -29,7 +29,7 @@ library(Hmisc)

# Set Directories
```{r}
dir_int<-"./Integrated data/" #Folder with data generated in code Benchmarking_Data_V2
dir_int<-"./Integrated_data/" #Folder with data generated in code Benchmarking_Data_V2
#dir_out<- "./Data/Benchmarking/SD_Profiles/Output/"
dir_out<-"./Output/"
#In your coumputer, this directory create separate folders for income group - ex: ./My Files/Output/lmic -./My Files/Output/umic, etc, in oder to save countries info per income group
Expand Down
21 changes: 21 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_MENA_score.csv

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_all_score.csv

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_hics_score.csv

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_lics_score.csv

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_lmics_score.csv

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions Benchmarking/Integrated_data/DB_SD_umics_score.csv

Large diffs are not rendered by default.

219 changes: 219 additions & 0 deletions Benchmarking/Integrated_data/Integrated_v5.csv

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions Benchmarking/Integrated_data/World_SD_values_V5.csv

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions Benchmarking/Integrated_data/World_SD_values_V5_index.csv

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions Benchmarking/Integrated_data/World_SD_values_V5_index_v2.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "Benchmarking db new"
author: "Giuseppe Rossitti"
title: "Database for international benchmarking"
author: "Giuseppe Rossitti & Evelyn Sanchez"
date: "02/15/2020"
output: html_document

---

```{r setup, include=FALSE}
#knitr::opts_knit$set(root.dir = "C:/Users/####/OneDrive/")
knitr::opts_knit$set(root.dir = "/Users/eves/Dropbox/MENA/Data/Benchmarking2/")
#knitr::opts_knit$set(root.dir = "/Users/eves/Dropbox/MENA/Data/Benchmarking2/")
```

# Required libraries
Expand All @@ -29,8 +29,8 @@ Create the following set of folders
dir_int = This folder is the outcome folder for the global results, name it as "Integrated data" to be consistent with the mapping script "Benchmarking_Graphs"

```{r}
dir_raw<-"./Raw Indicators/"
dir_int<- "./Integrated data/"
dir_raw<-"./Raw_Indicators/"
dir_int<- "./Integrated_data/"
getwd()
```

Expand Down Expand Up @@ -864,112 +864,7 @@ integrated3 <- integrated2
```

<!-- # Score Formulas For Income Groups -->
<!-- Formulas to calculate the score of each country against its income group -->
<!-- ```{r} -->
<!-- #detach plyr or the formulas won't work -->
<!-- detach(package:plyr) -->
<!-- #Indicators - Higher value = better performance -->
<!-- #score = worst country value (worldwide) - countries value/ worst country value(worldwide) - worst country value from its income group -->
<!-- scores_nor <- function(data, y){ -->
<!-- data <- data[colnames(data) %in% two_side] -->
<!-- data %>% -->
<!-- dplyr::mutate(across(where(is.numeric), function(x){ -->
<!-- (min(x, na.rm=TRUE) - x)/ -->
<!-- (min(x, na.rm=TRUE) - max(x[which(.$income == y)], na.rm=TRUE))})) -->
<!-- } -->

<!-- #Indicators- Higher value= worst performance -->
<!-- scores_inv <- function(data, y){ -->
<!-- data <- data[colnames(data) %in% inv_side] -->
<!-- data %>% -->
<!-- mutate(across(where(is.numeric), function(x){ -->
<!-- (max(x, na.rm=TRUE) - x)/ -->
<!-- (max(x, na.rm=TRUE) - min(x[which(.$income == y)], na.rm=TRUE))})) -->
<!-- } -->
<!-- ``` -->

<!-- #Score Formulas for Regional Comparison -->
<!-- Formulas to calculate the score of each country against its regional group (we don't currently use this output, but it's possible to calculate these scores if desired) -->
<!-- # ```{r} -->
<!-- # #Indicators - Higher value = better performance -->
<!-- # scores_reg_nor <- function(data, y){ -->
<!-- # data <- data[colnames(data) %in% two_side] -->
<!-- # data %>% -->
<!-- # mutate(across(where(is.numeric), function(x){ -->
<!-- # (min(x, na.rm=TRUE) - x)/ -->
<!-- # (min(x, na.rm=TRUE) - max(x[which(.$region == y)], na.rm=TRUE))})) -->
<!-- # } -->
<!-- # -->
<!-- # -->
<!-- # -->
<!-- # #Indicators- Higher value= worst performance -->
<!-- # scores_reg_inv <- function(data, y){ -->
<!-- # data <- data[colnames(data) %in% inv_side] -->
<!-- # data %>% -->
<!-- # mutate(across(where(is.numeric), function(x){ -->
<!-- # (max(x, na.rm=TRUE) - x)/ -->
<!-- # (max(x, na.rm=TRUE) - min(x[which(.$region == y)], na.rm=TRUE))})) -->
<!-- # } -->
<!-- # -->
<!-- # -->
<!-- # -->
<!-- # -->
<!-- # ##LMICS## -->
<!-- # integrated_lmics_score<- scores_nor(integrated2, "Lower middle income") -->
<!-- # integrated_lmics_score_neg<-scores_inv(integrated2, "Lower middle income") -->
<!-- # #Join scores -->
<!-- # integrated_lmics_score<-left_join(integrated_lmics_score,integrated_lmics_score_neg, by=c('country', "iso3", "region", "income")) -->
<!-- # #Filter by income group -->
<!-- # integrated_lmics_score <- integrated_lmics_score %>% filter(income=='Lower middle income') -->
<!-- # # Save -->
<!-- # write.csv(integrated_lmics_score, paste0(dir_int, "DB_SD_lmics_score.csv"), row.names = FALSE) -->
<!-- # -->
<!-- # ##UMICS## -->
<!-- # integrated_umics_score<- scores_nor(integrated2, "Upper middle income") -->
<!-- # integrated_umics_score_neg<-scores_inv(integrated2, "Upper middle income") -->
<!-- # #Join scores -->
<!-- # integrated_umics_score<-left_join(integrated_umics_score,integrated_umics_score_neg, by=c('country', "iso3", "region", "income")) -->
<!-- # #Filter by income group -->
<!-- # integrated_umics_score <- integrated_umics_score %>% filter(income=='Upper middle income') -->
<!-- # -->
<!-- # # Save -->
<!-- # write.csv(integrated_umics_score, paste0(dir_int, "DB_SD_umics_score.csv"), row.names = FALSE) -->
<!-- # -->
<!-- # #LICS -->
<!-- # integrated_lics_score<- scores_nor(integrated2, "Low income") -->
<!-- # integrated_lics_score_neg<-scores_inv(integrated2, "Low income") -->
<!-- # #Join scores -->
<!-- # integrated_lics_score<-left_join(integrated_lics_score,integrated_lics_score_neg, by=c('country', "iso3", "region", "income")) -->
<!-- # #Filter by income group -->
<!-- # integrated_lics_score <- integrated_lics_score %>% filter(income=='Low income') -->
<!-- # -->
<!-- # # Save -->
<!-- # write.csv(integrated_lics_score, paste0(dir_int, "DB_SD_lics_score.csv"), row.names = FALSE) -->
<!-- # -->
<!-- # #HICS -->
<!-- # integrated_hics_score<- scores_nor(integrated2, "High income") -->
<!-- # integrated_hics_score_neg<-scores_inv(integrated2, "High income") -->
<!-- # #Join scores -->
<!-- # integrated_hics_score<-left_join(integrated_hics_score,integrated_hics_score_neg, by=c('country', "iso3", "region", "income")) -->
<!-- # #Filter by income group -->
<!-- # integrated_hics_score <- integrated_hics_score %>% filter(income=="High income") -->
<!-- # -->
<!-- # # Save -->
<!-- # write.csv(integrated_hics_score, paste0(dir_int, "DB_SD_hics_score.csv"), row.names = FALSE) -->
<!-- # -->
<!-- # -->
<!-- # ##MENA## (no used, only calculated for internal use) -->
<!-- # integrated_MENA_score<- scores_reg_nor(integrated2, "Middle East & North Africa") -->
<!-- # integrated_MENA_score_neg<-scores_reg_inv(integrated2, "Middle East & North Africa") -->
<!-- # #Join scores -->
<!-- # integrated_MENA_score<-left_join(integrated_MENA_score,integrated_MENA_score_neg, by=c('country', "iso3", "region", "income")) -->
<!-- # #Filter by income group -->
<!-- # integrated_MENA_score <- integrated_MENA_score %>% filter(region=='Middle East & North Africa') -->
<!-- # # Save -->
<!-- # write.csv(integrated_MENA_score, paste0(dir_int, "DB_SD_MENA_score.csv"), row.names = FALSE) -->
<!-- # -->
<!-- # ``` -->


#Calculate Percentile Rank
Calculates country percentile value comparing all countries in the dataset
Expand Down
Loading

0 comments on commit 12cd715

Please sign in to comment.