Chicago’s Bloomingdale Trail, widely recognized as The 606, represents a significant urban development, transforming an unused rail line into a vibrant, elevated linear park. This innovative project has not only redefined urban space utilization but also sparked debates about its wider social implications, particularly concerning public safety and crime rates. One of the most pressing concerns in this context is the trail’s potential impact on the incidence of homicides in Chicago, a city already grappling with a high crime rate.
This study explores the impact of Chicago’s Bloomingdale Trail, on the city’s homicide rates. The theoretical basis for The 606 to reduce the homicide rate is Routine Activity Theory, a criminology theory suggesting that changes in the daily patterns of community residents can affect crime rates, including homicides. We suppose the 606 may have a positive effect on the surrounding blocks - resulting in a decrease in the number of homicides in the short term (2017), as well as the long term (2021). It’s important to note the level-shift in homicides caused by the BLM riots all across the USA and Chicago, but we belive the treatment effect of the 606 will still apply.
Additionally, this paper builds upon the findings of Harris et al. (2017) in their study “Different Views From The 606: Examining the Impacts of an Urban Greenway on Crime in Chicago.” While their work provided initial insights into the short-term effects of The 606 on crime, our research aims to extend this understanding by examining its long-term impact on homicide rates in Chicago. Through this extended analysis, the study seeks to contribute a deeper understanding of the complex interplay between urban redevelopment and public safety.
In this research we use spatial data from Chicago, focusing on the years 2010, 2017, and 2021. Our study distinguishes three distinct groups: the Treatment Group, consisting of the neighborhood immediately surrounding The 606; Control Group 1, which includes areas adjacent to the Treatment Group; and Control Group 2, covering the broader Chicago area.
Our extensive dataset synthesizes information from various sources, providing a multidimensional perspective on the urban environment, demographic shifts and crime dynamics - Chicago Open Data Portal contributes information on crime, traffic, vacant buildings, zoning, and school ratings, and the 2010 Census provides insight into comprehensive demographic, social, housing, and economic data.
# Chicago606 dataset credit: K. Credit
C <- st_read("Chicago_BGs_Covariates/Chicago_BGs_Covariates.shp")
## Reading layer `Chicago_BGs_Covariates' from data source
## `C:\Users\jakub\OneDrive\DSBA_OneDrive\3sem\CausalML\Practicals and Data\Chicago_BGs_Covariates\Chicago_BGs_Covariates.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 2151 features and 233 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 990985 ymin: -295613.8 xmax: 1032092 ymax: -254476.4
## Projected CRS: US National Atlas Equal Area
# transform himicide data
data <- read.csv("Chicago_BGs_Covariates/Homicide_Map.csv", header = TRUE)
data <- drop_na(data)
cc <- c("Year","Latitude", "Longitude")
homicide <- data[cc]
# add ID
homicide$GISJOIN = "initial"
# find the closest block
for (i in 1:nrow(homicide)) {
lon1 = homicide[i, "Longitude"]
lat1 = homicide[i, "Latitude"]
# calcualte metric
C$temp = (C$INTPTLON - lon1)^2 + (C$INTPTLAT - lat1)^2
homicide[i,"GISJOIN"] = C$GISJOIN[which.min(C$temp)]
}
######################### GROUP BY BlOCK (GISJOIN) ####################
homicide_transformed <- homicide %>%
group_by(GISJOIN,Year) %>%
count() %>%
ungroup() %>%
arrange(Year)
write.csv(homicide_transformed,"Chicago_BGs_Covariates/homicide_transformed.csv")
######################### PIVOT Homicide data and JOIN by GISJOIN ####################
homicide_transformed <- homicide_transformed %>%
dplyr::filter(Year==2010 | Year==2017 | Year==2021)
homicide_transformed_wide <- pivot_wider(homicide_transformed, names_from = Year, values_from = n)
new_colnames <- c("GISJOIN", "HOM2010", "HOM2017", "HOM2021")
colnames(homicide_transformed_wide) <- new_colnames
# replace NAs with 0 because if there was no homicide within a block then there is no row with that information
homicide_transformed_wide[is.na(homicide_transformed_wide)] <- 0
# join
merged_df_join <- C %>%
left_join(homicide_transformed_wide, by = "GISJOIN")
# replace NAs with 0 because if there was no homicide within a block then there is no row with that information
merged_df_join[is.na(merged_df_join$HOM2010),"HOM2010"] <-0
merged_df_join[is.na(merged_df_join$HOM2017),"HOM2017"] <-0
merged_df_join[is.na(merged_df_join$HOM2021),"HOM2021"] <-0
C <- merged_df_join
As the homicides are correlated with each other, we need to account for this in our analysis. To do so, we create spatial lag variables for each year, using the queen contiguity matrix. The spatial lag variable for each block is based on the homicides in the block and all its neighbors. We then use the spatial lag variables in our analysis. Furthermore, considering the fact that homicide data contain a lot of zeros and overall are discrete we decided to use Local Empirical Bayes estimator, which “shrinks” the rates to a neighbourhood mean.
# spatial lag with queen mode
cont.sf<- poly2nb(C, queen = TRUE)
cont.listw<-nb2listw(cont.sf, style="W")
# to avoid issues wiyh 0 population
C$EBS_HOM2010 <- EBlocal(C$HOM2010, 1+C$POP10, cont.sf)
C$EBS_HOM2017 <- EBlocal(C$HOM2017, 1+C$POP10, cont.sf)
C$EBS_HOM2021 <- EBlocal(C$HOM2021, 1+C$POP10, cont.sf)
# rename old variables
C$HOM2010_old <- C$HOM2010
C$HOM2017_old <- C$HOM2017
C$HOM2021_old <- C$HOM2021
# replace old variables with EBS
C$HOM2010 <- C$EBS_HOM2010$est * 10e5
C$HOM2017 <- C$EBS_HOM2017$est * 10e5
C$HOM2021 <- C$EBS_HOM2021$est * 10e5
# remove nans
C[is.na(C$HOM2010),"HOM2010"] <-0
C[is.na(C$HOM2017),"HOM2017"] <-0
C[is.na(C$HOM2021),"HOM2021"] <-0
# calculate spatial lag
C$HOM2010_LAG <- lag.listw(cont.listw, C$HOM2010)
C$HOM2017_LAG <- lag.listw(cont.listw, C$HOM2017)
C$HOM2021_LAG <- lag.listw(cont.listw, C$HOM2021)
C$POPD10_LAG <- lag.listw(cont.listw, C$POPD10)
# old lag
C$HOM2010_LAG_old <- lag.listw(cont.listw, C$HOM2010_old)
C$HOM2017_LAG_old <- lag.listw(cont.listw, C$HOM2017_old)
C$HOM2021_LAG_old <- lag.listw(cont.listw, C$HOM2021_old)
# write.csv(C,"Chicago_BGs_Covariates/homicide_606_dataset.csv")
Variables considered in this study were chosen based on previous research as well as expert judgement. The dependent variable is homicide ratio, after Local Empirical Bayes transformation (HOM) and factors that possibly influence that in the area are: population density (POPD), median housing value (MVAL), median age (MEDAGE), percentage of Black non-Hispanic population (BLKP), percentage of Asian non-Hispanic population (ASNP), percentage of population with Bachelor’s degree or higher (BACHP), percentage of labor force that are unemployed (UNEMP), percentage of employed in management, business, science and arts occupations (MBSAP), median household income (MHHIN), percentage of owner-occupied housing units (OWNP), median year householder moved into unit (MYRMOV), percentage of area zoned for residential use (R_ZONEP) and Walkable Accessibility Score (WAS). Also, lags of variables above were taken into consideration.
# Subset by different control areas
C_CA <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_1==1))) #Neighbourhood-only control area
C_CHI <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_2==1))) #Entire city control area
# More complex models
# Incorporating the covariates aprropraite for Homocides
# 2017
summary(lm1 <- lm(HOM2017 ~ HOM2017_LAG + POPD10 + MVAL10 + TREAT + HOM2010 + MEDAGE10 + BLKP10 + ASNP10 +
BACHP10 + UNEMP10 + MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP + WAS2010, data=C_CA))
##
## Call:
## lm(formula = HOM2017 ~ HOM2017_LAG + POPD10 + MVAL10 + TREAT +
## HOM2010 + MEDAGE10 + BLKP10 + ASNP10 + BACHP10 + UNEMP10 +
## MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP + WAS2010,
## data = C_CA)
##
## Residuals:
## Min 1Q Median 3Q Max
## -836.44 -73.99 -8.15 58.42 1672.61
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.751e+04 1.827e+04 -2.601 0.01015 *
## HOM2017_LAG 4.316e-01 1.557e-01 2.772 0.00622 **
## POPD10 4.301e-03 1.011e-02 0.425 0.67120
## MVAL10 1.222e-04 2.303e-04 0.531 0.59633
## TREAT -5.921e+01 5.508e+01 -1.075 0.28402
## HOM2010 4.409e-01 1.253e-01 3.519 0.00056 ***
## MEDAGE10 1.099e+01 4.881e+00 2.253 0.02560 *
## BLKP10 4.090e+02 1.963e+02 2.083 0.03877 *
## ASNP10 -8.927e+02 1.720e+03 -0.519 0.60436
## BACHP10 -8.639e+01 2.272e+02 -0.380 0.70428
## UNEMP10 -4.137e+02 2.999e+02 -1.379 0.16963
## MBSAP10 7.902e+01 2.164e+02 0.365 0.71550
## MHHIN10 -1.799e-03 1.554e-03 -1.158 0.24857
## OWNP10 2.723e+02 2.445e+02 1.113 0.26714
## MYRMOV10 2.351e+01 9.079e+00 2.589 0.01049 *
## R_ZONEP -3.305e+01 1.247e+02 -0.265 0.79125
## WAS2010 8.762e-01 1.503e+00 0.583 0.56075
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 243.6 on 164 degrees of freedom
## (2 obserwacje zostały skasowane z uwagi na braki w nich zawarte)
## Multiple R-squared: 0.629, Adjusted R-squared: 0.5928
## F-statistic: 17.38 on 16 and 164 DF, p-value: < 2.2e-16
Results show that only interaction between MHHIN10 and TREAT is statistically significant. For ease of reading the report results are hidden, but the code is present in Rmd format.
##Testing for heterogeneity
#Basic interactions
summary(lm1.0 <-lm(HOM2017 ~ TREAT*HOM2010, data=C_CA))
summary(lm1.1 <- lm(HOM2017 ~ TREAT*POPD10, data=C_CA))
summary(lm1.1 <- lm(HOM2017 ~ TREAT*MVAL10, data=C_CA))
summary(lm1.2 <- lm(HOM2017 ~ TREAT*MEDAGE10, data=C_CA))
summary(lm1.3 <- lm(HOM2017 ~ TREAT*BLKP10, data=C_CA))
summary(lm1.4 <- lm(HOM2017 ~ TREAT*ASNP10, data=C_CA))
summary(lm1.5 <- lm(HOM2017 ~ TREAT*BACHP10, data=C_CA))
summary(lm1.6 <- lm(HOM2017 ~ TREAT*UNEMP10, data=C_CA))
summary(lm1.7 <- lm(HOM2017 ~ TREAT*MBSAP10, data=C_CA))
summary(lm1.8 <- lm(HOM2017 ~ TREAT*MHHIN10, data=C_CA)) #
summary(lm1.9 <- lm(HOM2017 ~ TREAT*OWNP10, data=C_CA))
summary(lm1.10 <- lm(HOM2017 ~ TREAT*MYRMOV10, data=C_CA))
summary(lm1.12 <- lm(HOM2017 ~ TREAT*R_ZONEP, data=C_CA))
summary(lm1.13 <- lm(HOM2017 ~ TREAT*WAS2010, data=C_CA))
Considering the interaction between TREAT and MHHIN10 decreases the significance of the black population variable. However, the interaction between TREAT and MHHIN10 is not statistically significant.
# adding the ienteraction to the SAR model
# 2017
summary(lm1 <- lm(HOM2017 ~ TREAT*MHHIN10 + HOM2017_LAG + POPD10 + MVAL10 + TREAT + HOM2010 + MEDAGE10 + BLKP10 + ASNP10 +
BACHP10 + UNEMP10 + MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP + WAS2010, data=C_CA))
##
## Call:
## lm(formula = HOM2017 ~ TREAT * MHHIN10 + HOM2017_LAG + POPD10 +
## MVAL10 + TREAT + HOM2010 + MEDAGE10 + BLKP10 + ASNP10 + BACHP10 +
## UNEMP10 + MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP +
## WAS2010, data = C_CA)
##
## Residuals:
## Min 1Q Median 3Q Max
## -848.36 -77.66 -13.47 59.45 1669.13
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.847e+04 1.833e+04 -2.644 0.008998 **
## TREAT -1.459e+02 1.256e+02 -1.161 0.247206
## MHHIN10 -2.071e-03 1.595e-03 -1.298 0.196064
## HOM2017_LAG 4.237e-01 1.563e-01 2.711 0.007418 **
## POPD10 2.687e-03 1.034e-02 0.260 0.795306
## MVAL10 1.109e-04 2.311e-04 0.480 0.631944
## HOM2010 4.480e-01 1.258e-01 3.562 0.000483 ***
## MEDAGE10 1.126e+01 4.899e+00 2.298 0.022829 *
## BLKP10 3.885e+02 1.984e+02 1.959 0.051834 .
## ASNP10 -1.022e+03 1.730e+03 -0.591 0.555631
## BACHP10 -9.362e+01 2.277e+02 -0.411 0.681499
## UNEMP10 -4.144e+02 3.003e+02 -1.380 0.169457
## MBSAP10 8.569e+01 2.169e+02 0.395 0.693303
## OWNP10 2.399e+02 2.485e+02 0.965 0.335760
## MYRMOV10 2.400e+01 9.114e+00 2.634 0.009256 **
## R_ZONEP -2.277e+01 1.255e+02 -0.181 0.856277
## WAS2010 8.870e-01 1.505e+00 0.589 0.556430
## TREAT:MHHIN10 1.369e-03 1.782e-03 0.768 0.443599
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 243.9 on 163 degrees of freedom
## (2 obserwacje zostały skasowane z uwagi na braki w nich zawarte)
## Multiple R-squared: 0.6303, Adjusted R-squared: 0.5918
## F-statistic: 16.35 on 17 and 163 DF, p-value: < 2.2e-16
# Calculate the mean of the squared residuals
rmse1 <- sqrt(mean((lm1$residuals)^2))
print(paste("RMSE of models on control 1",rmse1))
## [1] "RMSE of models on control 1 231.478021489911"
Based on the plot below we can say that in the treatment group the number of homicides decreases compared to the control group.
visreg(lm1.0, "TREAT", by="HOM2010", breaks=3, overlay=TRUE)
Addition of spatial lags of all present covariates to the model results in drop in statistical significance of HOM2017_LAG and percentage of black population. However, three of the newly added covariates are indeed statistically significant: percentage of unemployed people, percentage of population with Bachelor’s degree or higher and percentage of proffesionals from management, business and art.
Moreover, these additional spatial lags increase the adjusted R2 of the model and decrease the RMSE. Overall we determine these variables as the most important ones in the model that can be used for the Spatial T learner.
#Adding spatial lags of all covariates in X
summary(lm1_LAG <- lm(HOM2017 ~ HOM2017_LAG + POPD10 + MVAL10 + TREAT + HOM2010 + MEDAGE10 + BLKP10 + ASNP10 +
BACHP10 + UNEMP10 + MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP + WAS2010 + POPD10_LAG +
TREAT_LAG + HOM2010_LAG + MEDA_LAG + BLKP_LAG + ASNP_LAG + BACH_LAG +
UNEM_LAG + MBSA_LAG + MHHI_LAG +
OWN_LAG + YRMV_LAG + RZ_LAG + WS10_LAG , data=C_CA))
##
## Call:
## lm(formula = HOM2017 ~ HOM2017_LAG + POPD10 + MVAL10 + TREAT +
## HOM2010 + MEDAGE10 + BLKP10 + ASNP10 + BACHP10 + UNEMP10 +
## MBSAP10 + MHHIN10 + OWNP10 + MYRMOV10 + R_ZONEP + WAS2010 +
## POPD10_LAG + TREAT_LAG + HOM2010_LAG + MEDA_LAG + BLKP_LAG +
## ASNP_LAG + BACH_LAG + UNEM_LAG + MBSA_LAG + MHHI_LAG + OWN_LAG +
## YRMV_LAG + RZ_LAG + WS10_LAG, data = C_CA)
##
## Residuals:
## Min 1Q Median 3Q Max
## -585.72 -98.01 -1.00 75.77 1250.24
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.695e+04 5.825e+04 -0.463 0.644271
## HOM2017_LAG 9.111e-02 1.755e-01 0.519 0.604507
## POPD10 1.866e-05 1.079e-02 0.002 0.998622
## MVAL10 4.166e-04 2.339e-04 1.781 0.076872 .
## TREAT 5.871e+01 8.187e+01 0.717 0.474374
## HOM2010 3.123e-01 1.460e-01 2.139 0.034090 *
## MEDAGE10 1.233e+01 4.827e+00 2.555 0.011625 *
## BLKP10 1.501e+02 2.687e+02 0.559 0.577235
## ASNP10 8.708e+02 1.889e+03 0.461 0.645456
## BACHP10 1.089e+02 2.372e+02 0.459 0.646889
## UNEMP10 -2.757e+02 3.029e+02 -0.910 0.364197
## MBSAP10 1.768e+01 2.112e+02 0.084 0.933426
## MHHIN10 -2.533e-03 1.532e-03 -1.653 0.100332
## OWNP10 1.378e+02 2.475e+02 0.557 0.578461
## MYRMOV10 3.329e+01 8.860e+00 3.757 0.000245 ***
## R_ZONEP -4.063e+01 1.387e+02 -0.293 0.769949
## WAS2010 3.766e+00 3.531e+00 1.067 0.287806
## POPD10_LAG -5.282e-03 2.207e-02 -0.239 0.811138
## TREAT_LAG -2.239e+02 1.314e+02 -1.704 0.090491 .
## HOM2010_LAG 2.909e-01 3.377e-01 0.861 0.390378
## MEDA_LAG 2.236e+01 1.588e+01 1.408 0.161341
## BLKP_LAG 1.703e+02 3.984e+02 0.428 0.669572
## ASNP_LAG 3.869e+03 4.094e+03 0.945 0.346183
## BACH_LAG 1.319e+03 6.322e+02 2.087 0.038592 *
## UNEM_LAG 3.458e+03 8.637e+02 4.004 9.76e-05 ***
## MBSA_LAG -1.574e+03 5.892e+02 -2.670 0.008410 **
## MHHI_LAG -2.615e-03 4.229e-03 -0.618 0.537312
## OWN_LAG -4.356e+02 5.606e+02 -0.777 0.438393
## YRMV_LAG -2.053e+01 2.699e+01 -0.761 0.448115
## RZ_LAG 2.124e+02 2.974e+02 0.714 0.476182
## WS10_LAG -2.921e+00 4.862e+00 -0.601 0.548812
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 224.8 on 150 degrees of freedom
## (2 obserwacje zostały skasowane z uwagi na braki w nich zawarte)
## Multiple R-squared: 0.7111, Adjusted R-squared: 0.6533
## F-statistic: 12.31 on 30 and 150 DF, p-value: < 2.2e-16
# Calculate the mean of the squared residuals
rmse1 <- sqrt(mean((lm1_LAG$residuals)^2))
print(paste("RMSE of models on control 1",rmse1))
## [1] "RMSE of models on control 1 204.627942225388"
Based on previous research, especially on paper from 2023 “A structured comparison of causal machine learning methods to assess heterogeneous treatment effects in spatial data” by Kevin Credit and Matthew Lehnert, we decided to use Spatial T-learner method to estimate Conditional Average Treatment Effect, as it well suited for our data and showed promising results in other studies. The Spatial T-learner is a forest-based method for estimating the Conditional Average Treatment Effect (CATE), with a specific focus on spatial components. It enhances the traditional T-learner by incorporating spatial elements into both the treatment and control areas. This method involves initially predicting outcomes (Y_post) using only data from the control group, which involves leveraging the spatial predictiveness of the model. The method operates under the assumption that if the treatment had never happened, the predicted outcomes would represent a counterfactual condition—what would have occurred in the treatment area without the intervention. The results of application of this method are shown below.
columns = c("HOM2017_LAG", "POPD10", "MVAL10", "TREAT", "HOM2010", "MEDAGE10", "BLKP10", "ASNP10", "BACHP10",
"UNEMP10", "MSBAP10", "MHHIN10", "OWNP10", "MYRMOV10", "R_ZONEP", "WAS2010", "POPD10_LAG", "TREAT_LAG",
"HOM2010_LAG", "MEDA_LAG", "BLKP_LAG", "ASNP_LAG", "BACH_LAG", "UNEM_LAG", "MBSA_LAG",
"MHHI_LAG", "OWN_LAG", "YRMV_LAG", "RZ_LAG", "WS10_LAG","Y")
columns1 = c(columns,"CATE_STL","stl_rf")
columns2 = c(columns,"stl_rf","CATE_STL")
#Subset by different control areas
C_CA <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_1==1))) #Neighbourhood-only control area
C_CHI <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_2==1))) #Entire city control area
# Stage 1.1 of the spatial T-learner - Causal Forest on control sample
train <- C_CA[C_CA$TREAT == 0, ]
Yr <- train$HOM2017
Xr <- as.data.frame(cbind(train$HOM2017_LAG, train$POPD10, train$MVAL10, train$TREAT, train$HOM2010, train$MEDAGE10, train$BLKP10, train$ASNP10,
train$BACHP10 , train$UNEMP10 , train$MBSAP10 , train$MHHIN10 , train$OWNP10 , train$MYRMOV10 , train$R_ZONEP , train$WAS2010 , train$POPD10_LAG ,
train$TREAT_LAG , train$HOM2010_LAG , train$MEDA_LAG , train$BLKP_LAG , train$ASNP_LAG , train$BACH_LAG ,
train$UNEM_LAG , train$MBSA_LAG , train$MHHI_LAG ,
train$OWN_LAG , train$YRMV_LAG , train$RZ_LAG , train$WS10_LAG ))
rownames(Xr) <- train$GISJOIN
# first round of RF for STL
rf.risk <- regression_forest(Xr,Yr)
# Stage 1.2 of the spatial T-learner - Causal Forest on treatment sample
treat <- C_CA[C_CA$TREAT == 1, ]
Yt <- treat$HOM2017
Xt <- as.data.frame(cbind(treat$HOM2017_LAG, treat$POPD10, treat$MVAL10, treat$TREAT, treat$HOM2010, treat$MEDAGE10, treat$BLKP10, treat$ASNP10,
treat$BACHP10 , treat$UNEMP10 , treat$MBSAP10 , treat$MHHIN10 , treat$OWNP10 , treat$MYRMOV10 , treat$R_ZONEP , treat$WAS2010 , treat$POPD10_LAG ,
treat$TREAT_LAG , treat$HOM2010_LAG , treat$MEDA_LAG , treat$BLKP_LAG , treat$ASNP_LAG , treat$BACH_LAG ,
treat$UNEM_LAG , treat$MBSA_LAG , treat$MHHI_LAG ,
treat$OWN_LAG , treat$YRMV_LAG , treat$RZ_LAG , treat$WS10_LAG ), col.names = columns)
rownames(Xt) <- treat$GISJOIN
# predict Y hat on the treatment area using RF trained on control area
stl_rf <- predict(rf.risk, Xt)$predictions
#Find unit-level CATEs
treat2 <- cbind(Xt,Yt,stl_rf)
treat2$CATE_STL <- treat2$Yt - treat2$stl_rf #CATE = treated Y - predicted (i.e., counterfactual) Y
#Stage 2: predict unit-level CATEs for treated observations
rf.stl <- regression_forest(Xt,treat2$CATE_STL)
#Apply the model to untreated units to obtain predictions
CATE_STL <- predict(rf.stl, Xr)$predictions
untreat <- cbind(Xr,Yr,CATE_STL)
untreat$stl_rf <- -1000
colnames(untreat) <- columns1
untreat <- untreat[, c(seq(1,31),33,32)]
colnames(treat2) <- columns2
merge <- rbind(treat2, untreat)
merge <- cbind(GISJOIN = rownames(merge), merge)
rownames(merge) <- 1:nrow(merge)
#Find ATE for STL model
STL.ATE <- mean(merge$CATE_STL)
On the map plot below we can observe the conditional treatment effect on homicides per 100k inhabitants variable, on block level. Although, we can observe visual difference between the TREAT area and the CONTROL area, they have different effects - some of the blocks experience positive treatment effect (in this case - rise in the number of homicides per 100k inhabitants) and some other negative effect. We belive the problem to be the putting together this particular algorithm (STL) and the Local Empirical Bayes estimator for the data we have. Having many zeros in the vector of homicides may cause some numerical problems in computing neighbour relations for that variable (on a relatively small dataset - TREAT area). We were forced to use the raw Homicides values as EBlocal was causing too many distortions in the dataset.
#Map CATE
#Merge the data
C_CA2 <- subset(C,(C$TREAT==1|C$CONTR_1==1)) #Create a subset of the control area w/spatial geometry intact
CF_map <- merge(C_CA2, merge, by="GISJOIN")
# st_write(CF_map, "output_shapefiles/CF_map.shp")
#Interactive mapping of two causal ML model results
tmap_mode("view")
## tmap mode set to interactive viewing
tmap_leaflet(tm_shape(CF_map) + tm_fill("CATE_STL", breaks=c(-140,-100,-50,-40,-35,-30,-25,-20,-15,
-10,0,50,75,100),
palette = "PRGn", midpoint = 0, title = "STL CATE", alpha=.5) +
tm_borders(alpha=.3, col="white", lwd = 1))
## Warning: Values have found that are less than the lowest break
## Warning: Values have found that are higher than the highest break
Below we show the results of applying Spatial T-Learner model for the data with raw values of dependent variable (HOMICIDES). The computation methods are the same as shown above, only difference being the dependent variable.
columns = c("HOM2017_LAG_old", "POPD10", "MVAL10", "TREAT", "HOM2010_old", "MEDAGE10", "BLKP10", "ASNP10", "BACHP10",
"UNEMP10", "MSBAP10", "MHHIN10", "OWNP10", "MYRMOV10", "R_ZONEP", "WAS2010", "POPD10_LAG", "TREAT_LAG",
"HOM2010_LAG_old", "MEDA_LAG", "BLKP_LAG", "ASNP_LAG", "BACH_LAG", "UNEM_LAG", "MBSA_LAG",
"MHHI_LAG", "OWN_LAG", "YRMV_LAG", "RZ_LAG", "WS10_LAG","Y")
columns1 = c(columns,"CATE_STL","stl_rf")
columns2 = c(columns,"stl_rf","CATE_STL")
#Subset by different control areas
C_CA <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_1==1))) #Neighbourhood-only control area
C_CHI <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_2==1))) #Entire city control area
# Stage 1.1 of the spatial T-learner - Causal Forest on control sample
train <- C_CA[C_CA$TREAT == 0, ]
Yr <- train$HOM2017_old
Xr <- as.data.frame(cbind(train$HOM2017_LAG_old, train$POPD10, train$MVAL10, train$TREAT, train$HOM2010, train$MEDAGE10, train$BLKP10, train$ASNP10,
train$BACHP10 , train$UNEMP10 , train$MBSAP10 , train$MHHIN10 , train$OWNP10 , train$MYRMOV10 , train$R_ZONEP , train$WAS2010 , train$POPD10_LAG ,
train$TREAT_LAG , train$HOM2010_LAG_old , train$MEDA_LAG , train$BLKP_LAG , train$ASNP_LAG , train$BACH_LAG ,
train$UNEM_LAG , train$MBSA_LAG , train$MHHI_LAG ,
train$OWN_LAG , train$YRMV_LAG , train$RZ_LAG , train$WS10_LAG ))
rownames(Xr) <- train$GISJOIN
# first round of RF for STL
rf.risk <- regression_forest(Xr,Yr)
# Stage 1.2 of the spatial T-learner - Causal Forest on treatment sample
treat <- C_CA[C_CA$TREAT == 1, ]
Yt <- treat$HOM2017_old
Xt <- as.data.frame(cbind(treat$HOM2017_LAG_old, treat$POPD10, treat$MVAL10, treat$TREAT, treat$HOM2010_old, treat$MEDAGE10, treat$BLKP10, treat$ASNP10,
treat$BACHP10 , treat$UNEMP10 , treat$MBSAP10 , treat$MHHIN10 , treat$OWNP10 , treat$MYRMOV10 , treat$R_ZONEP , treat$WAS2010 , treat$POPD10_LAG ,
treat$TREAT_LAG , treat$HOM2010_LAG_old , treat$MEDA_LAG , treat$BLKP_LAG , treat$ASNP_LAG , treat$BACH_LAG ,
treat$UNEM_LAG , treat$MBSA_LAG , treat$MHHI_LAG ,
treat$OWN_LAG , treat$YRMV_LAG , treat$RZ_LAG , treat$WS10_LAG ), col.names = columns)
rownames(Xt) <- treat$GISJOIN
# predict Y hat on the treatment area using RF trained on control area
stl_rf <- predict(rf.risk, Xt)$predictions
#Find unit-level CATEs
treat2 <- cbind(Xt,Yt,stl_rf)
treat2$CATE_STL <- treat2$Yt - treat2$stl_rf #CATE = treated Y - predicted (i.e., counterfactual) Y
#Stage 2: predict unit-level CATEs for treated observations
rf.stl <- regression_forest(Xt,treat2$CATE_STL)
#Apply the model to untreated units to obtain predictions
CATE_STL <- predict(rf.stl, Xr)$predictions
untreat <- cbind(Xr,Yr,CATE_STL)
untreat$stl_rf <- -1000
colnames(untreat) <- columns1
untreat <- untreat[, c(seq(1,31),33,32)]
colnames(treat2) <- columns2
merge <- rbind(treat2, untreat)
merge <- cbind(GISJOIN = rownames(merge), merge)
rownames(merge) <- 1:nrow(merge)
#Find ATE for STL model
STL.ATE <- mean(merge$CATE_STL)
One the map plot presented below we can observe slight differences in the conditional treatment effect for the Treatment area (negative values of CATE mean the decrease in homicides) which supports the thesis that the Chicago’s Bloomingdale Trail, widely recognized as The 606, has a positive impact on the number of homicides in the surrounding blocks (by decreasing it). However, the effect cannot be considered as substantial, which may be the result of the data quality or unfaced modelling challenges.
#Map CATE
#Merge the data with the spatial geometry
C_CA2 <- subset(C,(C$TREAT==1|C$CONTR_1==1)) #Create a subset of the control area w/spatial geometry intact
CF_map <- merge(C_CA2, merge, by="GISJOIN")
# st_write(CF_map, "output_shapefiles/CF_map.shp")
#Interactive mapping of two causal ML model results
#Map CATE
tmap_mode("view")
## tmap mode set to interactive viewing
tmap_leaflet(tm_shape(CF_map) + tm_fill("CATE_STL", breaks=c(-0.4,-0.3,-0.25,-0.22,-0.2,-0.175,-0.17,-0.165,-0.1625
,-0.16,-0.1575,-0.155,-0.15,0,0.8),
palette = "PRGn", midpoint = 0, title = "STL CATE", alpha=.5) +
tm_borders(alpha=.3, col="white", lwd = 1))
The second part of our analysis concerns the long-term effect of the Chicago’s Bloomingdale Trail, widely recognized as The 606, on the homicides rates in the surrounding blocks. The level-shift effect of BLM riots, occurring after May 2020, on the homicides rates in USA and Chicago was observed across many different areas, but we belive that the trend reported in the previous years - existence of the 606 decreasing the number of homicides in the area - would continue nevertheless. In the analysis below we conduct the the study of that matter - in similar manner and execution as per 2017 homicides rate - bearing in mind the fact of the level-shift in homicides rates, as mentioned above.
We are using the same variables as in previous analysis for 2017 for ease of comparison.
We once again turn to Spatial T-learner model, as per our research that suggests it may be one of the best methods for this particular spatial problem (Kevin Credit, 2023). The first effort is once again done using the Local Empirical Bayes estimator.
columns = c("HOM2021_LAG", "POPD10", "MVAL10", "TREAT", "HOM2010", "MEDAGE10", "BLKP10", "ASNP10", "BACHP10",
"UNEMP10", "MSBAP10", "MHHIN10", "OWNP10", "MYRMOV10", "R_ZONEP", "WAS2010", "POPD10_LAG", "TREAT_LAG",
"HOM2010_LAG", "MEDA_LAG", "BLKP_LAG", "ASNP_LAG", "BACH_LAG", "UNEM_LAG", "MBSA_LAG",
"MHHI_LAG", "OWN_LAG", "YRMV_LAG", "RZ_LAG", "WS10_LAG","Y")
columns1 = c(columns,"CATE_STL","stl_rf")
columns2 = c(columns,"stl_rf","CATE_STL")
#Subset by different control areas
C_CA <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_1==1))) #Neighbourhood-only control area
C_CHI <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_2==1))) #Entire city control area
# Stage 1.1 of the spatial T-learner - Causal Forest on control sample
train <- C_CA[C_CA$TREAT == 0, ]
Yr <- train$HOM2021
Xr <- as.data.frame(cbind(train$HOM2021_LAG, train$POPD10, train$MVAL10, train$TREAT, train$HOM2010, train$MEDAGE10, train$BLKP10, train$ASNP10,
train$BACHP10 , train$UNEMP10 , train$MBSAP10 , train$MHHIN10 , train$OWNP10 , train$MYRMOV10 , train$R_ZONEP , train$WAS2010 , train$POPD10_LAG ,
train$TREAT_LAG , train$HOM2010_LAG , train$MEDA_LAG , train$BLKP_LAG , train$ASNP_LAG , train$BACH_LAG ,
train$UNEM_LAG , train$MBSA_LAG , train$MHHI_LAG ,
train$OWN_LAG , train$YRMV_LAG , train$RZ_LAG , train$WS10_LAG ))
rownames(Xr) <- train$GISJOIN
# first round of RF for STL
rf.risk <- regression_forest(Xr,Yr)
# Stage 1.2 of the spatial T-learner - Causal Forest on treatment sample
treat <- C_CA[C_CA$TREAT == 1, ]
Yt <- treat$HOM2021
Xt <- as.data.frame(cbind(treat$HOM2021_LAG, treat$POPD10, treat$MVAL10, treat$TREAT, treat$HOM2010, treat$MEDAGE10, treat$BLKP10, treat$ASNP10,
treat$BACHP10 , treat$UNEMP10 , treat$MBSAP10 , treat$MHHIN10 , treat$OWNP10 , treat$MYRMOV10 , treat$R_ZONEP , treat$WAS2010 , treat$POPD10_LAG ,
treat$TREAT_LAG , treat$HOM2010_LAG , treat$MEDA_LAG , treat$BLKP_LAG , treat$ASNP_LAG , treat$BACH_LAG ,
treat$UNEM_LAG , treat$MBSA_LAG , treat$MHHI_LAG ,
treat$OWN_LAG , treat$YRMV_LAG , treat$RZ_LAG , treat$WS10_LAG ), col.names = columns)
rownames(Xt) <- treat$GISJOIN
# predict Y hat on the treatment area using RF trained on control area
stl_rf <- predict(rf.risk, Xt)$predictions
#Find unit-level CATEs
treat2 <- cbind(Xt,Yt,stl_rf)
treat2$CATE_STL <- treat2$Yt - treat2$stl_rf #CATE = treated Y - predicted (i.e., counterfactual) Y
#Stage 2: predict unit-level CATEs for treated observations
rf.stl <- regression_forest(Xt,treat2$CATE_STL)
#Apply the model to untreated units to obtain predictions
CATE_STL <- predict(rf.stl, Xr)$predictions
untreat <- cbind(Xr,Yr,CATE_STL)
untreat$stl_rf <- -1000
colnames(untreat) <- columns1
untreat <- untreat[, c(seq(1,31),33,32)]
colnames(treat2) <- columns2
merge <- rbind(treat2, untreat)
merge <- cbind(GISJOIN = rownames(merge), merge)
rownames(merge) <- 1:nrow(merge)
#Find ATE for STL model
STL.ATE <- mean(merge$CATE_STL)
Same as in 2017, we can observe that EBlocal does not produce satisfying results, which may be because of the reasons mentioned in the 2017 homicides section. The map plot below presents the data in a similar manner, so we conclude the reasoning done before may apply here as well.
#Map CATE
#Merge the data
C_CA2 <- subset(C,(C$TREAT==1|C$CONTR_1==1)) #Create a subset of the control area w/spatial geometry intact
CF_map <- merge(C_CA2, merge, by="GISJOIN")
# st_write(CF_map, "output_shapefiles/CF_map.shp")
#Interactive mapping of two causal ML model results
tmap_mode("view")
## tmap mode set to interactive viewing
tmap_leaflet(tm_shape(CF_map) + tm_fill("CATE_STL", breaks=c(-140,-100,-50,-40,-35,-30,-25,-20,-15,
-10,0,50,75,100),
palette = "PuOr", midpoint = 0, title = "STL CATE", alpha=.5) +
tm_borders(alpha=.3, col="white", lwd = 1))
Once again we present the computation of the raw homicides rates - this time for 2021 - as we believe it may result in better estimates of CATE.
columns = c("HOM2017_LAG_old", "POPD10", "MVAL10", "TREAT", "HOM2010_old", "MEDAGE10", "BLKP10", "ASNP10", "BACHP10",
"UNEMP10", "MSBAP10", "MHHIN10", "OWNP10", "MYRMOV10", "R_ZONEP", "WAS2010", "POPD10_LAG", "TREAT_LAG",
"HOM2010_LAG_old", "MEDA_LAG", "BLKP_LAG", "ASNP_LAG", "BACH_LAG", "UNEM_LAG", "MBSA_LAG",
"MHHI_LAG", "OWN_LAG", "YRMV_LAG", "RZ_LAG", "WS10_LAG","Y")
columns1 = c(columns,"CATE_STL","stl_rf")
columns2 = c(columns,"stl_rf","CATE_STL")
#Subset by different control areas
C_CA <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_1==1))) #Neighbourhood-only control area
C_CHI <- as.data.frame(subset(C,(C$TREAT==1|C$CONTR_2==1))) #Entire city control area
# Stage 1.1 of the spatial T-learner - Causal Forest on control sample
train <- C_CA[C_CA$TREAT == 0, ]
Yr <- train$HOM2017_old
Xr <- as.data.frame(cbind(train$HOM2017_LAG_old, train$POPD10, train$MVAL10, train$TREAT, train$HOM2010, train$MEDAGE10, train$BLKP10, train$ASNP10,
train$BACHP10 , train$UNEMP10 , train$MBSAP10 , train$MHHIN10 , train$OWNP10 , train$MYRMOV10 , train$R_ZONEP , train$WAS2010 , train$POPD10_LAG ,
train$TREAT_LAG , train$HOM2010_LAG_old , train$MEDA_LAG , train$BLKP_LAG , train$ASNP_LAG , train$BACH_LAG ,
train$UNEM_LAG , train$MBSA_LAG , train$MHHI_LAG ,
train$OWN_LAG , train$YRMV_LAG , train$RZ_LAG , train$WS10_LAG ))
rownames(Xr) <- train$GISJOIN
# first round of RF for STL
rf.risk <- regression_forest(Xr,Yr)
# Stage 1.2 of the spatial T-learner - Causal Forest on treatment sample
treat <- C_CA[C_CA$TREAT == 1, ]
Yt <- treat$HOM2017_old
Xt <- as.data.frame(cbind(treat$HOM2017_LAG_old, treat$POPD10, treat$MVAL10, treat$TREAT, treat$HOM2010_old, treat$MEDAGE10, treat$BLKP10, treat$ASNP10,
treat$BACHP10 , treat$UNEMP10 , treat$MBSAP10 , treat$MHHIN10 , treat$OWNP10 , treat$MYRMOV10 , treat$R_ZONEP , treat$WAS2010 , treat$POPD10_LAG ,
treat$TREAT_LAG , treat$HOM2010_LAG_old , treat$MEDA_LAG , treat$BLKP_LAG , treat$ASNP_LAG , treat$BACH_LAG ,
treat$UNEM_LAG , treat$MBSA_LAG , treat$MHHI_LAG ,
treat$OWN_LAG , treat$YRMV_LAG , treat$RZ_LAG , treat$WS10_LAG ), col.names = columns)
rownames(Xt) <- treat$GISJOIN
# predict Y hat on the treatment area using RF trained on control area
stl_rf <- predict(rf.risk, Xt)$predictions
#Find unit-level CATEs
treat2 <- cbind(Xt,Yt,stl_rf)
treat2$CATE_STL <- treat2$Yt - treat2$stl_rf #CATE = treated Y - predicted (i.e., counterfactual) Y
#Stage 2: predict unit-level CATEs for treated observations
rf.stl <- regression_forest(Xt,treat2$CATE_STL)
#Apply the model to untreated units to obtain predictions
CATE_STL <- predict(rf.stl, Xr)$predictions
untreat <- cbind(Xr,Yr,CATE_STL)
untreat$stl_rf <- -1000
colnames(untreat) <- columns1
untreat <- untreat[, c(seq(1,31),33,32)]
colnames(treat2) <- columns2
merge <- rbind(treat2, untreat)
merge <- cbind(GISJOIN = rownames(merge), merge)
rownames(merge) <- 1:nrow(merge)
#Find ATE for STL model
STL.ATE <- mean(merge$CATE_STL)
The map below shows CATE for the Control group 1 and the TREAT areas, where we observe the same effects as in 2017 - the treatment from the 606 can be seen in 2021, resulting in a decrease of homicides in the region. However, similar, but stronger than in 2017, relation can be observed in reference to the differences in CATE between the West and East parts of the Chicago area. We would suggest further research on the topic.
#Map CATE
#Merge the data with the spatial geometry
C_CA2 <- subset(C,(C$TREAT==1|C$CONTR_1==1)) #Create a subset of the control area w/spatial geometry intact
CF_map <- merge(C_CA2, merge, by="GISJOIN")
# st_write(CF_map, "output_shapefiles/CF_map.shp")
#Interactive mapping of two causal ML model results
#Map CATE
tmap_mode("view")
## tmap mode set to interactive viewing
tmap_leaflet(tm_shape(CF_map) + tm_fill("CATE_STL", breaks=c(-0.4,-0.3,-0.25,-0.22,-0.2,-0.175,-0.17,-0.165,-0.1625
,-0.16,-0.1575,-0.155,-0.15,0,0.8),
palette = "PuOr", midpoint = 0, title = "STL CATE", alpha=.5) +
tm_borders(alpha=.3, col="white", lwd = 1))
After our analysis we can conclude that the Chicago’s Bloomingdale Trail, widely recognized as The 606, had a positive effect on the number of homicides in the surrounding blocks (resulting in it’s decrease) in the short-term, as well as in the long term. However we suggest more research to be conducted concerning the topic of the 606’s effect on crime, especially on the differences in CATE between the West and East areas of the analyzed region of Chicago. Finally, we suggest to consider different approaches do data smoothing then Local Empirical Bayes.
Credit, K., Lehnert, M. A structured comparison of causal machine learning methods to assess heterogeneous treatment effects in spatial data. J Geogr Syst (2023). https://doi.org/10.1007/s10109-023-00413-0
Harris, Brandon & Larson, Lincoln & Ogletree, Scott. (2017). Different Views From The 606: Examining the Impacts of an Urban Greenway on Crime in Chicago. Environment and Behavior. 50. 001391651769019. 10.1177/0013916517690197.
Miró, F. (2014). Routine Activity Theory. In The Encyclopedia of Theoretical Criminology, J.M. Miller (Ed.). https://doi.org/10.1002/9781118517390.wbetc198