[This analysis utilises the Armed Conflict Location & Event Data Project (ACLED) conducts an aggregate summary of conflict events and ssociated fatalities with data available from: https://acleddata.com ]
The ACLED conflict events and associated fatalities for 16 SADC countries (Angola, Botswana, Comoros, DR Congo, Eswatini, Lesotho, Madagascar, Malawi, Mauritius, Mozambique, Namibia, Seychelles, South Africa, Tanzania, Zambia, and Zimbabwe) from January 2000 until December 2023. Using ggplot2, leaflet, sf, tmap, shows that the recent distribution of conflict events dominant in DRC (4043 events in 2022), South Africa (2078 events in 2022) and Mozambique (619 events in 2022) respectively. The cumulative distribution of conflict events however, shows the most conflictual countries as DRC , South Africa and Zimbabwe. Out of a total of 63513 conflict events between 2000 and 2022 the distribution was as follows: DRC (26413 events) , South Africa (17835 events) and Zimbabwe (6230 events).
library(sf) # for reading shape files,
## Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(tmap) # for static and interactive maps,
## Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
## remotes::install_github('r-tmap/tmap')
library(leaflet) # for interactive maps
library(tidyverse) # for visualisation ggplot rendering is in here
## ── 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.4.4 ✔ 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
# load the country shape file using updated file path
world_shape <- st_read("World_Countries_Generalized.shp")
## Reading layer `World_Countries_Generalized' from data source
## `/Users/kudzanaitsunga/Library/CloudStorage/OneDrive-Personal/office/1 Stat/twenty3_GIS/code_in_action/series_visual/World_Countries_Generalized.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 251 features and 7 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -89 xmax: 180 ymax: 83.6236
## Geodetic CRS: WGS 84
sadc_annual <- read.csv("analyse_sadc_long_2022.csv")
# rename column to country to enable leftjoin function
sadc_long_map <- sadc_annual %>% rename(COUNTRY = country)
# change DRC name from DR Congo to Congo DRC for mapping purposes
sadc_long_map <- sadc_long_map %>%
mutate(COUNTRY = ifelse(COUNTRY == "DR Congo", "Congo DRC", COUNTRY))
sadc_long_map <- left_join(world_shape, sadc_long_map, by = "COUNTRY")
sadc_long_map <- sadc_long_map %>% filter(!is.na(sadc_long_map$year)) # filter and remove by variable of interest
# remove the FID column to keep the first column as country name
sadc_long_map$FID <- NULL
# visualise the economic data for 2022
sadc_long_map2022 <- sadc_long_map %>% filter(year == 2022)
tmap_mode("view")
## tmap mode set to interactive viewing
tm_shape(sadc_long_map2022) +
tm_polygons("acled_events") +
tm_layout(title = "Total SADC ACLED Events 2022")
ggplot(data = sadc_annual) +
geom_bar(mapping = aes(x = country, y = acled_events, fill = factor(year)), stat = "identity") +
scale_fill_discrete(name = "Year") + # Add a legend for the year
theme(axis.text.x = element_text(angle = 45, hjust = 1)) + # Rotate x-axis labels by 45 degrees
labs(title = "SADC Annual ACLED Events by Country") +
guides(fill = FALSE) # Remove the legend
## Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
## of ggplot2 3.3.4.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
# Add a title
sum(sadc_annual$acled_events)
## [1] 63513
sadc_annual %>% filter(country == "DR Congo") %>% select(acled_events) %>% sum() # DRC
## [1] 26413
sadc_annual %>% filter(country == "South Africa") %>% select(acled_events) %>% sum() # SA
## [1] 17835
sadc_annual %>% filter(country == "Zimbabwe") %>% select(acled_events) %>% sum() # Zim
## [1] 6230
While the conflict incidences were concentrated in three countries, the overall trend has been rising, but, the most notable feature is the resultant fatalities. Between 2000-2004 and 2009-2010 had the highest divergence of the conflict events and resultant fatalities, however, the relationships across the region is strong ad positive (correlation coefficient of 0.31657) and a linear estimation confirms the relationship. Country-level analysis will shed more light on the causes of the spikes in events, fatalities, geolocation, as well as exploration of non-linearity of relationships and with macroeconomic variables.
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## [1] 0.3165717
## [1] 3.998914e-08
##
## Call:
## lm(formula = log(sadc_fatalities) ~ log(sadc_events), data = sadc_series)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.7496 -0.5235 -0.0883 0.4432 3.9882
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.4435 0.3388 1.309 0.192
## log(sadc_events) 0.9156 0.0651 14.064 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9883 on 286 degrees of freedom
## Multiple R-squared: 0.4088, Adjusted R-squared: 0.4068
## F-statistic: 197.8 on 1 and 286 DF, p-value: < 2.2e-16