This is an exploratory data analysis of the difference of Pure MG schools and Mixed MG schools based on their school characteristics. SED is doing the comparison to establish that there is school variations among MG schools and these variations aggravate the difficulty of teaching multigrade class.
First we need to import and clean the data.
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.1.7 ✔ dplyr 1.0.9
## ✔ tidyr 1.2.1 ✔ stringr 1.4.0
## ✔ readr 2.1.2 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
url <- "https://raw.githubusercontent.com/dexterpante/sha/main/hardship_vars.csv"
hardship_vars <- read.csv(url)
hardship_vars <- hardship_vars[,-c(1,7,8,9)]
hi_vars_clean <- hardship_vars %>% rename(no_electricity=19, no_water=20, no_net=21, tls_needed=22)
Are Pure MG and Mixed MG schools have the same school characteristics with respect to 8 hardship variables?
To answer this question, we need to filter only the MG schools (Pure MG and Mixed MG)
mg_data <- hi_vars_clean %>% select(2,3,6,7,14:24) %>% rename(MG_class = 5) %>% filter(MG_class =="Multigrade" | MG_class=="Combined Monograde and Multigrade")
mg_data
Let us look at the profile of these MG schools
mg_sum <- mg_data %>% mutate_at(c(10:13), as.character) %>% group_by(MG_class) %>% summarise(count=n(), ave_travelcost = mean(travelcost_sdo), ave_traveltime = mean(traveltime_sdo), ave_pov = mean(poverty_mun), ave_index = mean(IndexScore), ave_violence = median(violent_acts), noelec = sum(no_electricity=="1"), nowater = sum(no_water=="1"), nonet = sum(no_net=="1"), tls = sum (tls_needed =="1"))
mg_sum
The low numbers of Pure MG schools with access to electricity, water, internet and temporary learning spaces (TLS) as proxy indicator for calamity might be misleading. Hence, we account the rate of access of Pure MG schools to these basic services in relation to the entire Pure MG schools. We will do the same for the mixed MG schools.
Further analysis of the MG data
mg_sum %>% mutate(no_elec = noelec/count, no_water = nowater/count, no_net = nonet/count, tls_needed = tls/count) %>% select (1:7, 12:15)
Pure MG schools have higher values than mixed MG on the 6 hardship variables (excluding violent acts and TLS).