The SPATIALREG Procedure

Example 31.1 Columbus Crime Data

Data Description and Objective

(View the complete code for this example.)

The data set CRIMEOH contains data from Columbus, Ohio, about the number of crimes (including residential burglaries and vehicle thefts) and possible determinants of crime. This data set is taken from Anselin (1988) and can be found in the SAS/ETS Sample Library.

The variable CRIME represents the number of crimes in 49 neighborhoods of Columbus, Ohio. Additional variables in the data set that you want to evaluate as determinants of crimes include INCOME (household income by $1000) and HVALUE (housing value by $1000). Summary statistics for these variables are computed by the following statements and presented in Output 31.1.1:

proc means data=crimeoh;
   var crime income hvalue;
run;

Output 31.1.1: Summary Statistics

The MEANS Procedure

VariableNMeanStd DevMinimumMaximum
crime
income
hvalue
49
49
49
35.1288367
14.3749388
38.4362245
16.7320385
5.7033781
18.4660693
0.1780000
4.4770000
17.9000000
68.8920000
31.0700000
96.4000000


The spatial relationships among the 49 neighborhoods are summarized using the first-order neighbor contiguity matrix, contained in the CRIMEWMAT data set. This data set is also taken from Anselin (1988) and can be found in the SAS/ETS Sample Library.

Spatial Autoregressive (SAR) Model

The following statements fit a SAR model to the data by using the regressors INCOME and HVALUE:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAR;
run;

In this example, the TYPE=SAR option in the MODEL statement specifies a SAR model. The NONORMALIZE option indicates that the spatial weights data set CRIMEWMAT should be used "as is" rather than be row-standardized. The parameter estimates for this model are shown in Output 31.1.2. According to the results, the spatial autoregressive coefficient is positive and significant at the 0.05 level. This indicates that there is a positive spatial dependence in the data.

Output 31.1.2: Parameter Estimates of SAR Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept145.0770707.8705905.73<.0001
income1-1.0315310.328403-3.140.0017
hvalue1-0.2659240.088218-3.010.0026
_rho10.4310200.1235943.490.0005
_sigma2195.48706619.5063124.90<.0001


Spatial Durbin Model (SDM)

To fit an SDM model, you specify the SPATIALEFFECTS statement together with the TYPE=SAR option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the SDM model.

The following statements fit an SDM model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAR;
   spatialeffects income hvalue;
run;

The parameter estimates are given in Output 31.1.3. As in the SAR model, the spatial autoregressive coefficient in the SDM model is positive and significant at the 0.05 level, indicating a positive spatial dependence in the data.

Output 31.1.3: Parameter Estimates of SDM Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept142.80345713.9244873.070.0021
income1-0.9142060.336439-2.720.0066
hvalue1-0.2937450.088857-3.310.0009
W_income1-0.5196400.594772-0.870.3823
W_hvalue10.2457160.1768541.390.1647
_rho10.4264920.1674922.550.0109
_sigma2191.77951918.9092224.85<.0001


In order to avoid potential collinearity with the intercept term in the MODEL statement, the SPATIALEFFECTS statement always excludes the intercept term. This means that only the explicitly specified variables in the SPATIALEFFECTS statement are used to construct spatial lag of covariate effects.

Spatial Error Model (SEM)

To fit an SEM model, use the TYPE=SEM option.

The following statements fit an SEM model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SEM;
run;

The parameter estimates are shown in Output 31.1.4. According to this output, the p-value for the spatial autoregressive parameter is 0.0002. The results indicate that there is a significant positive dependence in the error term.

Output 31.1.4: Parameter Estimates of SEM Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept159.8919075.88410310.18<.0001
income1-0.9413010.370267-2.540.0110
hvalue1-0.3022530.090552-3.340.0008
_lambda10.5617810.1524133.690.0002
_sigma2195.57208120.0374034.77<.0001


Spatial Durbin Error Model (SDEM)

To fit an SDEM model, use the SPATIALEFFECTS statement together with the TYPE=SEM option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the SDEM model.

The following statements fit an SDEM model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SEM;
   spatialeffects income hvalue;
run;

The parameter estimates are shown in Output 31.1.5.

Output 31.1.5: Parameter Estimates of SDEM Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept173.5405848.8609688.30<.0001
income1-1.0516990.322436-3.260.0011
hvalue1-0.2756070.091154-3.020.0025
W_income1-1.1565530.592915-1.950.0511
W_hvalue10.1117540.2023660.550.5808
_lambda10.4253970.1738312.450.0144
_sigma2192.53361419.0900224.85<.0001


Spatial Moving Average (SMA) Model

To fit an SMA model, use the TYPE=SMA option.

The following statements fit an SMA model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SMA;
run;

The parameter estimates are shown in Output 31.1.6.

Output 31.1.6: Parameter Estimates of SMA Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept159.2529715.9348619.98<.0001
income1-0.9218060.363482-2.540.0112
hvalue1-0.2873930.086880-3.310.0009
_lambda1-0.7990890.277861-2.880.0040
_sigma21117.73199026.3733224.46<.0001


Spatial Durbin Moving Average (SDMA) Model

To fit an SDMA model, use the SPATIALEFFECTS statement together with the TYPE=SMA option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the SDMA model.

The following statements fit an SDMA model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SMA;
   spatialeffects income hvalue;
run;

Partial output is shown in Output 31.1.7.

Output 31.1.7: Parameter Estimates of SDMA Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept173.9442119.0839778.14<.0001
income1-1.0656350.312045-3.420.0006
hvalue1-0.2668400.092400-2.890.0039
W_income1-1.0747570.584955-1.840.0662
W_hvalue10.0675680.2098670.320.7475
_lambda1-0.6421240.296638-2.160.0304
_sigma21103.50251622.4870274.60<.0001


Spatial Autoregressive Confused (SAC) Model

To fit an SAC model, use the TYPE=SAC option.

The following statements fit the SAC model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAC;
run;

The parameter estimates are shown in Output 31.1.8.

Output 31.1.8: Parameter Estimates of SAC Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept147.7789379.2784385.15<.0001
income1-1.0258400.334006-3.070.0021
hvalue1-0.2816360.093366-3.020.0026
_rho10.3681430.1811182.030.0421
_lambda10.1665260.2981150.560.5764
_sigma2195.59711719.4742694.91<.0001


Spatial Durbin Autoregressive Confused (SDAC) Model

To fit an SDAC model, use the SPATIALEFFECTS statement together with the TYPE=SAC option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the SDAC model.

The following statements fit an SDAC model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAC;
   spatialeffects income hvalue;
run;

The parameter estimates are shown in Output 31.1.9.

Output 31.1.9: Parameter Estimates of SDAC Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept150.82725631.0896211.630.1021
income1-0.9503520.353961-2.680.0073
hvalue1-0.2865590.091261-3.140.0017
W_income1-0.6904710.839980-0.820.4111
W_hvalue10.2089360.2225850.940.3479
_rho10.3167600.4147710.760.4450
_lambda10.1528840.4755120.320.7478
_sigma2193.13395819.1877434.85<.0001


Spatial Autoregressive Moving Average (SARMA) Model

To fit a SARMA model, use the TYPE=SARMA option.

The following statements fit a SARMA model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SARMA;
run;

The parameter estimates are shown in Output 31.1.10.

Output 31.1.10: Parameter Estimates of SARMA Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept148.9732479.6020395.10<.0001
income1-1.0163590.337215-3.010.0026
hvalue1-0.2874580.093079-3.090.0020
_rho10.3362810.2043171.650.0998
_lambda1-0.2719450.426840-0.640.5241
_sigma2197.99293621.2537684.61<.0001


Spatial Durbin Autoregressive Moving Average (SDARMA) Model

To fit an SDARMA model, use the SPATIALEFFECTS statement together with the TYPE=SARMA option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the SDARMA model.

The following statements fit an SDARMA model without an intercept term to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=SARMA noint;
   spatialeffects income hvalue;
run;

The parameter estimates are shown in Output 31.1.11.

Output 31.1.11: Parameter Estimates of SDARMA Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
income1-0.7922920.379696-2.090.0369
hvalue1-0.3285210.095588-3.440.0006
W_income10.5871220.4570901.280.1990
W_hvalue10.4385000.1361443.220.0013
_rho10.9577450.04191322.85<.0001
_lambda10.6913070.2609742.650.0081
_sigma2186.99040419.0341424.57<.0001


Linear Regression Model

To fit a linear model, use the TYPE=LINEAR option.

The following statements fit a linear model to the CRIMEOH data:

proc spatialreg data=crimeoh;
   model crime=income hvalue / type=LINEAR;
run;

Partial output is shown in Output 31.1.12.

Output 31.1.12: Parameter Estimates of Linear Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept168.6188634.58821014.96<.0001
income1-1.5973040.323739-4.93<.0001
hvalue1-0.2739310.099989-2.740.0062
_sigma21122.75169624.7994934.95<.0001


Spatial Lag of X Model

To fit an SLX model, use the SPATIALEFFECTS statement together with the TYPE=LINEAR option. In this example, the spatial lags of the regressors INCOME and HVALUE are considered in the linear model.

The following statements fit an SLX model to the CRIMEOH data:

proc spatialreg data=crimeoh Wmat=crimeWmat NONORMALIZE;
   model crime=income hvalue / type=LINEAR;
   spatialeffects income hvalue;
run;

The parameter estimates are shown in Output 31.1.13.

Output 31.1.13: Parameter Estimates of SLX Model

The SPATIALREG Procedure
 
Model: MODEL 1
Dependent Variable: crime

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept175.0281846.27995011.95<.0001
income1-1.1090200.354232-3.130.0017
hvalue1-0.2897340.096058-3.020.0026
W_income1-1.3708660.531889-2.580.0100
W_hvalue10.1917850.1898411.010.3124
_sigma21107.29237321.6763294.95<.0001


Last updated: November 05, 2018