In this case study we are going to explore university entrance examinations (YGS/LYS) dataset from 2017. Dataset consists of undergraduate programs offered in 2017. Each program offers an availability (i.e. quota). Then students get placed according to their lists and their scores. Each program is filled with the students ranked by their scores until placements are equal to availability. Student placed to a a program with the highest score forms the maximum score of that program and the last student to be placed forms the minimum score.
# Download from GitHub (do it only once)
download.file("https://mef-bda503.github.io/files/osym_data_2017.RData", "osym_data_2017.RData")
# Install tidyverse if not already installed
if (!("tidyverse" %in% installed.packages())) {
install.packages("tidyverse", repos = "https://cran.r-project.org")
}
# Load tidyverse package
library(tidyverse)
# Load the data
load("osym_data_2017.RData")
This data shows quota of universities in Istanbul
university_quota <- osym_data_2017 %>%
group_by(university_name) %>%
filter(city=='İSTANBUL') %>%
summarise(count=n()) %>%
arrange(desc(count))
university_quota
## # A tibble: 51 x 2
## university_name count
## <chr> <int>
## 1 İSTANBUL GELİŞİM ÜNİVERSİTESİ 212
## 2 OKAN ÜNİVERSİTESİ 172
## 3 BEYKENT ÜNİVERSİTESİ 169
## 4 YEDİTEPE ÜNİVERSİTESİ 165
## 5 İSTANBUL MEDİPOL ÜNİVERSİTESİ 155
## 6 İSTANBUL AYDIN ÜNİVERSİTESİ 154
## 7 İSTANBUL ÜNİVERSİTESİ 138
## 8 İSTANBUL AREL ÜNİVERSİTESİ 135
## 9 İSTANBUL BİLGİ ÜNİVERSİTESİ 131
## 10 MALTEPE ÜNİVERSİTESİ 123
## # ... with 41 more rows
Let’s visualize this data in barchart.
ggplot(university_quota, aes(x=reorder(university_name,-count), y=count)) +
geom_bar(stat = "identity", aes(fill=university_quota$university_name=='MEF ÜNİVERSİTESİ')) +
labs(title="Quota of University in Istanbul",x="University",y="Count",fill="") +
theme (axis.text.x=element_text (angle=-90,vjust=0.5, hjust=0)) +
scale_fill_manual(values = c('#707070', 'red'),guide=FALSE)
question2 <- osym_data_2017 %>%
select(university_name, max_score, city) %>%
filter(city=='İSTANBUL') %>%
group_by(university_name) %>%
summarise(max_puan=max(max_score)) %>%
arrange(desc(max_puan))
question2
## # A tibble: 51 x 2
## university_name max_puan
## <chr> <dbl>
## 1 KOÇ ÜNİVERSİTESİ 569.1112
## 2 İSTANBUL ÜNİVERSİTESİ 564.0145
## 3 BOĞAZİÇİ ÜNİVERSİTESİ 562.5765
## 4 İSTANBUL MEDİPOL ÜNİVERSİTESİ 559.4780
## 5 GALATASARAY ÜNİVERSİTESİ 556.0948
## 6 ACIBADEM MEHMET ALİ AYDINLAR ÜNİVERSİTESİ 542.3482
## 7 SABANCI ÜNİVERSİTESİ 538.7725
## 8 YEDİTEPE ÜNİVERSİTESİ 531.3691
## 9 BAHÇEŞEHİR ÜNİVERSİTESİ 530.4845
## 10 İSTANBUL AYDIN ÜNİVERSİTESİ 525.5809
## # ... with 41 more rows
Let’s visualize this data in barchart.
ggplot(question2, aes(x=reorder(university_name,-max_puan), y=max_puan)) +
geom_bar(stat = "identity", aes(fill=question2$university_name=='MEF ÜNİVERSİTESİ')) +
labs(title="Maximum score of each university",x="University",y="Maximum score",fill="") +
theme (axis.text.x=element_text (angle=-90,vjust=0.5,hjust=0)) +
scale_fill_manual(values = c('#707070', 'red'),guide=FALSE)
question3 <- osym_data_2017 %>%
select(university_name,general_quota,city) %>%
filter(city=='İSTANBUL') %>%
group_by(university_name) %>%
summarise(bolum_sayisi=n(),general_quota=sum(general_quota)) %>%
arrange(desc(general_quota))
question3
## # A tibble: 51 x 3
## university_name bolum_sayisi general_quota
## <chr> <int> <int>
## 1 İSTANBUL ÜNİVERSİTESİ 138 17809
## 2 MARMARA ÜNİVERSİTESİ 80 6200
## 3 İSTANBUL MEDİPOL ÜNİVERSİTESİ 155 4495
## 4 İSTANBUL GELİŞİM ÜNİVERSİTESİ 212 3950
## 5 BEYKENT ÜNİVERSİTESİ 169 3811
## 6 İSTANBUL TEKNİK ÜNİVERSİTESİ 76 3684
## 7 YILDIZ TEKNİK ÜNİVERSİTESİ 53 3652
## 8 İSTANBUL AYDIN ÜNİVERSİTESİ 154 3578
## 9 YEDİTEPE ÜNİVERSİTESİ 165 3442
## 10 BAHÇEŞEHİR ÜNİVERSİTESİ 122 2774
## # ... with 41 more rows
Let’s visualize this data in barchart.
ggplot(question3, aes(x=reorder(university_name,-bolum_sayisi), y=bolum_sayisi)) +
geom_bar(stat = "identity", aes(fill=question3$university_name=='MEF ÜNİVERSİTESİ')) +
labs(title="Number of Departments of Universities in İstanbul",x="University",y="Departments",fill="") +
theme (axis.text.x=element_text (angle=-90,vjust=0.5,hjust=0)) +
scale_fill_manual(values = c('#707070', 'red'),guide=FALSE)