Created
March 25, 2020 19:20
-
-
Save bgonzalezbustamante/e2265453a7fc041452210230ea7b5909 to your computer and use it in GitHub Desktop.
Chilean Institutions CPS-Ranking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
## Chilean Institutions CPS-Ranking | |
## R version 3.6.1 (2019-07-05) -- "Action of the Toes" | |
## Date: March 2020 | |
## Bastián González-Bustamante | |
## University of Oxford | |
## E-mail: bastian.gonzalezbustamante@politics.ox.ac.uk | |
## Website: http://users.ox.ac.uk/~shil5311/ | |
## Chilean Political Science Impact Ranking | |
## OSF-Project DOI: 10.17605/OSF.IO/C8PRA | |
## http://users.ox.ac.uk/~shil5311/ranking/ | |
############################################################## | |
## Example: http://users.ox.ac.uk/~shil5311/ranking/series/2020-03-14-institutions-ranking/ | |
## Packages | |
library(kableExtra) | |
library(tidyverse) | |
## Data | |
## DOI: 10.17605/OSF.IO/M3NZD | |
data <- read.csv("20200305_ranking.csv") | |
## Institutions Codification | |
anepe <- subset(data, Affiliation == "ANEPE") | |
coes <- subset(data, Affiliation == "COES" | Affiliation == "UDP-COES" | | |
Affiliation == "LSE-COES") | |
iipss <- subset(data, Affiliation == "IIPSS") | |
il <- subset(data, Affiliation == "IL") | |
usach <- subset(data, Affiliation == "USACH" | Affiliation == "OXF-USACH") | |
puc <- subset(data, Affiliation == "PUC" | Affiliation == "PUC-VDEM") | |
ua <- subset(data, Affiliation == "UA") | |
uach <-subset(data, Affiliation == "UACH") | |
uah <- subset(data, Affiliation == "UAH" | Affiliation == "UCHILE-UAH") | |
uai <- subset(data, Affiliation == "UAI") | |
uchile <- subset(data, Affiliation == "UCHILE" | Affiliation == "UCHILE-UAH") | |
uct <- subset(data, Affiliation == "UCT") | |
udd <- subset(data, Affiliation == "UDD") | |
udec <- subset(data, Affiliation == "UDEC") | |
udp <- subset(data, Affiliation == "UDP" | Affiliation == "UDP-COES" | | |
Affiliation == "UDP-NYU" | Affiliation == "UDP-Leiden") | |
ulagos <- subset(data, Affiliation == "ULAGOS") | |
umayor <- subset(data, Affiliation == "UMAYOR") | |
unab <- subset(data, Affiliation == "UNAB") | |
utalca <- subset(data, Affiliation == "UTALCA") | |
utem <- subset(data, Affiliation == "UTEM") | |
uvalpo <- subset(data, Affiliation == "UVALPO") | |
## Dataframe Construction | |
Name <- c("ANEPE", "COES", "IIPSS", "IL", "USACH", "PUC", "UA", "UACH", "UAI", | |
"UCHILE", "UCT", "UDD", "UDEC", "UDP", "ULAGOS", "UMAYOR", "UNAB", | |
"UTALCA", "UTEM", "UVALPO") | |
Cases <- c(nrow(anepe), nrow(coes), nrow(iipss), nrow(il), nrow(usach), nrow(puc), | |
nrow(ua), nrow(uach), nrow(uai), nrow(uchile), nrow(uct), nrow(udd), | |
nrow(udec), nrow(udp), nrow(ulagos), nrow(umayor), nrow(unab), | |
nrow(utalca), nrow(utem), nrow(uvalpo)) | |
Avg_Cites <- c(mean(anepe$Cites), mean(coes$Cites), mean(iipss$Cites), mean(il$Cites), | |
mean(usach$Cites), mean(puc$Cites), mean(ua$Cites), mean(uach$Cites), | |
mean(uai$Cites), mean(uchile$Cites), mean(uct$Cites), mean(udd$Cites), | |
mean(udec$Cites), mean(udp$Cites), mean(ulagos$Cites), mean(umayor$Cites), | |
mean(unab$Cites), mean(utalca$Cites), mean(utem$Cites),mean(uvalpo$Cites)) | |
Cum_Cites <- c(sum(anepe$Cites), sum(coes$Cites), sum(iipss$Cites), sum(il$Cites), | |
sum(usach$Cites), sum(puc$Cites), sum(ua$Cites), sum(uach$Cites), | |
sum(uai$Cites), sum(uchile$Cites), sum(uct$Cites), sum(udd$Cites), | |
sum(udec$Cites), sum(udp$Cites), sum(ulagos$Cites), sum(umayor$Cites), | |
sum(unab$Cites), sum(utalca$Cites), sum(utem$Cites), sum(uvalpo$Cites)) | |
Avg_H_Index <- c(mean(anepe$H_Index), mean(coes$H_Index), mean(iipss$H_Index), | |
mean(il$H_Index), mean(usach$H_Index), mean(puc$H_Index), | |
mean(ua$H_Index), mean(uach$H_Index), mean(uai$H_Index), | |
mean(uchile$H_Index), mean(uct$H_Index), mean(udd$H_Index), | |
mean(udec$H_Index), mean(udp$H_Index), mean(ulagos$H_Index), | |
mean(umayor$H_Index), mean(unab$H_Index), mean(utalca$H_Index), | |
mean(utem$H_Index), mean(uvalpo$H_Index)) | |
Cum_H_Index <- c(sum(anepe$H_Index), sum(coes$H_Index), sum(iipss$H_Index), | |
sum(il$H_Index),sum(usach$H_Index), sum(puc$H_Index), sum(ua$H_Index), | |
sum(uach$H_Index), sum(uai$H_Index), sum(uchile$H_Index), sum(uct$H_Index), | |
sum(udd$H_Index), sum(udec$H_Index), sum(udp$H_Index), sum(ulagos$H_Index), | |
sum(umayor$H_Index), sum(unab$H_Index), sum(utalca$H_Index), | |
sum(utem$H_Index), sum(uvalpo$H_Index)) | |
Inv_Avg_Index <- Avg_H_Index*-1 | |
Inv_Cum_Index <- Cum_H_Index*-1 | |
## Cumulative Ranking | |
Inst_Cum <- data.frame(Name, Cases, Cum_Cites, Cum_H_Index, Inv_Cum_Index) | |
Inst_Cum[is.na(Inst_Cum)] <- 0 | |
Inst_Cum <- within(Inst_Cum, Quartile <- as.integer(cut(Inv_Cum_Index, | |
quantile(Inv_Cum_Index, | |
probs = 0:4/4), | |
include.lowest = TRUE))) | |
Inst_Cum$Inv_Cum_Index <- NULL | |
Inst_Cum <- Inst_Cum[order(-Inst_Cum$Cum_H_Index, -Inst_Cum$Cum_Cites), ] | |
rownames(Inst_Cum) <- NULL | |
## Average Ranking | |
Inst_Avg <- data.frame(Name, Cases, Avg_Cites, Avg_H_Index, Inv_Avg_Index) | |
Inst_Avg[is.na(Inst_Avg)] <- 0 | |
Inst_Avg <- within(Inst_Avg, Quartile <- as.integer(cut(Inv_Avg_Index, | |
quantile(Inv_Avg_Index, | |
probs = 0:4/4), | |
include.lowest = TRUE))) | |
Inst_Avg$Inv_Avg_Index <- NULL | |
Inst_Avg <- Inst_Avg[order(-Inst_Avg$Avg_H_Index, -Inst_Avg$Avg_Cites), ] | |
rownames(Inst_Avg) <- NULL | |
Avg_Cites <- format(round(Inst_Avg$Avg_Cites, 2), nsmall = 3) | |
Avg_H_Index <- format(round(Inst_Avg$Avg_H_Index, 2), nsmall = 3) | |
Quartile <- Inst_Avg$Quartile | |
Inst_Avg <- select(Inst_Avg, Name, Cases) | |
Inst_Avg <- data.frame(Inst_Avg, Avg_Cites, Avg_H_Index, Quartile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment