Disclaimer

This study is done as my personal study project. Any possible errors are highly regretted, I am still learning statistics.

Source: World Development Indicators - World Bank

The dataset ca be found here

Load data and initial processing

raw <- read.csv("mobile.csv", stringsAsFactors = FALSE)
mobile <- raw
mobile$Year <- as.numeric(mobile$Year)
## Warning: NAs introduced by coercion
mobile <- subset(mobile, !is.na(mobile$Year))
#drop Value.Footnotes
mobile <- mobile[,1:3]
mobile <- subset(mobile, Year>=2000)
mobile$Country.or.Area <- as.factor(mobile$Country.or.Area)

Exploratory data analysis

We will focus on several regions: ###East Africa

eAfrcountries <- c("Burundi", "Djibouti", "Eritrea", "Ethiopia", "Kenya", "Tanzania", "Uganda", "Rwanda")
eAfr <- subset(mobile, Country.or.Area %in% as.factor(eAfrcountries))

#drop unused country factor levels from other regions
eAfr$Country.or.Area = factor(eAfr$Country.or.Area)

Average mobile subscriptions per country since 2000

av_subscr <- tapply(eAfr$Value, eAfr$Country.or.Area, mean); av_subscr
##   Burundi  Djibouti   Eritrea  Ethiopia     Kenya    Rwanda  Tanzania 
##  8.092620 11.072380  1.896939  6.000872 31.589592 16.583828 24.191384 
##    Uganda 
## 18.933158

Kenya (per 100 people)

Kenya compared to Tanzania (per 100 people)

KenTan <- subset(eAfr, Country.or.Area %in% c("Kenya", "Tanzania"))
ggplot(KenTan, aes(x=Year, y=Value)) +
geom_bar(stat="identity", colour="black", fill="lightblue", position = "dodge") +
facet_grid(~ Country.or.Area)

KenTan <- subset(eAfr, Country.or.Area %in% c("Kenya", "Tanzania"))
ggplot(KenTan, aes(x=Year, y=Value, fill=Country.or.Area)) +
geom_bar(stat="identity", colour="blue", position = "dodge")

East African countries (per 100 people)

ggplot(eAfr, aes(x=Year, y=Value)) + geom_bar(stat="identity", fill="lightblue", colour="black") +
facet_wrap(~ Country.or.Area, ncol=2)