h1: close proximity

h2: greater travel

h3: socioeconomic status

h4: race

other controls

case6 <- read.csv("~/Dropbox (ASU)/Papers/Neighborhood COVID/Data/FullData.csv")
   
## reading in shapefile
tractLA <- shapefile('~/Dropbox (ASU)/Papers/Neighborhood COVID/Data/tl_2019_22_tract/tl_2019_22_tract.shp')


tractLA2 <- merge(tractLA, case6, by.x="GEOID",  by.y="Tract.ID")

f1 <- cpcln~ log(popdens)+pubtransit+ outsidecounty+tourismemp+collegepct+povpct+noinsurance+blackpct+hisppct+asianpct+otherracepct+DiversityIndex+over70pct+male

summary(ols <-lm(f1, data=tractLA2@data))
## 
## Call:
## lm(formula = f1, data = tractLA2@data)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -0.0124460 -0.0028313 -0.0004756  0.0018495  0.0270728 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    -0.0081419  0.0020279  -4.015 6.37e-05 ***
## log(popdens)    0.0006356  0.0001082   5.874 5.72e-09 ***
## pubtransit      0.0368281  0.0040390   9.118  < 2e-16 ***
## outsidecounty   0.0099831  0.0008814  11.326  < 2e-16 ***
## tourismemp      0.0057477  0.0027620   2.081 0.037674 *  
## collegepct     -0.0001419  0.0012095  -0.117 0.906606    
## povpct         -0.0097230  0.0017027  -5.710 1.47e-08 ***
## noinsurance    -0.0112068  0.0036191  -3.097 0.002010 ** 
## blackpct        0.0117483  0.0007934  14.807  < 2e-16 ***
## hisppct         0.0258909  0.0032164   8.050 2.24e-15 ***
## asianpct        0.0197914  0.0045690   4.332 1.62e-05 ***
## otherracepct    0.0228950  0.0060638   3.776 0.000169 ***
## DiversityIndex -0.0037527  0.0010379  -3.616 0.000314 ***
## over70pct       0.0261171  0.0038315   6.816 1.57e-11 ***
## male            0.0026486  0.0033073   0.801 0.423411    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.004514 on 1048 degrees of freedom
##   (85 observations deleted due to missingness)
## Multiple R-squared:  0.488,  Adjusted R-squared:  0.4811 
## F-statistic: 71.34 on 14 and 1048 DF,  p-value: < 2.2e-16
covid_nbq <- poly2nb(tractLA2)  #Queenโ€™s neighborhood
covid_nbq_w <- nb2listw(covid_nbq, style="W")

## Spatial Lag Model

summary(covid_LAG <- lagsarlm(f1, data = tractLA2@data, covid_nbq_w))
## Warning: Function lagsarlm moved to the spatialreg package
## 
## Call:spatialreg::lagsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, type = type, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##         Min          1Q      Median          3Q         Max 
## -0.01002621 -0.00182169 -0.00037226  0.00107065  0.02506775 
## 
## Type: lag 
## Coefficients: (asymptotic standard errors) 
##                   Estimate  Std. Error z value  Pr(>|z|)
## (Intercept)    -6.0020e-03  1.6087e-03 -3.7309 0.0001908
## log(popdens)    2.3010e-04  8.6929e-05  2.6469 0.0081229
## pubtransit      1.2966e-02  3.2825e-03  3.9501 7.813e-05
## outsidecounty   4.2763e-03  7.1425e-04  5.9872 2.135e-09
## tourismemp      2.8212e-03  2.1896e-03  1.2885 0.1975850
## collegepct     -4.3052e-04  9.5868e-04 -0.4491 0.6533798
## povpct         -5.4476e-03  1.3631e-03 -3.9965 6.428e-05
## noinsurance    -2.8818e-03  2.8746e-03 -1.0025 0.3160992
## blackpct        7.4628e-03  6.7420e-04 11.0691 < 2.2e-16
## hisppct         1.2617e-02  2.5962e-03  4.8596 1.176e-06
## asianpct        7.0571e-03  3.6476e-03  1.9347 0.0530232
## otherracepct    1.3886e-02  4.8127e-03  2.8852 0.0039118
## DiversityIndex -2.3554e-03  8.2829e-04 -2.8437 0.0044599
## over70pct       2.0683e-02  3.0447e-03  6.7932 1.097e-11
## male            3.3583e-03  2.6210e-03  1.2813 0.2000941
## 
## Rho: 0.60481, LR test value: 393.48, p-value: < 2.22e-16
## Asymptotic standard error: 0.026903
##     z-value: 22.481, p-value: < 2.22e-16
## Wald statistic: 505.4, p-value: < 2.22e-16
## 
## Log likelihood: 4436.856 for lag model
## ML residual variance (sigma squared): 1.2792e-05, (sigma: 0.0035766)
## Number of observations: 1063 
## Number of parameters estimated: 17 
## AIC: -8839.7, (AIC for lm: -8448.2)
## LM test for residual autocorrelation
## test value: 32.283, p-value: 1.3327e-08
## Spatial Error Model


summary(covid_error <- errorsarlm(f1, data = tractLA2@data, covid_nbq_w))
## Warning: Function errorsarlm moved to the spatialreg package
## 
## Call:
## spatialreg::errorsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, etype = etype, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##         Min          1Q      Median          3Q         Max 
## -0.00995327 -0.00179853 -0.00045815  0.00087272  0.02608968 
## 
## Type: error 
## Coefficients: (asymptotic standard errors) 
##                   Estimate  Std. Error z value  Pr(>|z|)
## (Intercept)    -0.00161963  0.00179112 -0.9043 0.3658577
## log(popdens)    0.00008065  0.00011509  0.7008 0.4834401
## pubtransit      0.00721094  0.00398289  1.8105 0.0702215
## outsidecounty   0.00096851  0.00100465  0.9640 0.3350352
## tourismemp      0.00201946  0.00220289  0.9167 0.3592830
## collegepct     -0.00185477  0.00132748 -1.3972 0.1623506
## povpct         -0.00494857  0.00151181 -3.2733 0.0010631
## noinsurance    -0.00151196  0.00286296 -0.5281 0.5974231
## blackpct        0.00957644  0.00078153 12.2535 < 2.2e-16
## hisppct         0.00964557  0.00297314  3.2442 0.0011777
## asianpct        0.00607079  0.00475970  1.2755 0.2021473
## otherracepct    0.01074468  0.00529611  2.0288 0.0424801
## DiversityIndex -0.00333548  0.00093104 -3.5825 0.0003403
## over70pct       0.02183397  0.00321778  6.7854 1.158e-11
## male            0.00570073  0.00242669  2.3492 0.0188151
## 
## Lambda: 0.75563, LR test value: 361.01, p-value: < 2.22e-16
## Asymptotic standard error: 0.023652
##     z-value: 31.948, p-value: < 2.22e-16
## Wald statistic: 1020.7, p-value: < 2.22e-16
## 
## Log likelihood: 4420.624 for error model
## ML residual variance (sigma squared): 1.2408e-05, (sigma: 0.0035225)
## Number of observations: 1063 
## Number of parameters estimated: 17 
## AIC: -8807.2, (AIC for lm: -8448.2)