The aim of our project is to analyze the disparities in access to electricity between rural and urban areas in Sub-Saharan Africa. Thus, the topic of our example of global monitoring is based on the SDG 7.1, which intends to provide universal access to accessible, efficient, and sophisticated energy services. For data availability reasons, we decided to focus on the years from 2010 to 2015, and excluded countries that had unavailable data.
The data of our study is obtained from the World Development Indicators database using wbstats. In order to complete our analysis, we selected five variables of interest, including their World Bank code: Population, total (SP.POP.TOTL), GDP per capita (current US$) (NY.GDP.PCAP.CD), Access to electricity (% of population) (EG.ELC.ACCS.ZS), Access to electricity, rural (% of rural population) (EG.ELC.ACCS.RU.ZS), and Access to electricity, urban (% of urban population) (EG.ELC.ACCS.UR.ZS).
On this basis, we compared the national levels of access to electricity in the region and explored the socioeconomic differences between rural and urban areas in consideration of the GDP per capita. Similarly, we included a set of graphs alongside some explanations that represent more clearly the results we found out.
my_indicators <- c(pop="SP.POP.TOTL",
GDP="NY.GDP.PCAP.CD",
total_access="EG.ELC.ACCS.ZS",
urban_access="EG.ELC.ACCS.UR.ZS",
rural_access="EG.ELC.ACCS.RU.ZS")
We chose the year 2010 to 2015 to filter the data from the World Bank database because those were the years in which more data were available for the entire region.
dr <- wb_data(my_indicators, start_date = 2010, end_date = 2015)%>%
left_join(wb_countries() %>% select(-country), by="iso3c")
Then, we called a new data “dr1” in order to use the function of the filter to clean up our data and only get the information we need for Sub-Saharan Africa.
dr1= dr %>% filter(region =="Sub-Saharan Africa")
Afterwards, we created a new data set “dr2” obtained by filtering the data of variables of the percentage of urban and rural populations that have access to electricity, trying to prevent missing NA numbers from interfering.
dr2=dr1 %>% filter(!is.na(urban_access))
dr2=dr1 %>% filter(!is.na(rural_access))
The first step which is having our data filtered is already done, thus, we can begin by analysing more in-depth the SDG target of total access to electricity in rural and urban areas. For that reason, we decided to provide some tables in order to show the percentage mean of the total access to electricity in urban areas, then in rural areas and finally the total access of the region. We followed the next steps: using the dataset of “dr2”, we used the function of “group_by” in order to group the data from the Sub-Saharan region. Next, removing the countries without population data, so that the results are clearer. And then, with the option of “summarize”, group data in order to obtain the average mean. Our goal with this analysis is to assess how is the situation in the region, making a comparison between rural and urban.
dr2 %>%
group_by(region) %>%
drop_na(pop) %>%
summarize(Average=weighted.mean(urban_access,pop,na.rm=TRUE),
Countries=n(),
Missing=sum(is.na(urban_access)),
`Pop (millions)`=sum(pop)/1e6
) %>%
arrange(Average) %>%
kable(digits=2)
region | Average | Countries | Missing | Pop (millions) |
---|---|---|---|---|
Sub-Saharan Africa | 72.05 | 252 | 0 | 4883.06 |
dr2 %>%
group_by(region) %>%
drop_na(pop) %>%
summarize(Average=weighted.mean(rural_access,pop,na.rm=TRUE),
Countries=n(),
Missing=sum(is.na(rural_access)),
`Pop (millions)`=sum(pop)/1e6
) %>%
arrange(Average) %>%
kable(digits=2)
region | Average | Countries | Missing | Pop (millions) |
---|---|---|---|---|
Sub-Saharan Africa | 22.06 | 252 | 0 | 4883.06 |
dr2 %>%
group_by(region) %>%
drop_na(pop) %>%
summarize(Average=weighted.mean(total_access,pop,na.rm=TRUE),
Countries=n(),
Missing=sum(is.na(total_access)),
`Pop (millions)`=sum(pop)/1e6
) %>%
arrange(Average) %>%
kable(digits=2)
region | Average | Countries | Missing | Pop (millions) |
---|---|---|---|---|
Sub-Saharan Africa | 39.51 | 252 | 0 | 4883.06 |
After doing the filtering process, we can analyse the results. The total access in urban areas is 72.05%. In the rural areas, 22.06%. Lastly, the mean of the total access to electricity in the region is 39.51%. This first analysis helps us to understand that in Sub-Saharan African countries the population who have more access to electricity is clearly in urban areas. However, it is interesting to see how the mean for the total access in lower than in urban areas, since it also takes the data from rural areas.
We have seen the mean of the total access, thus making a distinction between the access of rural areas and the access of urban areas in Sub-Saharan Africa. we can observe then that urban areas are more likely to have access to electricity with a difference in the mean of 49,99. After having seen this, we create a new data set called ‘’dr 3’’ to add a new variable called ‘’electricity_gap’’. This variable is created in order to show the access to electricity gap existing in the rural and urban areas at the country level in Sub-Saharan Africa. We have created this new variable with the difference between rural and urban access to electricity.
dr3 = dr2 %>%
mutate(electricity_gap=urban_access- rural_access)
In order to make an easier analysis and interpretation of the data compiled, and to have a clear vision of the difference between the regions labelled as rural and urban, we have arranged the ‘’electricity_gap’’ variable to see what countries are the ones in which the electricity gap is higher, placing them in ascending and descending order, making a table for each of the higher values and another table for the lowest values. We have used 1 digit in both cases.
dr3 %>%
arrange(electricity_gap) %>%
select(country,region,`difference`=electricity_gap) %>%
slice(1:5) %>%
kable(digits=1)
country | region | difference |
---|---|---|
Mauritius | Sub-Saharan Africa | -0.1 |
Seychelles | Sub-Saharan Africa | 0.0 |
Seychelles | Sub-Saharan Africa | 0.0 |
Mauritius | Sub-Saharan Africa | 0.3 |
Mauritius | Sub-Saharan Africa | 0.4 |
dr3 %>%
arrange(-electricity_gap) %>%
select(country,region,`Difference`=electricity_gap) %>%
slice(1:5) %>%
kable(digits=1)
country | region | Difference |
---|---|---|
Equatorial Guinea | Sub-Saharan Africa | 88.1 |
Equatorial Guinea | Sub-Saharan Africa | 87.5 |
Equatorial Guinea | Sub-Saharan Africa | 86.8 |
Equatorial Guinea | Sub-Saharan Africa | 86.0 |
Equatorial Guinea | Sub-Saharan Africa | 83.0 |
Conclusion: the more positive the difference is, the more urban areas have access to electricity, while if the difference is negative, this means that there are more rural areas than urban areas having access to electricity. In the first table, we can observe Mauritius with a negative value of -0.1, ordered from the lowest to the highest value. This means that in Mauritius, there are more rural areas than urban areas having electricity. This makes sense, as in this region, there are more rural areas than urban ones. Otherwise, in the second table, we can see Equatorial Guinea having the highest values (88.1) ordered from highest to lowest value; here the urban areas have more access to electricity than the rural ones.
This section provides a graphical representation of the conclusions and information obtained from the analysis and manipulation of the data regarding the electricity gap between rural and urban regions in Sub-Saharan Africa.
dr3 %>%
ggplot(aes(x=total_access,y=electricity_gap,color=urban_access, size=pop, label=country)) +
geom_point() + geom_text_repel() +geom_hline(yintercept=0) +
labs(x="total access",y="electricity gap",
size="population")
Explanation of the graph: thanks to this graph, we can compare the urban sub-Saharan countries, and how much of this total population has access to electricity. This graph groups the total access to electricity as the independent variable and the electricity gap as the dependent variable. Each of the points represents the country and the bigger the point is, the more population it has. In addition, the y axis represents the electricity gap, so the points (countries) placed at the top of the graph show that there is a big gap between urban and rural countries, and the point placed at the bottom has a less electricity gap. The x-axis represents the access to electricity, the more you are placed to the right, the more access you have. The colour blue indicates the level of access, with being 100 the highest level, with a lighter blue and under 25 the lowest level represented with a darker blue.
dr3 %>%
ggplot(aes(x=total_access,y=electricity_gap,color=rural_access, size=pop, label=country)) +
geom_point() + geom_text_repel() +geom_hline(yintercept=0) +
labs(x="total access",y="electricity gap",
size="population")
Explanation: thanks to this graph, we can compare the rural sub-Saharan countries, and how much of this total population has access to electricity. This graph groups the total access to electricity as the independent variable and the electricity gap as the dependent variable as well as the previous one. Each of the points represents the country and the bigger the point is, the more population it has. In addition, the y axis represents the electricity gap, so the points (countries) placed at the top of the graph show that there is a big gap between urban and rural countries, and the point placed at the bottom has a less electricity gap. The x axis represents the access to electricity, the more you are placed to the right, the more access you have. The color blue indicates the level of access, with being 100 the highest level, with a lighter blue and under 25 the lowest level represented with a darker blue.
dr3 %>%
ggplot(aes(x=total_access,y=electricity_gap,color=urban_access, size=GDP, label=country)) +
geom_point() + geom_text_repel() +geom_hline(yintercept=0) +
labs(x="total access",y="electricity gap",
size="GDP")
Explanation: In the following graph, we can compare the urban sub-Saharan countries, and how much of this total population has access to electricity taking into account the GDP per capita of the countries. Each of the points represents the country and the bigger the point is, the more GDP per capita it has. In addition, the y axis represents the electricity gap, so the points (countries) placed at the top of the graph show that there is a big gap between urban and rural countries, and the point placed in the bottom has a less electricity gap. The x axis represents the access to electricity, the more you are placed to the right, the more access you have. The colour blue indicates the level of access, with being 100 the highest level, with a lighter blue and under 25 the lowest level represented with a darker blue. It is not surprising that, for example, South Africa has more access to electricity: nearly 100, is placed at the bottom, so means that the electricity gap is small, and has between 15000 and 20000 GDP value. So we can make a correlation between the GDP and the access to electricity, being the countries with more GDP, and consequently, more resources and economic flow and capacity, the ones that will have more access to electricity.
dr3 %>%
ggplot(aes(x=total_access,y=electricity_gap,color=rural_access, size=GDP, label=country)) +
geom_point() + geom_text_repel() +geom_hline(yintercept=0) +
labs(x="total access",y="electricity gap",
size="gdp")
Explanation: now in this graph, we can compare the rural sub-Saharan countries, and how much of this total population has access to electricity taking into account the GDP per capita of the countries. There is evidence that the countries that have less GDP per capita, 5000 or less, such as Liberia, will have less access to electricity, as it is common that those rural regions have fewer resources and financing, lack proper infrastructures and electronic structures and mechanisms to provide electricity to the population.
dr1 %>%
ggplot(aes(
x = GDP,
y = total_access
)) +
geom_point(aes(size=GDP, color=country)) +
geom_smooth(se = FALSE) +
scale_x_log10(
labels = scales::dollar_format(),
breaks = scales::log_breaks(n = 4)
) +
scale_size_continuous(
labels = scales::number_format(scale = 1/1e6, suffix = "m"),
breaks = seq(1e8,1e9, 2e8),
range = c(1,20)
) +
theme_minimal() +
labs(
title = "Total access to electricity according to GDP per capita",
x = "GDP per Capita (log scale)",
y = "Total_access (percentage)",
size = "GDP",
color = NULL,
caption = "Source: World Bank, through `wbstats`"
)
Explanation: to make a general analysis of the countries, we have decided to make the last graph that shows all the sub-saharan countries without distinction between urban and rural, each of them represented in a different color and with circles. The bigger they are, the more access the total population of the country to electricity and the bigger the GDP per capita value is.
dr1 %>%
filter(date==2015) %>%
ggplot(aes(
x = GDP,
y = total_access,
color= pop
)) +
geom_point(aes(size=pop)) +
geom_smooth(se = FALSE) +
scale_x_log10(
labels = scales::dollar_format(),
breaks = scales::log_breaks(n = 4)
) +
scale_size_continuous(
labels = scales::number_format(scale = 1/1e6, suffix = "m"),
breaks = seq(1e8,1e9, 2e8),
range = c(1,20)
) +
theme_minimal() +
scale_color_gradient2(low="red",mid="yellow",high="blue",midpoint=0)+
labs(
title = "Total access to electricity according to GDP",
x = "GDP (log scale)",
y = "Total access",
size = "Population",
color = NULL,
caption = "Source: World Bank"
)
Explanation: In this graph, we compared the GDP, the total access and
the population. The colour yellow represents low levels, the purple
medium and the blue, high levels. Filtering by colour, we can assess the
total access to electricity in Sub-Saharan Africa region
is very low, ranging from 0-50% and at the same time, those countries
have low levels of GDP. Therefore, much work must be done in this area
in order to make sure that SDG 7.1 is achieved.
Finally, it is possible to conclude that differences in access to electricity are latent between urban and rural areas in Sub-Saharan Africa. According to our findings, urban regions are more favored, while rural areas are more disadvantaged, although this is less apparent in cases where the majority of the population is rural. As a result, we discovered that the difference in likelihood of having access to power between the two areas is 49.99. In fact, there is a profound gap between rural and urban areas in terms of access to electricity, which we attribute to the disparities in development and urbanization between both.
Furthermore, we discovered that the socioeconomic component seems to have some responsibility in this issue, since regions with higher GDP per capita are more likely to get electricity. Consequently, we suggest that income level influences access to energy services because wealth increases the capacity of resources and provides electricity to the public at a reasonable cost and in a safe manner.
Against this background, it is important to consider that the Sub-Saharan region, one of the poorest areas of the world, presents a total access to electricity of 39.51%. Therefore, the objective of the SDG 7.1, which aims to guarantee universal access to affordable, reliable and modern energy services, is unlikely to be achieved in this region by 2030. Moreover, the persistent inability to address the consequences of a lack of electricity, such as the absence of clean cooking, weighs Sub-Saharan African economies and inhibits human development. Since the quality of life of millions of people is at risk, there is an urgent need to address energy shortages in these places of the world, which is why we decided to research this topic in the first place.