# data management
library(haven)
library(dplyr)
library(tidyverse)
library(tidycensus)
library(corrr)
# spatial analysis
library(sf)
library(spatialreg)
library(spdep)
library(spaMM)
# plot
library(ggplot2)
library(tigris)
library(maps)
library(tmap)
library(rmapshaper)
library(tidyrgeoda)
library(corrplot)
# table
library(flextable)
library(stargazer)
library(DT)
Import Contextual and Geo Data
yj <- read.csv("wi_county_data.csv")
wi_poly <- read_sf("County_Boundaries_24K/County_Boundaries_24K.shp")
yj$COUNTY_FIP <- as.factor(yj$COUNTY_FIP)
yj_dat <- left_join(wi_poly, yj, by = "COUNTY_FIP")
Global Moran’s I
### queen method
nb_q<-poly2nb(st_geometry(yj_dat),queen = T)
nb_q
## Neighbour list object:
## Number of regions: 72
## Number of nonzero links: 370
## Percentage nonzero weights: 7.137346
## Average number of links: 5.138889
moran.test(yj_dat$Court_Rate, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Court_Rate
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 0.27743, p-value = 0.3907
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.005379915 -0.014084507 0.004922432
moran.test(yj_dat$Close_Rate, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Close_Rate
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 1.939, p-value = 0.02625
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.122443597 -0.014084507 0.004957724
moran.test(yj_dat$DPA_Rate, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$DPA_Rate
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 4.3053, p-value = 8.336e-06
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.283585951 -0.014084507 0.004780303
moran.test(yj_dat$Youth_Services_100y, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Youth_Services_100y
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 4.2198, p-value = 1.223e-05
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.25500091 -0.01408451 0.00406627
moran.test(yj_dat$RUCS, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$RUCS
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 4.5526, p-value = 2.65e-06
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.306504984 -0.014084507 0.004958886
moran.test(yj_dat$WISH_Urban, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$WISH_Urban
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 2.4178, p-value = 0.007806
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.157805297 -0.014084507 0.005054117
moran.test(yj_dat$DA_Rep, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$DA_Rep
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 0.71065, p-value = 0.2386
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.036341399 -0.014084507 0.005034889
moran.test(yj_dat$Voter_Rep, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Voter_Rep
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 1.5542, p-value = 0.06007
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.092569304 -0.014084507 0.004709127
moran.test(yj_dat$Child_Poverty, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Child_Poverty
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 0.026049, p-value = 0.4896
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.012263548 -0.014084507 0.004886718
moran.test(yj_dat$White_Race, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$White_Race
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 0.68157, p-value = 0.2478
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.021370919 -0.014084507 0.002706073
moran.test(yj_dat$House_Turnover, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$House_Turnover
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 0.076489, p-value = 0.4695
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.008746125 -0.014084507 0.004871090
moran.test(yj_dat$Delinquency_100y, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Delinquency_100y
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 2.1416, p-value = 0.01611
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.131006222 -0.014084507 0.004589853
moran.test(yj_dat$Detention_Facilities, nb2listw(nb_q,style = "B"))
##
## Moran I test under randomisation
##
## data: yj_dat$Detention_Facilities
## weights: nb2listw(nb_q, style = "B")
##
## Moran I statistic standard deviate = 2.423, p-value = 0.007697
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## 0.154594595 -0.014084507 0.004846491
##
## Welch Two Sample t-test
##
## data: yj_dat$DA_Rep and yj_dat$White_Race
## t = -10.073, df = 79.062, p-value = 7.896e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.6862891 -0.4598220
## sample estimates:
## mean of x mean of y
## 0.3194444 0.8925000
##
## Welch Two Sample t-test
##
## data: yj_dat$WISH_Urban and yj_dat$White_Race
## t = -9.0815, df = 78.6, p-value = 7.036e-14
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.6478665 -0.4149113
## sample estimates:
## mean of x mean of y
## 0.3611111 0.8925000
##
## Welch Two Sample t-test
##
## data: yj_dat$Detention_Facilities and yj_dat$White_Race
## t = -15.725, df = 83.56, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.8176312 -0.6340355
## sample estimates:
## mean of x mean of y
## 0.1666667 0.8925000
court.ols.1 <- lm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat)
court.ols.2 <- lm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
dpa.ols.1 <- lm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat)
dpa.ols.2 <- lm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
close.ols.1 <- lm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat)
close.ols.2 <- lm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
wiw <- nb2listw(nb_q, style = "W", zero.policy = TRUE)
court.err.1 <- errorsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
court.err.2 <- errorsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.err.1 <- errorsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
dpa.err.2 <- errorsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.err.1 <- errorsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
close.err.2 <- errorsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
# construct spatial lag for predictors: Youth_Services_100y, RUCS
yj_dat$lag_Youth_Services_100y <- lag.listw(wiw,yj_dat$Youth_Services_100y)
court.lag.1a <- lagsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
court.lag.1b <- lagsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y,
data = yj_dat, listw=wiw)
court.lag.2a <- lagsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
court.lag.2b <- lagsarlm (Court_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.lag.1a <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
dpa.lag.1b <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y ,
data = yj_dat, listw=wiw)
dpa.lag.2a <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.lag.2b <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.lag.1a <- lagsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities,
data = yj_dat, listw=wiw)
close.lag.1b <- lagsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y ,
data = yj_dat, listw=wiw)
close.lag.2a <- lagsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep +Delinquency_100y + Detention_Facilities +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.lag.2b <- lagsarlm (Close_Rate ~ Youth_Services_100y +
RUCS + DA_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
| Dependent variable: | ||||
| Court_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| court.ols.2 | court.err.2 | court.lag.2a | court.lag.2b | |
| Youth_Services_100y | 0.278 | 0.224 | 0.262 | 0.309 |
| (0.322) | (0.246) | (0.291) | (0.335) | |
| RUCS | 0.001 | -0.001 | -0.003 | -0.004 |
| (0.016) | (0.014) | (0.014) | (0.015) | |
| DA_Rep | 0.003 | 0.006 | 0.001 | 0.002 |
| (0.034) | (0.029) | (0.031) | (0.031) | |
| Delinquency_100y | -0.027** | -0.023** | -0.027** | -0.026** |
| (0.013) | (0.010) | (0.012) | (0.012) | |
| Detention_Facilities | 0.039 | 0.075* | 0.044 | 0.044 |
| (0.052) | (0.045) | (0.047) | (0.047) | |
| lag_Youth_Services_100y | -0.168 | |||
| (0.595) | ||||
| Child_Poverty | 0.306 | 0.317 | 0.279 | 0.283 |
| (0.294) | (0.249) | (0.266) | (0.267) | |
| White_Race | -0.278* | -0.417*** | -0.307** | -0.310** |
| (0.158) | (0.128) | (0.143) | (0.144) | |
| House_Turnover | 0.976 | 0.759 | 0.871 | 0.831 |
| (0.611) | (0.521) | (0.555) | (0.574) | |
| scale(Average_Youth_Pop) | 0.038 | 0.033 | 0.040* | 0.040* |
| (0.023) | (0.021) | (0.021) | (0.021) | |
| scale(Crime_Rate_2021) | 0.0003 | 0.009 | 0.001 | 0.002 |
| (0.017) | (0.015) | (0.016) | (0.016) | |
| Constant | 0.468** | 0.605*** | 0.598*** | 0.611*** |
| (0.187) | (0.150) | (0.182) | (0.190) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.379 | |||
| Adjusted R2 | 0.277 | |||
| Log Likelihood | 56.644 | 54.185 | 54.225 | |
| sigma2 | 0.011 | 0.013 | 0.013 | |
| Akaike Inf. Crit. | -87.288 | -82.369 | -80.450 | |
| Residual Std. Error | 0.125 (df = 61) | |||
| F Statistic | 3.717*** (df = 10; 61) | |||
| Wald Test (df = 1) | 10.525*** | 1.799 | 1.767 | |
| LR Test (df = 1) | 6.715*** | 1.796 | 1.781 | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
| Dependent variable: | ||||
| DPA_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| dpa.ols.2 | dpa.err.2 | dpa.lag.2a | dpa.lag.2b | |
| Youth_Services_100y | 0.544** | 0.509** | 0.492** | 0.489* |
| (0.270) | (0.248) | (0.228) | (0.261) | |
| RUCS | 0.015 | 0.006 | 0.011 | 0.011 |
| (0.013) | (0.011) | (0.011) | (0.011) | |
| DA_Rep | 0.030 | 0.020 | 0.024 | 0.024 |
| (0.028) | (0.023) | (0.024) | (0.024) | |
| Delinquency_100y | -0.008 | -0.019** | -0.015 | -0.015 |
| (0.011) | (0.009) | (0.009) | (0.010) | |
| Detention_Facilities | 0.001 | 0.007 | 0.007 | 0.007 |
| (0.044) | (0.035) | (0.037) | (0.037) | |
| lag_Youth_Services_100y | 0.012 | |||
| (0.467) | ||||
| Child_Poverty | -0.208 | -0.155 | -0.190 | -0.190 |
| (0.247) | (0.194) | (0.208) | (0.208) | |
| White_Race | 0.292** | 0.321*** | 0.304*** | 0.304*** |
| (0.133) | (0.112) | (0.112) | (0.112) | |
| House_Turnover | -0.318 | -0.517 | -0.416 | -0.413 |
| (0.512) | (0.412) | (0.431) | (0.445) | |
| scale(Average_Youth_Pop) | -0.001 | 0.004 | 0.002 | 0.002 |
| (0.020) | (0.015) | (0.016) | (0.016) | |
| scale(Crime_Rate_2021) | 0.022 | 0.012 | 0.018 | 0.018 |
| (0.014) | (0.011) | (0.012) | (0.012) | |
| Constant | -0.089 | -0.026 | -0.137 | -0.137 |
| (0.157) | (0.134) | (0.134) | (0.138) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.281 | |||
| Adjusted R2 | 0.163 | |||
| Log Likelihood | 71.321 | 70.894 | 70.894 | |
| sigma2 | 0.008 | 0.008 | 0.008 | |
| Akaike Inf. Crit. | -116.641 | -115.787 | -113.788 | |
| Residual Std. Error | 0.105 (df = 61) | |||
| F Statistic | 2.385** (df = 10; 61) | |||
| Wald Test (df = 1) | 16.842*** | 11.019*** | 10.748*** | |
| LR Test (df = 1) | 10.630*** | 9.776*** | 9.440*** | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
| Dependent variable: | ||||
| Close_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| close.ols.2 | close.err.2 | close.lag.2a | close.lag.2b | |
| Youth_Services_100y | -0.926** | -0.825** | -0.849** | -0.815** |
| (0.394) | (0.374) | (0.353) | (0.406) | |
| RUCS | -0.020 | -0.017 | -0.022 | -0.023 |
| (0.019) | (0.017) | (0.017) | (0.017) | |
| DA_Rep | -0.034 | -0.022 | -0.032 | -0.031 |
| (0.042) | (0.036) | (0.037) | (0.037) | |
| Delinquency_100y | 0.033** | 0.048*** | 0.040*** | 0.040*** |
| (0.016) | (0.015) | (0.014) | (0.015) | |
| Detention_Facilities | -0.039 | -0.022 | -0.037 | -0.036 |
| (0.064) | (0.055) | (0.057) | (0.057) | |
| lag_Youth_Services_100y | -0.126 | |||
| (0.718) | ||||
| Child_Poverty | -0.110 | -0.242 | -0.163 | -0.159 |
| (0.360) | (0.306) | (0.322) | (0.322) | |
| White_Race | 0.063 | -0.062 | 0.020 | 0.019 |
| (0.194) | (0.173) | (0.173) | (0.174) | |
| House_Turnover | -0.678 | -0.804 | -0.771 | -0.799 |
| (0.748) | (0.645) | (0.669) | (0.690) | |
| scale(Average_Youth_Pop) | -0.036 | -0.039 | -0.036 | -0.035 |
| (0.029) | (0.024) | (0.026) | (0.026) | |
| scale(Crime_Rate_2021) | -0.021 | -0.008 | -0.017 | -0.016 |
| (0.021) | (0.018) | (0.019) | (0.019) | |
| Constant | 0.564** | 0.644*** | 0.482** | 0.494** |
| (0.229) | (0.206) | (0.213) | (0.222) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.223 | |||
| Adjusted R2 | 0.096 | |||
| Log Likelihood | 40.856 | 40.237 | 40.252 | |
| sigma2 | 0.018 | 0.019 | 0.019 | |
| Akaike Inf. Crit. | -55.712 | -54.475 | -52.504 | |
| Residual Std. Error | 0.154 (df = 61) | |||
| F Statistic | 1.754* (df = 10; 61) | |||
| Wald Test (df = 1) | 7.035*** | 3.570* | 3.394* | |
| LR Test (df = 1) | 4.341** | 3.104* | 2.844* | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
AICs<-c(AIC(court.ols.2),AIC(court.lag.2a), AIC(court.lag.2b), AIC(court.err.2))
BICs<-c(BIC(court.ols.2),BIC(court.lag.2a),BIC(court.lag.2b), BIC(court.err.2))
labels<-c("OLS", "SLM_DV", "SLM_DV_IV", "SEM" )
flextable(data.frame(Models=labels, AIC=round(AICs, 2), BIC=round(BICs, 2)))
Models | AIC | BIC |
|---|---|---|
OLS | -82.57 | -55.25 |
SLM_DV | -82.37 | -52.77 |
SLM_DV_IV | -80.45 | -48.58 |
SEM | -87.29 | -57.69 |
AICs<-c(AIC(dpa.ols.2),AIC(dpa.lag.2a), AIC(dpa.lag.2b), AIC(dpa.err.2))
BICs<-c(BIC(dpa.ols.2),BIC(dpa.lag.2a),BIC(dpa.lag.2b), BIC(dpa.err.2))
labels<-c("OLS", "SLM_DV", "SLM_DV_IV", "SEM" )
flextable(data.frame(Models=labels, AIC=round(AICs, 2), BIC=round(BICs, 2)))
Models | AIC | BIC |
|---|---|---|
OLS | -108.01 | -80.69 |
SLM_DV | -115.79 | -86.19 |
SLM_DV_IV | -113.79 | -81.91 |
SEM | -116.64 | -87.04 |
AICs<-c(AIC(close.ols.2),AIC(close.lag.2a), AIC(close.lag.2b), AIC(close.err.2))
BICs<-c(BIC(close.ols.2),BIC(close.lag.2a),BIC(close.lag.2b), BIC(close.err.2))
labels<-c("OLS", "SLM_DV", "SLM_DV_IV", "SEM" )
flextable(data.frame(Models=labels, AIC=round(AICs, 2), BIC=round(BICs, 2)))
Models | AIC | BIC |
|---|---|---|
OLS | -53.37 | -26.05 |
SLM_DV | -54.47 | -24.88 |
SLM_DV_IV | -52.50 | -20.63 |
SEM | -55.71 | -26.12 |
court.ols.2.sa <- lm (Court_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
dpa.ols.2.sa <- lm (DPA_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
close.ols.2.sa <- lm (Close_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
wiw <- nb2listw(nb_q, style = "W", zero.policy = TRUE)
court.err.2.sa <- errorsarlm (Court_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.err.2.sa <- errorsarlm (DPA_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.err.2.sa <- errorsarlm (Close_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
# construct spatial lag for predictors: Youth_Services_100y, RUCS
yj_dat$lag_Youth_Services_100y <- lag.listw(wiw,yj_dat$Youth_Services_100y)
court.lag.2a.sa <- lagsarlm (Court_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
court.lag.2b.sa <- lagsarlm (Court_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.lag.2a.sa <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
dpa.lag.2b.sa <- lagsarlm (DPA_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.lag.2a.sa <- lagsarlm (Close_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep +Delinquency_100y + Detention_Facilities +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
close.lag.2b.sa <- lagsarlm (Close_Rate ~ Youth_Services_100y +
WISH_Urban + Voter_Rep + Delinquency_100y + Detention_Facilities + lag_Youth_Services_100y +
Child_Poverty + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
| Dependent variable: | ||||
| Court_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| court.ols.2.sa | court.err.2.sa | court.lag.2a.sa | court.lag.2b.sa | |
| Youth_Services_100y | 0.372 | 0.402 | 0.373 | 0.379 |
| (0.313) | (0.262) | (0.288) | (0.334) | |
| WISH_Urban | -0.005 | 0.010 | 0.004 | 0.004 |
| (0.043) | (0.040) | (0.040) | (0.040) | |
| Voter_Rep | -0.001 | -0.002 | -0.001 | -0.001 |
| (0.002) | (0.002) | (0.002) | (0.002) | |
| Delinquency_100y | -0.027** | -0.023** | -0.027** | -0.027** |
| (0.013) | (0.011) | (0.012) | (0.012) | |
| Detention_Facilities | 0.046 | 0.066 | 0.048 | 0.048 |
| (0.054) | (0.049) | (0.050) | (0.050) | |
| lag_Youth_Services_100y | -0.023 | |||
| (0.609) | ||||
| Child_Poverty | 0.431 | 0.478* | 0.434 | 0.435 |
| (0.293) | (0.267) | (0.270) | (0.271) | |
| House_Turnover | 0.864 | 0.684 | 0.798 | 0.793 |
| (0.639) | (0.570) | (0.589) | (0.604) | |
| scale(Average_Youth_Pop) | 0.043* | 0.042** | 0.046** | 0.046** |
| (0.022) | (0.020) | (0.020) | (0.020) | |
| scale(Crime_Rate_2021) | -0.005 | -0.0003 | -0.005 | -0.005 |
| (0.017) | (0.015) | (0.015) | (0.016) | |
| Constant | 0.295* | 0.295** | 0.342** | 0.342** |
| (0.161) | (0.137) | (0.156) | (0.157) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.354 | |||
| Adjusted R2 | 0.260 | |||
| Log Likelihood | 53.231 | 52.322 | 52.323 | |
| sigma2 | 0.013 | 0.014 | 0.014 | |
| Akaike Inf. Crit. | -82.462 | -80.644 | -78.646 | |
| Residual Std. Error | 0.127 (df = 62) | |||
| F Statistic | 3.769*** (df = 9; 62) | |||
| Wald Test (df = 1) | 3.658* | 0.918 | 0.907 | |
| LR Test (df = 1) | 2.732* | 0.914 | 0.911 | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
| Dependent variable: | ||||
| DPA_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| dpa.ols.2.sa | dpa.err.2.sa | dpa.lag.2a.sa | dpa.lag.2b.sa | |
| Youth_Services_100y | 0.402 | 0.439* | 0.353 | 0.419 |
| (0.261) | (0.245) | (0.225) | (0.256) | |
| WISH_Urban | -0.009 | -0.002 | -0.004 | -0.002 |
| (0.036) | (0.029) | (0.031) | (0.031) | |
| Voter_Rep | 0.003** | 0.003** | 0.003*** | 0.004*** |
| (0.002) | (0.001) | (0.001) | (0.001) | |
| Delinquency_100y | -0.010 | -0.021** | -0.018** | -0.017* |
| (0.011) | (0.009) | (0.009) | (0.009) | |
| Detention_Facilities | -0.001 | 0.008 | 0.004 | 0.004 |
| (0.045) | (0.037) | (0.038) | (0.038) | |
| lag_Youth_Services_100y | -0.242 | |||
| (0.472) | ||||
| Child_Poverty | -0.202 | -0.205 | -0.207 | -0.197 |
| (0.245) | (0.198) | (0.208) | (0.208) | |
| House_Turnover | -0.039 | -0.257 | -0.139 | -0.193 |
| (0.534) | (0.438) | (0.452) | (0.463) | |
| scale(Average_Youth_Pop) | -0.010 | 0.0003 | -0.006 | -0.005 |
| (0.018) | (0.015) | (0.015) | (0.015) | |
| scale(Crime_Rate_2021) | 0.025* | 0.015 | 0.020* | 0.021* |
| (0.014) | (0.011) | (0.012) | (0.012) | |
| Constant | 0.040 | 0.094 | -0.015 | -0.011 |
| (0.135) | (0.120) | (0.115) | (0.115) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.257 | |||
| Adjusted R2 | 0.150 | |||
| Log Likelihood | 69.737 | 69.784 | 69.915 | |
| sigma2 | 0.008 | 0.008 | 0.008 | |
| Akaike Inf. Crit. | -115.474 | -115.568 | -113.830 | |
| Residual Std. Error | 0.106 (df = 62) | |||
| F Statistic | 2.387** (df = 9; 62) | |||
| Wald Test (df = 1) | 15.956*** | 11.566*** | 11.939*** | |
| LR Test (df = 1) | 9.803*** | 9.898*** | 10.154*** | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
| Dependent variable: | ||||
| Close_Rate | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| close.ols.2.sa | close.err.2.sa | close.lag.2a.sa | close.lag.2b.sa | |
| Youth_Services_100y | -0.909** | -0.804** | -0.815** | -0.807** |
| (0.378) | (0.362) | (0.342) | (0.395) | |
| WISH_Urban | 0.020 | 0.030 | 0.032 | 0.032 |
| (0.052) | (0.044) | (0.047) | (0.048) | |
| Voter_Rep | -0.002 | -0.002 | -0.002 | -0.002 |
| (0.002) | (0.002) | (0.002) | (0.002) | |
| Delinquency_100y | 0.035** | 0.050*** | 0.041*** | 0.041*** |
| (0.015) | (0.014) | (0.014) | (0.014) | |
| Detention_Facilities | -0.047 | -0.034 | -0.046 | -0.046 |
| (0.065) | (0.056) | (0.059) | (0.059) | |
| lag_Youth_Services_100y | -0.028 | |||
| (0.719) | ||||
| Child_Poverty | -0.301 | -0.311 | -0.300 | -0.298 |
| (0.354) | (0.303) | (0.320) | (0.321) | |
| House_Turnover | -0.852 | -0.977 | -0.923 | -0.929 |
| (0.772) | (0.669) | (0.696) | (0.713) | |
| scale(Average_Youth_Pop) | -0.032 | -0.036 | -0.029 | -0.029 |
| (0.026) | (0.023) | (0.024) | (0.024) | |
| scale(Crime_Rate_2021) | -0.017 | -0.007 | -0.014 | -0.014 |
| (0.020) | (0.017) | (0.018) | (0.018) | |
| Constant | 0.667*** | 0.631*** | 0.509*** | 0.510*** |
| (0.195) | (0.180) | (0.194) | (0.195) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.214 | |||
| Adjusted R2 | 0.100 | |||
| Log Likelihood | 40.861 | 39.745 | 39.745 | |
| sigma2 | 0.018 | 0.019 | 0.019 | |
| Akaike Inf. Crit. | -57.723 | -55.489 | -53.491 | |
| Residual Std. Error | 0.153 (df = 62) | |||
| F Statistic | 1.880* (df = 9; 62) | |||
| Wald Test (df = 1) | 7.452*** | 3.380* | 3.327* | |
| LR Test (df = 1) | 5.179** | 2.945* | 2.786* | |
| Note: | p<0.1; p<0.05; p<0.01 | |||
delin.ols.2 <- lm (Delinquency_100y ~ Youth_Services_100y +
RUCS + Detention_Facilities +
Child_Poverty + DA_Rep*White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat)
delin.err.2 <- errorsarlm (Delinquency_100y ~ Youth_Services_100y +
RUCS + Detention_Facilities +
Child_Poverty + DA_Rep*White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
delin.lag.2a <- lagsarlm (Delinquency_100y ~ Youth_Services_100y +
RUCS +Detention_Facilities +
Child_Poverty + DA_Rep*White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
delin.lag.2b <- lagsarlm (Delinquency_100y ~ Youth_Services_100y +
RUCS + Detention_Facilities +
lag_Youth_Services_100y +
Child_Poverty + DA_Rep*White_Race + House_Turnover +
scale(Average_Youth_Pop) + scale(Crime_Rate_2021),
data = yj_dat, listw=wiw)
| Dependent variable: | ||||
| Delinquency_100y | ||||
| OLS | Spatial Error Model | Spatial Lag Models | ||
| (1) | (2) | (3) | (4) | |
| delin.ols.2 | delin.err.2 | delin.lag.2a | delin.lag.2b | |
| Youth_Services_100y | -0.357 | -1.799 | -0.716 | -3.561 |
| (3.094) | (2.942) | (2.800) | (3.126) | |
| RUCS | 0.214 | 0.176 | 0.165 | 0.201 |
| (0.148) | (0.133) | (0.136) | (0.133) | |
| Detention_Facilities | -0.043 | -0.261 | -0.114 | -0.135 |
| (0.527) | (0.467) | (0.475) | (0.466) | |
| lag_Youth_Services_100y | 10.519* | |||
| (5.438) | ||||
| Child_Poverty | 2.410 | 2.706 | 2.734 | 2.357 |
| (2.826) | (2.477) | (2.547) | (2.499) | |
| DA_Rep | 6.031 | 6.492 | 6.585 | 7.151 |
| (5.076) | (4.534) | (4.579) | (4.497) | |
| White_Race | 1.179 | 1.417 | 1.376 | 1.544 |
| (1.564) | (1.410) | (1.410) | (1.385) | |
| House_Turnover | 8.214 | 10.074** | 8.655* | 10.451** |
| (5.815) | (5.090) | (5.252) | (5.234) | |
| scale(Average_Youth_Pop) | -0.159 | -0.105 | -0.131 | -0.139 |
| (0.224) | (0.197) | (0.202) | (0.198) | |
| scale(Crime_Rate_2021) | -0.100 | -0.124 | -0.117 | -0.152 |
| (0.165) | (0.145) | (0.149) | (0.148) | |
| DA_Rep:White_Race | -7.340 | -7.818 | -7.907 | -8.563* |
| (5.590) | (4.985) | (5.041) | (4.952) | |
| Constant | -0.671 | -0.846 | -1.286 | -1.955 |
| (1.805) | (1.647) | (1.651) | (1.672) | |
| Observations | 72 | 72 | 72 | 72 |
| R2 | 0.198 | |||
| Adjusted R2 | 0.067 | |||
| Log Likelihood | -108.498 | -108.548 | -106.800 | |
| sigma2 | 1.170 | 1.179 | 1.130 | |
| Akaike Inf. Crit. | 242.995 | 243.096 | 241.601 | |
| Residual Std. Error | 1.205 (df = 61) | |||
| F Statistic | 1.510 (df = 10; 61) | |||
| Wald Test (df = 1) | 3.485* | 2.499 | 1.252 | |
| LR Test (df = 1) | 2.232 | 2.130 | 1.062 | |
| Note: | p<0.1; p<0.05; p<0.01 | |||