Understanding the impact of conflict events on nighttime lights can provide valuable insights into how such events influence economic activity and infrastructure usage. This is particularly relevant for the conflict in Tigray, Ethiopia, which began in November 2020. By combining data on conflict events from the Armed Conflict Location & Event Data Project (ACLED) with nighttime lights data from the Black Marble satellite imagery, we can analyze the temporal and spatial dynamics of the conflict and its effects.
In this R Markdown document, we aim to:
By the end of this document, we aim to provide a comprehensive analysis of how conflict events in Tigray have influenced nighttime light patterns, offering valuable insights for humanitarian response and policy-making.
As always, let’s start by loading some libraries.
library(sf)
library(tidyverse)
library(raster)
library(nnet)
library(neuralnet)
library(pdp)
library(sjPlot)
library(e1071)
library(randomForest)
library(dplyr)
library(broom)
In this step, we read in a shapefile that contains geographic data about Ethiopia.
shape <- st_read("BM_Data/Time_Series_Ethiopia/Monthly/intersection.shp", quiet = T) |>
mutate(superpixel_id = 1:n())
df <- shape |>
dplyr::select(contains("Sigma"), superpixel_id) |>
st_drop_geometry() |>
as.data.frame() |>
pivot_longer(!superpixel_id, names_to = "Month", values_to = "NL")
The data are Black Marble nighttime lights data, sigma stacked by month to enhance the SNR and remove outliers.
df <- df %>%
mutate(MonthYear = case_when(
Month == "SigmaClipp" ~ "November 2020",
Month == "SigmaCli_1" ~ "December 2020",
Month == "SigmaCli_2" ~ "January 2021",
Month == "SigmaCli_3" ~ "February 2021",
Month == "SigmaCli_4" ~ "March 2021",
Month == "SigmaCli_5" ~ "April 2021",
Month == "SigmaCli_6" ~ "May 2021",
Month == "SigmaCli_7" ~ "June 2021",
Month == "SigmaCli_8" ~ "July 2021",
Month == "SigmaCli_9" ~ "August 2021",
Month == "SigmaCli10" ~ "September 2021",
Month == "SigmaCli11" ~ "October 2021",
Month == "SigmaCli12" ~ "November 2021",
Month == "SigmaCli13" ~ "December 2021",
Month == "SigmaCli14" ~ "January 2022",
Month == "SigmaCli15" ~ "February 2022",
Month == "SigmaCli16" ~ "March 2022",
Month == "SigmaCli17" ~ "April 2022",
Month == "SigmaCli18" ~ "May 2022",
Month == "SigmaCli19" ~ "June 2022",
Month == "SigmaCli20" ~ "July 2022",
Month == "SigmaCli21" ~ "August 2022",
Month == "SigmaCli22" ~ "September 2022",
Month == "SigmaCli23" ~ "October 2022",
TRUE ~ Month
)) %>%
separate(MonthYear, into = c("Month", "Year"), sep = " ") |>
mutate(Year = as.numeric(Year))
Finally, we merge the transformed data back with the original shapefile to prepare it for spatial and temporal analysis.
shape <- shape |>
dplyr::select(superpixel_id)
shape <- merge(shape, df)
By processing the data in this manner, we prepare it for subsequent analysis, allowing us to explore the temporal changes in nighttime lights and their relationship with conflict events in Tigray.
First, we extract the geographic boundaries of the Tigray region from a shapefile. This step ensures that our analysis focuses specifically on the Tigray region, where the conflict has had significant impacts.
Tigray <- st_read("Main_data/Ethiopia/adm1/eth_admbnda_adm1_csa_bofedb_2021.shp", quiet = T) |>
filter(ADM1_EN == "Tigray")
Next, we transform the coordinate reference system (CRS) of our conflict data to match that of the Tigray shapefile. We then extract the nighttime lights data that falls within the boundaries of Tigray.
Conflict_data <- st_transform(shape, st_crs(Tigray))
Tigray_Conflict_data <- Conflict_data[st_within(Conflict_data, Tigray, sparse = FALSE), ]
We now visualize the changes in nighttime lights in Tigray over different years and months to understand how the conflict has impacted economic activity and infrastructure usage.
Yearly Visualization
This plot shows the log-transformed nighttime lights in Tigray for each year, providing a high-level view of changes over time.
yearly <- ggplot(Tigray_Conflict_data) +
geom_sf(aes(fill = log(NL))) +
facet_wrap("Year") +
labs(title = "",
fill = "Log NL") +
scale_fill_viridis_c(option = "turbo", na.value = "lightgrey") + # Use turbo option
theme_minimal()
yearly
ggsave("Plots/yearly_conflict.pdf", plot = yearly, width = 5, height = 3)
Monthly and Yearly Visualization
This plot provides a more granular view by showing the log-transformed nighttime lights in Tigray for each month and year, allowing us to observe more detailed temporal changes.
all <- ggplot(Tigray_Conflict_data) +
geom_sf(aes(fill = log(NL))) +
facet_wrap(~ Month + Year, ncol = 4) + # Updated for correct facet syntax
labs(title = "", fill = "Log NL") +
scale_fill_viridis_c(option = "turbo", na.value = "lightgrey") +
theme_minimal() +
theme(
axis.title.x = element_blank(), # Remove x axis label
axis.title.y = element_blank(), # Remove y axis label
axis.text.x = element_blank(), # Remove x axis ticks (values)
axis.text.y = element_blank(), # Remove y axis ticks (values)
strip.background = element_blank(), # Optional: remove facet label background
strip.text.x = element_text(size = 10), # Optional: adjust facet label size for x
strip.text.y = element_text(size = 10) # Optional: adjust facet label size for y
)
ggsave("Plots/month_year_conflict.pdf", plot = all, width = 8, height = 11)
These visualizations help us understand the temporal and spatial dynamics of nighttime lights in Tigray, providing insights into how the conflict has influenced luminosity over time.
The Armed Conflict Location & Event Data Project (ACLED)[https://epo.acleddata.com/tigray-conflict/] provides detailed data on conflict events, which we can use to analyze the intensity and impact of the Tigray conflict. We will integrate this data with our nighttime lights dataset to understand the relationship between conflict events and changes in nighttime lights.
Loading and Preparing ACLED Data
We start by loading the ACLED data, filtering for conflict events that occurred between November 2020 and November 2022, and focusing specifically on battles.
library(readxl)
library(lubridate)
Battle_Data <- read_excel("Main_data/Ethiopia/Conflict/Ethiopia_1997-2023_Dec08.xlsx") |>
filter(EVENT_DATE > as.Date("2020-11-02") & EVENT_DATE < as.Date("2022-11-03")) |>
filter(EVENT_TYPE == "Battles")
glimpse(Battle_Data)
## Rows: 1,932
## Columns: 31
## $ EVENT_ID_CNTY <chr> "ETH9330", "ETH9338", "ETH9339", "ETH9340", "ETH934…
## $ EVENT_DATE <dttm> 2022-11-02, 2022-11-02, 2022-11-02, 2022-11-02, 20…
## $ YEAR <dbl> 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 202…
## $ TIME_PRECISION <dbl> 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ DISORDER_TYPE <chr> "Political violence", "Political violence", "Politi…
## $ EVENT_TYPE <chr> "Battles", "Battles", "Battles", "Battles", "Battle…
## $ SUB_EVENT_TYPE <chr> "Armed clash", "Non-state actor overtakes territory…
## $ ACTOR1 <chr> "OLF: Oromo Liberation Front (Shane Splinter Factio…
## $ ASSOC_ACTOR_1 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ INTER1 <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, …
## $ ACTOR2 <chr> "Military Forces of Ethiopia (2018-)", "Police Forc…
## $ ASSOC_ACTOR_2 <chr> "Police Forces of Ethiopia (2018-2023) Oromo Region…
## $ INTER2 <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, …
## $ INTERACTION <dbl> 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,…
## $ CIVILIAN_TARGETING <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ ISO <dbl> 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 2…
## $ REGION <chr> "Eastern Africa", "Eastern Africa", "Eastern Africa…
## $ COUNTRY <chr> "Ethiopia", "Ethiopia", "Ethiopia", "Ethiopia", "Et…
## $ ADMIN1 <chr> "Oromia", "Oromia", "Oromia", "Oromia", "Oromia", "…
## $ ADMIN2 <chr> "West Wellega", "West Wellega", "West Wellega", "We…
## $ ADMIN3 <chr> "Nejo town", "Babo", "Haru", "Homa", "Jarso", "Gimb…
## $ LOCATION <chr> "Nejo", "Debeka", "Haru Town", "Homa town", "Were J…
## $ LATITUDE <dbl> 9.500, 9.467, 8.989, 9.079, 9.533, 9.283, 9.369, 9.…
## $ LONGITUDE <dbl> 35.500, 35.200, 35.799, 35.700, 35.233, 35.734, 35.…
## $ GEO_PRECISION <dbl> 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, …
## $ SOURCE <chr> "Oromiya Media Network", "Ethiopia Reporter", "Ethi…
## $ SOURCE_SCALE <chr> "International", "National", "National", "National"…
## $ NOTES <chr> "On 2 November 2022, OLF Shane clashed with ENDF an…
## $ FATALITIES <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, …
## $ TAGS <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "local administ…
## $ TIMESTAMP <dbl> 1690843497, 1690843497, 1690843497, 1690843497, 169…
Next, we convert the conflict event data to a spatial format and join it with our Tigray nighttime lights dataset to count the number of conflict events within each geographic area.
points_sf <- st_as_sf(Battle_Data, coords = c("LONGITUDE", "LATITUDE"), crs = 4326)
Tigray_Conflict_data <- Tigray_Conflict_data |>
mutate(ID = 1:n())
points_in_shapes <- st_join(points_sf, Tigray_Conflict_data)
# Count the number of points in each shape
count_per_shape <- points_in_shapes %>%
dplyr::select(EVENT_DATE, FATALITIES, ID) |>
na.omit() |>
st_drop_geometry() |>
as.data.frame() |>
mutate(
Month = month(EVENT_DATE, label = TRUE, abbr = FALSE), # Extract month as an abbreviated name
Year = year(EVENT_DATE) # Extract year
) %>%
group_by(Month, Year, ID) |>
summarise(Number_of_Battles = n()) |>
st_drop_geometry() |>
as.data.frame() |>
unique() |>
mutate(Year = as.numeric(Year))
Tigray_Conflict_data_ACLED <- left_join(Tigray_Conflict_data, count_per_shape)
Tigray_Conflict_data_ACLED <- Tigray_Conflict_data_ACLED |>
mutate(Number_of_Battles = ifelse(is.na(Number_of_Battles), 0, Number_of_Battles))
We then prepare the data for time series analysis by creating lag variables for the number of battles, allowing us to analyze the temporal relationship between conflict events and nighttime lights.
Tigray_Conflict_data_ACLED <- Tigray_Conflict_data_ACLED %>%
mutate(
Month = as.character(Month),
Date_String = paste(Month, "01", Year),
Date = mdy(Date_String)
) |>
group_by(superpixel_id) |>
arrange(Date) |> # Ensure the data is ordered by time
mutate(
lag1_Number_of_Battles = lag(Number_of_Battles, 1),
lag2_Number_of_Battles = lag(Number_of_Battles, 2),
lag3_Number_of_Battles = lag(Number_of_Battles, 3),
lag4_Number_of_Battles = lag(Number_of_Battles, 4)
)
By integrating the ACLED conflict data with our nighttime lights dataset and creating lag variables, we are well-prepared to analyze the impact of conflict events on nighttime lights in Tigray. This integration allows us to explore both the immediate and delayed effects of conflict on economic activity and infrastructure usage as reflected in nighttime light patterns.] provides detailed data on conflict events, which we can use to analyze the intensity and impact of the Tigray conflict. We will integrate this data with our nighttime lights dataset to understand the relationship between conflict events and changes in nighttime lights.
Loading and Preparing ACLED Data
We start by loading the ACLED data, filtering for conflict events that occurred between November 2020 and November 2022, and focusing specifically on battles.
library(readxl)
library(lubridate)
Battle_Data <- read_excel("Main_data/Ethiopia/Conflict/Ethiopia_1997-2023_Dec08.xlsx") |>
filter(EVENT_DATE > as.Date("2020-11-02") & EVENT_DATE < as.Date("2022-11-03")) |>
filter(EVENT_TYPE == "Battles")
glimpse(Battle_Data)
## Rows: 1,932
## Columns: 31
## $ EVENT_ID_CNTY <chr> "ETH9330", "ETH9338", "ETH9339", "ETH9340", "ETH934…
## $ EVENT_DATE <dttm> 2022-11-02, 2022-11-02, 2022-11-02, 2022-11-02, 20…
## $ YEAR <dbl> 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 202…
## $ TIME_PRECISION <dbl> 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ DISORDER_TYPE <chr> "Political violence", "Political violence", "Politi…
## $ EVENT_TYPE <chr> "Battles", "Battles", "Battles", "Battles", "Battle…
## $ SUB_EVENT_TYPE <chr> "Armed clash", "Non-state actor overtakes territory…
## $ ACTOR1 <chr> "OLF: Oromo Liberation Front (Shane Splinter Factio…
## $ ASSOC_ACTOR_1 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ INTER1 <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, …
## $ ACTOR2 <chr> "Military Forces of Ethiopia (2018-)", "Police Forc…
## $ ASSOC_ACTOR_2 <chr> "Police Forces of Ethiopia (2018-2023) Oromo Region…
## $ INTER2 <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, …
## $ INTERACTION <dbl> 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,…
## $ CIVILIAN_TARGETING <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ ISO <dbl> 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 2…
## $ REGION <chr> "Eastern Africa", "Eastern Africa", "Eastern Africa…
## $ COUNTRY <chr> "Ethiopia", "Ethiopia", "Ethiopia", "Ethiopia", "Et…
## $ ADMIN1 <chr> "Oromia", "Oromia", "Oromia", "Oromia", "Oromia", "…
## $ ADMIN2 <chr> "West Wellega", "West Wellega", "West Wellega", "We…
## $ ADMIN3 <chr> "Nejo town", "Babo", "Haru", "Homa", "Jarso", "Gimb…
## $ LOCATION <chr> "Nejo", "Debeka", "Haru Town", "Homa town", "Were J…
## $ LATITUDE <dbl> 9.500, 9.467, 8.989, 9.079, 9.533, 9.283, 9.369, 9.…
## $ LONGITUDE <dbl> 35.500, 35.200, 35.799, 35.700, 35.233, 35.734, 35.…
## $ GEO_PRECISION <dbl> 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, …
## $ SOURCE <chr> "Oromiya Media Network", "Ethiopia Reporter", "Ethi…
## $ SOURCE_SCALE <chr> "International", "National", "National", "National"…
## $ NOTES <chr> "On 2 November 2022, OLF Shane clashed with ENDF an…
## $ FATALITIES <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, …
## $ TAGS <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "local administ…
## $ TIMESTAMP <dbl> 1690843497, 1690843497, 1690843497, 1690843497, 169…
Next, we convert the conflict event data to a spatial format and join it with our Tigray nighttime lights dataset to count the number of conflict events within each geographic area.
points_sf <- st_as_sf(Battle_Data, coords = c("LONGITUDE", "LATITUDE"), crs = 4326)
Tigray_Conflict_data <- Tigray_Conflict_data |>
mutate(ID = 1:n())
points_in_shapes <- st_join(points_sf, Tigray_Conflict_data)
# Count the number of points in each shape
count_per_shape <- points_in_shapes %>%
dplyr::select(EVENT_DATE, FATALITIES, ID) |>
na.omit() |>
st_drop_geometry() |>
as.data.frame() |>
mutate(
Month = month(EVENT_DATE, label = TRUE, abbr = FALSE), # Extract month as an abbreviated name
Year = year(EVENT_DATE) # Extract year
) %>%
group_by(Month, Year, ID) |>
summarise(Number_of_Battles = n()) |>
st_drop_geometry() |>
as.data.frame() |>
unique() |>
mutate(Year = as.numeric(Year))
Tigray_Conflict_data_ACLED <- left_join(Tigray_Conflict_data, count_per_shape)
Tigray_Conflict_data_ACLED <- Tigray_Conflict_data_ACLED |>
mutate(Number_of_Battles = ifelse(is.na(Number_of_Battles), 0, Number_of_Battles))
We then prepare the data for time series analysis by creating lag variables for the number of battles, allowing us to analyze the temporal relationship between conflict events and nighttime lights.
Tigray_Conflict_data_ACLED <- Tigray_Conflict_data_ACLED %>%
mutate(
Month = as.character(Month),
Date_String = paste(Month, "01", Year),
Date = mdy(Date_String)
) |>
group_by(superpixel_id) |>
arrange(Date) |> # Ensure the data is ordered by time
mutate(
lag1_Number_of_Battles = lag(Number_of_Battles, 1),
lag2_Number_of_Battles = lag(Number_of_Battles, 2),
lag3_Number_of_Battles = lag(Number_of_Battles, 3),
lag4_Number_of_Battles = lag(Number_of_Battles, 4)
)
By integrating the ACLED conflict data with our nighttime lights dataset and creating lag variables, we are well-prepared to analyze the impact of conflict events on nighttime lights in Tigray. This integration allows us to explore both the immediate and delayed effects of conflict on economic activity and infrastructure usage as reflected in nighttime light patterns.
For the Tigray conflict case, we use a spatial lag model and a spatial error model. These models help us understand the spatial dependencies and autocorrelations in the nighttime lights data, providing more accurate insights into how conflict events impact economic activity and infrastructure.
Spatial Lag Model
The spatial lag model incorporates spatial dependency directly into the analytical framework, which is crucial for disentangling the spatial dependency of nighttime lights in a conflict setting.
\[ \begin{aligned} \log(\text{NL}) = \; \rho W \log(\text{NL}) + &\beta_1 \cdot \text{Number of Battles} \\ &+ \beta_2 \cdot \text{lag1 Number of Battles} \\ &+ \beta_3 \cdot \text{lag2 Number of Battles} \\ &+ \beta_4 \cdot \text{lag3 Number of Battles} \\ &+ \beta_5 \cdot \text{lag4 Number of Battles} \\ &+ \beta_6 \cdot \text{Year} \\ &+ \delta_{\text{Month}} \\ &+ \varepsilon \end{aligned} \]
In this model configuration, \(\rho W \log(\text{NL})\) signifies the spatial lag of the logarithm of nightlight intensity, representing the interconnectedness of spatial units. This term is pivotal for adjusting the influence of neighboring areas, reflecting the spatial autocorrelation inherent in geographical data. Each \(\beta\) coefficient quantifies the effect of its corresponding variable, such as the ‘Number of Battles’ and its historical lags, providing
insights into temporal impacts on nightlight intensity. Furthermore, the inclusion of \(\delta_{\text{Month}}\) and \(\beta_6 \cdot \text{Year}\) as fixed effects accounts for seasonal and annual variations, thereby enhancing the model’s accuracy in capturing complex spatial-temporal dynamics.
Spatial Error Model
The spatial error model incorporates error autocorrelation into the regression framework:
\[ \begin{aligned} \log(\text{NL}) = &\; \beta_1 \cdot \text{Number of Battles} \\ &+ \beta_2 \cdot \text{lag1 Number of Battles} \\ &+ \beta_3 \cdot \text{lag2 Number of Battles} \\ &+ \beta_4 \cdot \text{lag3 Number of Battles} \\ &+ \beta_5 \cdot \text{lag4 Number of Battles} \\ &+ \beta_6 \cdot \text{Year} \\ &+ \delta_{\text{Month}} \\ &+ u \\ u = &\; \lambda W u + \varepsilon \end{aligned} \]
This model addresses spatial autocorrelation in the residuals through the component \(u = \lambda W u + \varepsilon\), where \(u\) captures the spatially correlated error terms and \(\lambda\) quantifies the intensity of spatial dependence. This refinement is crucial for models where spatial processes significantly influence the dependent variable, as it corrects for potential biases that might distort the estimation of effects due to spatial error structures. This formulation provides a robust mechanism to control for unobserved spatial heterogeneity.
Linear Regression Models
First, we fit two linear regression models. The first model
(m1.lm
) includes the number of battles and their lagged
values, along with the date. The second model (m2.lm
)
includes the number of battles and their lagged values, along with month
and year as separate predictors.
m1.lm <- lm(log(NL) ~ Number_of_Battles +
lag1_Number_of_Battles +
lag2_Number_of_Battles +
lag3_Number_of_Battles +
lag4_Number_of_Battles +
Date, data= Tigray_Conflict_data_ACLED)
summary(m1.lm)
##
## Call:
## lm(formula = log(NL) ~ Number_of_Battles + lag1_Number_of_Battles +
## lag2_Number_of_Battles + lag3_Number_of_Battles + lag4_Number_of_Battles +
## Date, data = Tigray_Conflict_data_ACLED)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.95161 -0.11366 0.04707 0.11415 2.93983
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.754e+00 2.730e-01 -24.736 < 2e-16 ***
## Number_of_Battles -4.224e-02 9.740e-03 -4.336 1.46e-05 ***
## lag1_Number_of_Battles -1.486e-02 8.777e-03 -1.693 0.0905 .
## lag2_Number_of_Battles 2.110e-03 8.220e-03 0.257 0.7974
## lag3_Number_of_Battles -7.059e-05 7.716e-03 -0.009 0.9927
## lag4_Number_of_Battles 5.517e-02 6.543e-03 8.431 < 2e-16 ***
## Date 3.777e-04 1.438e-05 26.262 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2368 on 9353 degrees of freedom
## (1944 observations deleted due to missingness)
## Multiple R-squared: 0.07609, Adjusted R-squared: 0.07549
## F-statistic: 128.4 on 6 and 9353 DF, p-value: < 2.2e-16
m2.lm <- lm(log(NL) ~ Number_of_Battles +
lag1_Number_of_Battles +
lag2_Number_of_Battles +
lag3_Number_of_Battles +
lag4_Number_of_Battles +
Month +
Year, data= Tigray_Conflict_data_ACLED)
summary(m2.lm)
##
## Call:
## lm(formula = log(NL) ~ Number_of_Battles + lag1_Number_of_Battles +
## lag2_Number_of_Battles + lag3_Number_of_Battles + lag4_Number_of_Battles +
## Month + Year, data = Tigray_Conflict_data_ACLED)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.69912 -0.09458 -0.00453 0.07701 2.93355
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.675e+02 9.595e+00 -27.877 < 2e-16 ***
## Number_of_Battles -2.644e-02 8.311e-03 -3.181 0.00147 **
## lag1_Number_of_Battles -1.849e-02 7.483e-03 -2.472 0.01347 *
## lag2_Number_of_Battles -8.843e-03 7.004e-03 -1.263 0.20679
## lag3_Number_of_Battles -3.559e-03 6.570e-03 -0.542 0.58800
## lag4_Number_of_Battles 4.136e-02 5.567e-03 7.430 1.18e-13 ***
## MonthAugust -9.751e-03 9.333e-03 -1.045 0.29619
## MonthDecember -2.779e-01 1.170e-02 -23.747 < 2e-16 ***
## MonthFebruary -2.702e-01 1.162e-02 -23.249 < 2e-16 ***
## MonthJanuary -4.390e-01 1.163e-02 -37.755 < 2e-16 ***
## MonthJuly 7.349e-02 9.345e-03 7.864 4.12e-15 ***
## MonthJune -5.500e-02 9.333e-03 -5.893 3.92e-09 ***
## MonthMarch -2.379e-01 9.329e-03 -25.502 < 2e-16 ***
## MonthMay 2.215e-02 9.320e-03 2.377 0.01749 *
## MonthNovember -1.209e-01 1.169e-02 -10.339 < 2e-16 ***
## MonthOctober -5.671e-02 9.330e-03 -6.078 1.26e-09 ***
## MonthSeptember -3.009e-02 9.338e-03 -3.223 0.00127 **
## Year 1.326e-01 4.747e-03 27.930 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2008 on 9342 degrees of freedom
## (1944 observations deleted due to missingness)
## Multiple R-squared: 0.3359, Adjusted R-squared: 0.3347
## F-statistic: 278 on 17 and 9342 DF, p-value: < 2.2e-16
Spatial Regression Models
Next, we fit spatial regression models to account for spatial dependencies. We create a neighbors list and a spatial weights matrix, which are used in the spatial lag and error models.
# Load necessary libraries
library(spdep)
library(sf)
library(spatialreg)
Tigray_Conflict_data_Acled_SR <- Tigray_Conflict_data_ACLED |>
dplyr::select(c(NL,
Month,
Year,
Number_of_Battles,
lag1_Number_of_Battles,
lag2_Number_of_Battles,
lag3_Number_of_Battles,
lag4_Number_of_Battles)) |>
na.omit() |>
mutate(Log_NL = log(NL)) |>
mutate(across(where(is.numeric), ~na_if(., -Inf))) |>
dplyr::select(-NL) |>
na.omit()
# Create a neighbors list
neighbors <- poly2nb(Tigray_Conflict_data_Acled_SR)
# Create a spatial weights matrix
weights <- nb2listw(neighbors, style = "W", zero.policy = TRUE)
Spatial Lag Model
# Run a spatial lag model
model_spatial_lag <- lagsarlm(Log_NL ~ Number_of_Battles +
lag1_Number_of_Battles +
lag2_Number_of_Battles +
lag3_Number_of_Battles +
lag4_Number_of_Battles +
Month +
Year,
data = Tigray_Conflict_data_Acled_SR,
listw = weights)
# View the summary of the model
summary(model_spatial_lag)
##
## Call:lagsarlm(formula = Log_NL ~ Number_of_Battles + lag1_Number_of_Battles +
## lag2_Number_of_Battles + lag3_Number_of_Battles + lag4_Number_of_Battles +
## Month + Year, data = Tigray_Conflict_data_Acled_SR, listw = weights)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.6721555 -0.0886369 0.0014558 0.0811651 2.4879928
##
## Type: lag
## Coefficients: (asymptotic standard errors)
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.6897e+02 8.6659e+00 -31.0379 < 2.2e-16
## Number_of_Battles -2.2555e-02 7.5058e-03 -3.0050 0.0026560
## lag1_Number_of_Battles -1.2443e-02 6.7581e-03 -1.8413 0.0655800
## lag2_Number_of_Battles -4.4486e-03 6.3259e-03 -0.7032 0.4819036
## lag3_Number_of_Battles -5.1327e-03 5.9332e-03 -0.8651 0.3869963
## lag4_Number_of_Battles 3.4723e-02 5.0278e-03 6.9062 4.978e-12
## MonthAugust -9.8032e-03 8.4292e-03 -1.1630 0.2448282
## MonthDecember -2.7943e-01 1.0568e-02 -26.4401 < 2.2e-16
## MonthFebruary -2.7156e-01 1.0495e-02 -25.8743 < 2.2e-16
## MonthJanuary -4.4136e-01 1.0502e-02 -42.0258 < 2.2e-16
## MonthJuly 7.4758e-02 8.4395e-03 8.8581 < 2.2e-16
## MonthJune -5.4376e-02 8.4286e-03 -6.4513 1.109e-10
## MonthMarch -2.3962e-01 8.4257e-03 -28.4391 < 2.2e-16
## MonthMay 2.2847e-02 8.4174e-03 2.7142 0.0066433
## MonthNovember -1.2119e-01 1.0559e-02 -11.4768 < 2.2e-16
## MonthOctober -5.7057e-02 8.4261e-03 -6.7714 1.275e-11
## MonthSeptember -3.0322e-02 8.4330e-03 -3.5957 0.0003236
## Year 1.3311e-01 4.2868e-03 31.0506 < 2.2e-16
##
## Rho: 0.94907, LR test value: 1766.7, p-value: < 2.22e-16
## Asymptotic standard error: 0.012618
## z-value: 75.217, p-value: < 2.22e-16
## Wald statistic: 5657.6, p-value: < 2.22e-16
##
## Log likelihood: 2635.869 for lag model
## ML residual variance (sigma squared): 0.032902, (sigma: 0.18139)
## Number of observations: 9360
## Number of parameters estimated: 20
## AIC: NA (not available for weighted model), (AIC for lm: -3467.1)
## LM test for residual autocorrelation
## test value: 49.545, p-value: 1.939e-12
Here we see that as the number of battles increases in a superpixel we see a reduction in nighttime lights. However, it looks like after about 5 months (Lag 4) we see people start to return to their homes. So we can see that nighttime lights can indeed be useful to map the flow of people who are displaced as a byproduct of civil war in developing countries.
Spatial Error Model
# Run a spatial error model
model_spatial_error <- errorsarlm(Log_NL ~ Number_of_Battles +
lag1_Number_of_Battles +
lag2_Number_of_Battles +
lag3_Number_of_Battles +
lag4_Number_of_Battles +
Month +
Year,
data = Tigray_Conflict_data_Acled_SR,
listw = weights)
# View the summary of the model
summary(model_spatial_error)
##
## Call:
## errorsarlm(formula = Log_NL ~ Number_of_Battles + lag1_Number_of_Battles +
## lag2_Number_of_Battles + lag3_Number_of_Battles + lag4_Number_of_Battles +
## Month + Year, data = Tigray_Conflict_data_Acled_SR, listw = weights)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.6669631 -0.0888745 0.0011556 0.0814182 2.4914804
##
## Type: error
## Coefficients: (asymptotic standard errors)
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.6639e+02 8.6242e+00 -30.8891 < 2.2e-16
## Number_of_Battles -2.2554e-02 7.5077e-03 -3.0040 0.0026642
## lag1_Number_of_Battles -1.1780e-02 6.7381e-03 -1.7482 0.0804232
## lag2_Number_of_Battles -4.1702e-03 6.3054e-03 -0.6614 0.5083759
## lag3_Number_of_Battles -5.7854e-03 5.9112e-03 -0.9787 0.3277183
## lag4_Number_of_Battles 3.2876e-02 5.0240e-03 6.5438 5.999e-11
## MonthAugust -9.9153e-03 8.3808e-03 -1.1831 0.2367744
## MonthDecember -2.7799e-01 1.0509e-02 -26.4517 < 2.2e-16
## MonthFebruary -2.6991e-01 1.0434e-02 -25.8691 < 2.2e-16
## MonthJanuary -4.3861e-01 1.0440e-02 -42.0114 < 2.2e-16
## MonthJuly 7.4303e-02 8.3903e-03 8.8558 < 2.2e-16
## MonthJune -5.3978e-02 8.3793e-03 -6.4419 1.180e-10
## MonthMarch -2.3808e-01 8.3764e-03 -28.4227 < 2.2e-16
## MonthMay 2.2749e-02 8.3678e-03 2.7187 0.0065539
## MonthNovember -1.2063e-01 1.0500e-02 -11.4886 < 2.2e-16
## MonthOctober -5.6877e-02 8.3775e-03 -6.7893 1.127e-11
## MonthSeptember -3.0304e-02 8.3844e-03 -3.6143 0.0003011
## Year 1.3201e-01 4.2661e-03 30.9441 < 2.2e-16
##
## Lambda: 0.95089, LR test value: 1760.4, p-value: < 2.22e-16
## Asymptotic standard error: 0.012352
## z-value: 76.985, p-value: < 2.22e-16
## Wald statistic: 5926.7, p-value: < 2.22e-16
##
## Log likelihood: 2632.719 for error model
## ML residual variance (sigma squared): 0.032921, (sigma: 0.18144)
## Number of observations: 9360
## Number of parameters estimated: 20
## AIC: -5225.4, (AIC for lm: -3467.1)
Here we see almost exactly the same result.
By fitting these models, we aim to quantify the impact of conflict events on nighttime lights in Tigray, taking into account both temporal and spatial dependencies. The results from these models will provide insights into how conflict intensity influences economic activity and infrastructure usage as reflected in nighttime light patterns.