Political Map of Somalia
Somalia has faced various challenges over the years, including political instability, violence, and conflict. This analysis aims to explore the dynamics of these events using data from the Armed Conflict Location & Event Data Project (ACLED). By examining the data, we seek to uncover trends in conflict and violence, the distribution of events across different regions, and the actors most involved in these incidents.
The first step for this analysis is to load the libarary packages that will be used throughout the process. The packages are:
tidyverse = Includes the packages that are use in everyday data analyses, such as ggplot2, dplyr, and readr to name a few. Additional details can be found at This Site
here = Enables easy file referencing in project-oriented workflows. Additional details can be found at This Site
RColorBrewer = Provides color schemes for maps (and other graphics) designed by Cynthia Brewer. Aditional information on this package can be found at This Site
gganimate = The grammar of graphics as implemented in the ‘ggplot2’ package has been successful in providing a powerful API for creating static visualisation. Additional information can be located at This Site
library(tidyverse)
library(here)
library(RColorBrewer)
library(gganimate)
The dataset spans from 2004 to 2024, including over 80,000 recorded events in Somalia. These events range from battles and violence against civilians to protests and riots. For the purpose of this analysis, we focus on key variables such as event type, location, fatalities, and involved actors.
# Load the data for use.
SomaliaACLED <- read_csv(here("data","ACLED 2004 01 01 - 2024 01 01 - Somalia.csv"))
# Convert event_date to Date type format for analysis use.
SomaliaACLED$event_date <- as.Date(SomaliaACLED$event_date, format = "%d-%b-%y")
Now that the data has been read, let’s examine the information that will be used for analysis.
glimpse(SomaliaACLED)
## Rows: 80,611
## Columns: 32
## $ event_id_cnty <chr> "SOM43226", "SOM43226", "SOM43228", "SOM43228", "SO…
## $ event_date <date> 2024-01-01, 2024-01-01, 2024-01-01, 2024-01-01, 20…
## $ year <dbl> 2024, 2024, 2024, 2024, 2024, 2024, 2024, 2024, 202…
## $ time_precision <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ disorder_type <chr> "Political violence", "Political violence", "Politi…
## $ event_type <chr> "Explosions/Remote violence", "Explosions/Remote vi…
## $ sub_event_type <chr> "Air/drone strike", "Air/drone strike", "Attack", "…
## $ actor1 <chr> "Military Forces of the United States (2021-)", "Al…
## $ assoc_actor_1 <chr> NA, NA, NA, "Labor Group (Somalia)", NA, NA, "Milit…
## $ inter1 <dbl> 8, 2, 2, 7, 2, 1, 8, 2, 2, 2, 1, 1, 2, 2, 1, 2, 1, …
## $ interaction <dbl> 28, 28, 27, 27, 12, 12, 28, 28, 20, 12, 12, 12, 12,…
## $ civilian_targeting <chr> NA, NA, "Civilian targeting", "Civilian targeting",…
## $ iso <dbl> 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 7…
## $ region <chr> "Eastern Africa", "Eastern Africa", "Eastern Africa…
## $ country <chr> "Somalia", "Somalia", "Somalia", "Somalia", "Somali…
## $ admin1 <chr> "Bakool", "Bakool", "Bay", "Bay", "Hiraan", "Hiraan…
## $ admin2 <chr> "Xudur", "Xudur", "Diinsoor", "Diinsoor", "Belet We…
## $ admin3 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ location <chr> "Hudur", "Hudur", "Buulo Cadey", "Buulo Cadey", "Be…
## $ latitude <dbl> 4.1237, 4.1237, 2.4978, 2.4978, 4.7360, 4.7360, 0.0…
## $ longitude <dbl> 43.8915, 43.8915, 42.8275, 42.8275, 45.2043, 45.204…
## $ geo_precision <dbl> 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, …
## $ source <chr> "Radio Kulmiye", "Radio Kulmiye", "Undisclosed Sour…
## $ source_scale <chr> "National", "National", "Local partner-Other", "Loc…
## $ notes <chr> "On 1 January 2024, US forces conducted an airstrik…
## $ fatalities <dbl> 20, 20, 1, 1, 0, 0, 6, 6, 0, 0, 0, 46, 46, 0, 0, 0,…
## $ tags <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ timestamp <dbl> 1704766941, 1704766941, 1704766941, 1704766941, 170…
## $ population_1km <dbl> 2127, 2127, 144, 144, 5535, 5535, 9245, 9245, 5766,…
## $ population_2km <dbl> 7136, 7136, 221, 221, 19165, 19165, 26918, 26918, 4…
## $ population_5km <dbl> 9661, 9661, 1047, 1047, 24229, 24229, 30959, 30959,…
## $ population_best <dbl> 9661, 9661, 1047, 1047, 24229, 24229, 30959, 30959,…
From here, we can see the various attributes such as event date, event type, and casualty numbers to name a few. This specific dataset for this analysis focuses on Somalia, covering events from January 1, 2004, to January 1, 2024. The dataset contains over 80,000 events recorded during this period, providing a rich source for understanding the dynamics of conflict and violence in Somalia.
The dataset includes several key variables that are utilized throughout the analysis to draw insights into the conflict situation in Somalia:
event_date: The date when an event occurred. This variable is crucial for any time-series analysis, allowing us to observe how events have evolved over time.
year: Extracted from event_date, it’s used to aggregate data annually, making it easier to identify long-term trends.
event_type: This categorizes the nature of each event (e.g., battles, violence against civilians, protests, and riots), enabling a comparative analysis of different types of conflict and violence.
sub_event_type: Offers a more detailed classification of each event, providing deeper insights into the specific nature of the conflict or protest.
actor1: The main actor involved in the event. This variable helps identify the most active groups or forces in the conflict.
location, latitude, longitude: These geographical details allow for mapping the distribution of events, highlighting areas with higher concentrations of violence or protests.
fatalities: The number of fatalities resulting from each event. This is a critical variable for assessing the human impact of the conflict.
We begin by examining how the occurrence of different event types has evolved over the years. The “Trends in Conflict and Violence” analysis within the context of the ACLED data for Somalia is aimed at understanding how the occurrence and nature of conflict and violence have evolved over time. This analysis specifically focuses on identifying patterns, increases, decreases, or notable changes in the types of events reported over the years, from 2004 to 2024. The primary objective is to visualize and interpret trends in different types of conflict-related events, such as battles, violence against civilians, protests, and riots. By doing so, the analysis seeks to provide insights into periods of heightened conflict, potential escalations in violence, and any shifts in the nature of conflict over the two-decade span covered by the dataset.
Using ggplot2, a line plot is created to visualize these trends. Each line in the plot represents a different event type, with the x-axis showing time (years) and the y-axis showing the count of events. This visual representation makes it easier to spot trends, such as increases in particular types of violence or periods of relative calm.
NOTE: The drop off at the end of the graph is due to few events in 2024 when the ACLED data was pulled.
events_over_time <- SomaliaACLED %>%
group_by(year, event_type) %>%
summarise(count = n(), .groups = 'drop')
ggplot(events_over_time, aes(x = year, y = count, color = event_type)) +
geom_line() +
scale_color_brewer(palette = "Dark2") +
labs(x = "Year", y = "Count of Events", title = "Distribution of Event Types Over the Years", color = "Event Type") +
theme_minimal()
The “Events in Somalia Over Time by Type” analysis aims to dissect the evolution of conflict and protest events in Somalia, categorizing these events by their types to identify trends and shifts in the nature of occurrences over a specified period. This analysis uses data from the Armed Conflict Location & Event Data Project (ACLED), focusing on categorizing and visualizing the frequency of various event types (such as battles, violence against civilians, protests, and riots) across the years. The main goal of this analysis is to illustrate how different types of conflict and protest events have changed in frequency over time in Somalia. By doing so, it seeks to provide insights into the dynamics of conflict, highlighting periods of increased activity for certain types of events and potentially correlating these changes with broader socio-political developments.
The aggregated data is visualized using a line plot or stacked area chart, with the x-axis representing time (years) and the y-axis representing the count of events. Different colors or lines represent different event types, making it easier to compare trends across categories.By observing the changes in the lines or areas corresponding to each event type, analysts can identify trends, such as increasing battles or decreasing protests, over the observed period. This can highlight shifts in the nature of conflict and social unrest in Somalia.
# Time Series Plot: Events over Time by Type
ggplot(SomaliaACLED, aes(x = event_date, fill = event_type)) +
geom_histogram(binwidth = 30, position = "stack") +
scale_fill_brewer(palette = "Set3") +
labs(x = "Date", y = "Count of Events", title = "Events in Somalia Over Time by Type", fill = "Event Type") +
theme_minimal()
The distribution of events across Somalia’s regions highlights areas with higher frequencies of conflict and violence. The “Regional Distribution of Events” analysis within the ACLED dataset for Somalia focuses on understanding how conflict events are geographically spread across the country. This analysis aims to identify regions that are more prone to certain types of conflict and violence, providing a spatial dimension to the understanding of conflict dynamics in Somalia. The primary goal of this analysis is to map the frequency of different types of conflict-related events (e.g., battles, violence against civilians, protests) across Somalia’s administrative regions. By doing so, it seeks to uncover geographic patterns in the distribution of conflict, highlighting areas of high activity and potentially uncovering regional dynamics that influence the occurrence of these events.
Utilizing ggplot2, faceted plots (also known as small multiples) are created to visualize the data. Each facet represents a different region, and within each facet, events are categorized by type. This approach allows for a direct comparison across regions, highlighting differences in the types and frequencies of conflict events.
events_by_region <- SomaliaACLED %>%
group_by(admin1, event_type) %>%
summarise(count = n(), .groups = 'drop')
ggplot(events_by_region, aes(x = event_type, y = count, fill = event_type)) +
geom_bar(stat = "identity", position = "dodge") +
facet_wrap(~admin1) +
scale_fill_brewer(palette = "Paired") +
labs(x = "Event Type", y = "Count of Events", title = "Frequency of Events by Region") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Next, we explore the impact of these events in terms of fatalities, comparing different event types. The “Fatalities by Event Type” analysis is a crucial part of understanding the human impact of different forms of conflict and violence in Somalia, using the ACLED dataset. This analysis specifically examines the number of fatalities associated with various event types (such as battles, violence against civilians, protests, and riots) to assess which types of events are most lethal and how the severity of these events varies. The main goal of this analysis is to quantify and compare the human toll of different types of conflict-related events in Somalia. By doing so, it aims to highlight the most deadly forms of violence, thereby providing insights into the nature of the conflict and guiding humanitarian response and policy formulation.
A box plot is used to visualize these summaries, with each box representing the distribution of fatalities for a different event type. The y-axis represents the number of fatalities (often on a logarithmic scale to manage wide ranges in the data), while the x-axis categorizes the events. Box plots show the median, interquartile range, and any outliers, providing a clear visual comparison of the lethality of different event types.
ggplot(SomaliaACLED, aes(x = event_type, y = fatalities)) +
geom_boxplot() +
scale_y_log10() +
scale_fill_brewer(palette = "Set1") +
labs(x = "Event Type", y = "Fatalities (log scale)", title = "Comparison of Fatalities by Event Type") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
## Warning in scale_y_log10(): log-10 transformation introduced infinite values.
## Warning: Removed 45915 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
Next, we look at how the number of fatalities has changed over time, indicating periods of heightened conflict. The “Trend of Fatalities Over Time” analysis using the ACLED (Armed Conflict Location & Event Data Project) data for Somalia focuses on examining how the number of fatalities resulting from conflict-related events has changed over the years. This analysis aims to provide a temporal view of the human cost of conflicts and violence in Somalia, highlighting periods of increased lethality and potential trends that could inform future predictions and interventions. The primary goal is to assess the trend of conflict-related fatalities over time, identifying years or periods with significant spikes or declines in deaths. This insight helps in understanding the intensity of conflict over time, guiding humanitarian, peacekeeping, and policy efforts to mitigate violence.
A line plot is typically used to visualize the trend of fatalities over time, with years on the x-axis and the total number of fatalities on the y-axis. This visual representation makes it easier to identify patterns, such as periods of increasing or decreasing fatalities.To smooth out yearly fluctuations and highlight long-term trends, a trend line (often using methods like LOESS - Locally Estimated Scatterplot Smoothing) can be added to the plot. This smoothed line helps in discerning underlying trends amid the annual variance.
NOTE: The drop off at the end of the graph is due to few events in 2024 when the ACLED data was pulled.
fatalities_over_time <- SomaliaACLED %>%
group_by(year) %>%
summarise(total_fatalities = sum(fatalities, na.rm = TRUE), .groups = 'drop')
ggplot(fatalities_over_time, aes(x = year, y = total_fatalities)) +
geom_line() +
geom_smooth(method = "loess", color = "blue", fill = "lightblue")
## `geom_smooth()` using formula = 'y ~ x'
Finally, the “Geographic Distribution of Fatalities in Somalia” analysis aims to map and understand where the most lethal incidents have occurred within the country, using data from the Armed Conflict Location & Event Data Project (ACLED). This analysis focuses on the spatial aspect of conflict-related fatalities, highlighting areas that have experienced higher levels of violence and loss of life. By examining the geographic distribution of fatalities, stakeholders can identify hotspots of lethal violence, potentially informing targeted interventions and policies to address and mitigate conflict in those areas. The primary goal of this analysis is to visualize the geographic locations within Somalia where conflict-related events have resulted in fatalities, identifying regions with particularly high death tolls. This insight is crucial for understanding the uneven impact of conflict across the country and can guide humanitarian aid, security measures, and peace-building efforts.
Using mapping tools or geographic plotting capabilities in R (such as ggplot2 with geom_point), the aggregated data is visualized on a map of Somalia. Points are plotted at the locations of events, with the size and/or color of each point indicating the total number of fatalities at that location. This visual representation highlights areas with higher concentrations of lethal violence. By examining the map, analysts can identify hotspots of conflict-related fatalities—areas where points are larger or more intensely colored, indicating higher numbers of deaths. These hotspots may correspond to regions with ongoing conflicts, areas lacking in security presence, or locations with particular strategic or economic significance.
# Load the data for use.
SomaliaACLED <- read_csv(here("data","ACLED 2004 01 01 - 2024 01 01 - Somalia.csv"))
## Rows: 80611 Columns: 32
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (17): event_id_cnty, event_date, disorder_type, event_type, sub_event_ty...
## dbl (14): year, time_precision, inter1, interaction, iso, latitude, longitud...
## lgl (1): admin3
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Convert event_date to Date type format for analysis use.
SomaliaACLED$event_date <- as.Date(SomaliaACLED$event_date, format = "%d-%b-%y")
# Map: Geographic Distribution of Fatalities
somalia_map_data <- SomaliaACLED %>%
group_by(latitude, longitude) %>%
summarize(total_fatalities = sum(fatalities, na.rm = TRUE))
## `summarise()` has grouped output by 'latitude'. You can override using the
## `.groups` argument.
ggplot(somalia_map_data, aes(x = longitude, y = latitude, size = total_fatalities)) +
geom_point(alpha = 0.5, color = "red") +
labs(x = "Longitude", y = "Latitude", size = "Total Fatalities", title = "Geographic Distribution of Fatalities in Somalia") +
theme_minimal()
The comprehensive analysis of the Armed Conflict Location & Event Data Project (ACLED) data for Somalia, spanning from 2004 to 2024, offers invaluable insights into the complex dynamics of conflict and violence within the country. Through a series of meticulously conducted analyses—ranging from the examination of trends in conflict events over time, the assessment of fatalities by event type, the exploration of regional distributions of events, to the mapping of the geographic distribution of fatalities—we have uncovered critical patterns and trends that characterize the landscape of conflict in Somalia.
Some potential findings include:
Trends in Conflict and Violence: The analysis revealed fluctuations in the frequency and types of conflict events over the years, highlighting periods of intensified violence and shifts in the nature of conflict. Such trends provide a temporal context to Somalia’s conflict, illustrating the evolving challenges faced by the country.
Fatalities by Event Type: The stark differences in the lethality of various event types underscore the diverse nature of violence in Somalia. Understanding which types of events are most deadly helps prioritize efforts to prevent and mitigate the most harmful forms of conflict.
Regional Distribution of Events: The uneven distribution of conflict events across Somalia’s regions indicates localized hotspots of violence. This insight is crucial for directing targeted interventions and resources to areas most afflicted by conflict.
Geographic Distribution of Fatalities: The mapping of conflict-related fatalities highlighted specific locations with high concentrations of violence, offering a clear visual representation of the areas where conflict has been most lethal. These geographic insights are essential for planning effective security and humanitarian responses.
The ACLED data analysis provides a critical foundation for understanding conflict in Somalia, offering actionable insights for those committed to mitigating violence and supporting sustainable peace in the region. The complexity of conflict dynamics in Somalia requires a multifaceted and informed approach, where data-driven analyses such as this play a pivotal role in shaping effective responses and interventions.