1.I am using gfg_plot + # Modify axis labels xlab(“Years”) + ylab(” percentage ownership”) to change the label of y-axis. 2. Male tend to have more account ownership than females. And the precentage ownership have a increasing trend. 3.If we ignore 2017’s data, the account ownerships are increasing. Or we only look at Brazil’s data it is possible to say that account percentages have been increasing. 4.
knitr::opts_knit$set(root.dir = 'C:/Users/zangz/Downloads/P_Data_Extract_From_World_Development_Indicators')
setwd('C:/Users/zangz/Downloads/P_Data_Extract_From_World_Development_Indicators')
less <- read.csv("less.csv")
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.0 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
less <- less %>%
filter(Country.Name == "Uganda" | Country.Name == "Sweden" | Country.Name == "Spain"| Country.Name == "New Zealand"| Country.Name == "Saudi Arabia")
rel_col <- which(colnames(less)=="Country.Name" | colnames(less)== "X2014..YR2014." | colnames(less)== "X2017..YR2017." | colnames(less) == "X2021..YR2021." )
rel_col
## [1] 3 8 11 15
less <- less[rel_col] %>% rename("2014" = 2, "2017" = 3, "2021" = 4)
head(less)
## Country.Name 2014 2017 2021
## 1 New Zealand 97.18 100 96.53
## 2 Saudi Arabia 64.16 65.02 76.8
## 3 Spain 93.17 89.02 96.37
## 4 Sweden 100 96.85 100
## 5 Uganda 36.79 46.65 54.26
transpose_l <- data.frame(t(less[-1]))
colnames(transpose_l) <- less[, 1]
transpose_l$"New Zealand" = as.numeric(transpose_l$"New Zealand")
transpose_l$"Saudi Arabia" = as.numeric(transpose_l$"Saudi Arabia")
transpose_l$Spain = as.numeric(transpose_l$Spain)
transpose_l$Sweden = as.numeric(transpose_l$Sweden)
transpose_l$ Uganda = as.numeric(transpose_l$ Uganda)
head(transpose_l)
## New Zealand Saudi Arabia Spain Sweden Uganda
## 2014 97.18 64.16 93.17 100.00 36.79
## 2017 100.00 65.02 89.02 96.85 46.65
## 2021 96.53 76.80 96.37 100.00 54.26
setwd('C:/Users/zangz/Downloads/P_Data_Extract_From_World_Development_Indicators')
more <- read.csv("more.csv")
library(tidyverse)
more<- more %>%
filter(Country.Name == "Uganda" | Country.Name == "Sweden" | Country.Name == "Spain"| Country.Name == "Saudi Arabia"| Country.Name == "New Zealand")
rel_col <- which(colnames(more)=="Country.Name" | colnames(more)== "X2014..YR2014." | colnames(more)== "X2017..YR2017." | colnames(more) == "X2021..YR2021." )
rel_col
## [1] 3 8 11 15
more <- more[rel_col] %>% rename("2014" = 2, "2017" = 3, "2021" = 4)
head(more)
## Country.Name 2014 2017 2021
## 1 New Zealand 99.76 99.05 99.1
## 2 Saudi Arabia 70.87 72.65 74.22
## 3 Spain 98.09 95.84 98.8
## 4 Sweden 99.83 100 99.67
## 5 Uganda 56.86 76.88 76.35
transpose_m <- data.frame(t(more[-1]))
colnames(transpose_m) <- more[, 1]
transpose_m$"New Zealand" = as.numeric(transpose_m$"New Zealand")
transpose_m$"Saudi Arabia" = as.numeric(transpose_m$"Saudi Arabia")
transpose_m$Spain = as.numeric(transpose_m$Spain)
transpose_m$Sweden = as.numeric(transpose_m$Sweden)
transpose_m$ Uganda = as.numeric(transpose_m$ Uganda)
head(transpose_m)
## New Zealand Saudi Arabia Spain Sweden Uganda
## 2014 99.76 70.87 98.09 99.83 56.86
## 2017 99.05 72.65 95.84 100.00 76.88
## 2021 99.10 74.22 98.80 99.67 76.35
transpose_m <- rename(transpose_m, "New_Zealand_m" = 1, "Saudi_Arabia_m" = 2, "Spain_m" = 3,"Sweden_m" = 4,"Uganda_m" = 5)
transpose_l <- rename(transpose_l, "New_Zealand" = 1, "Saudi_Arabia" = 2, "Spain" = 3,"Sweden" = 4,"Uganda" = 5)
head(transpose_m)
## New_Zealand_m Saudi_Arabia_m Spain_m Sweden_m Uganda_m
## 2014 99.76 70.87 98.09 99.83 56.86
## 2017 99.05 72.65 95.84 100.00 76.88
## 2021 99.10 74.22 98.80 99.67 76.35
transpose_l <- rename(transpose_l, "New_Zealand" = 1, "Saudi_Arabia" = 2, "Spain" = 3,"Sweden" = 4,"Uganda" = 5)
transpose_m <- rownames_to_column(transpose_m, var="Year")
transpose_l <- rownames_to_column(transpose_l, var="Year")
head(transpose_m)
## Year New_Zealand_m Saudi_Arabia_m Spain_m Sweden_m Uganda_m
## 1 2014 99.76 70.87 98.09 99.83 56.86
## 2 2017 99.05 72.65 95.84 100.00 76.88
## 3 2021 99.10 74.22 98.80 99.67 76.35
head(transpose_l)
## Year New_Zealand Saudi_Arabia Spain Sweden Uganda
## 1 2014 97.18 64.16 93.17 100.00 36.79
## 2 2017 100.00 65.02 89.02 96.85 46.65
## 3 2021 96.53 76.80 96.37 100.00 54.26
acct_owner_by_education <- merge(x = transpose_m, y = transpose_l, by = "Year", all.x = TRUE)
acct_owner_by_education <- rename(acct_owner_by_education, "Uganda" = 11)
head(acct_owner_by_education)
## Year New_Zealand_m Saudi_Arabia_m Spain_m Sweden_m Uganda_m New_Zealand
## 1 2014 99.76 70.87 98.09 99.83 56.86 97.18
## 2 2017 99.05 72.65 95.84 100.00 76.88 100.00
## 3 2021 99.10 74.22 98.80 99.67 76.35 96.53
## Saudi_Arabia Spain Sweden Uganda
## 1 64.16 93.17 100.00 36.79
## 2 65.02 89.02 96.85 46.65
## 3 76.80 96.37 100.00 54.26
gfg_plot <- ggplot(acct_owner_by_education, aes(x=Year)) +
geom_line(aes(y =Spain_m), color = "black")+
geom_line(aes(y =Spain), color = "yellow")+
geom_line(aes(y =New_Zealand), color = "pink")+
geom_line(aes(y =New_Zealand_m), color = "purple") +
geom_line(aes(y =Saudi_Arabia_m), color = "red")+
geom_line(aes(y =Saudi_Arabia), color = "violet")+
geom_line(aes(y =Sweden_m), color = "gold")+
geom_line(aes(y =Sweden), color = "blue")+
geom_line(aes(y =Uganda_m), color = "green")+
geom_line(aes(y =Uganda), color = "white")
gfg_plot
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
There is a increasing trend on the account percentages if we ignore 2017’s data. And it is clear that the percentage ownership of primary education or less are less than those who have secondary education or more. There is a positive relation between education level and Account ownership at a financial institution or with a mobile-money-service provider. Also, developing countries have less percentage ownership than developed countries. We could also say that there is a positive relation between country’s devolving status and percentage ownership.