The CSPATIALREG Procedure

Example 12.1 Columbus Crime Data

Data Description and Objective

The data set CrimeOH contains data from Columbus, Ohio, about numbers of crimes (including residential burglaries and vehicle thefts) and possible determinants of these crimes. This data set comes from Anselin (1988).

The variable Crime represents the number of crimes in 49 Columbus neighborhoods. Additional variables in the data set that you want to evaluate as determinants of these crimes include Income (household income by $1,000) and HValue (housing value by $1,000). Summary statistics for these variables are computed by the following statements and presented in Output 12.1.1:

proc means data=mycas.CrimeOH;
   var crime income hvalue;
run;

Output 12.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 also comes from Anselin (1988).

Spatial Autoregressive (SAR) Model

The following statements fit a spatial autoregressive (SAR) model to the data by using the regressors Income and HValue:

/*-- SAR --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAR;
   spatialid sid;
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 table mycas.CrimeWmat should be used "as is" rather than be row-standardized. The parameter estimates for this model are shown in Output 12.1.2. According to the results, the spatial autoregressive coefficient rho is positive and significant at the 0.05 level on the basis of the t statistic. This indicates a positive spatial dependence in the data.

Output 12.1.2: Parameter Estimates of SAR Model

The CSPATIALREG Procedure

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 a spatial Durbin model (SDM), you specify the SPATIALEFFECTS statement and specify the TYPE=SAR option in the MODEL statement or the PROC CSPATIALREG statement. In this example, the spatial lags of the regressors Income and HValue are considered in the SDM.

The following statements fit an SDM to the CrimeOH data:

/*-- SDM --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAR;
   spatialeffects income hvalue;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.3. As in the SAR model, the spatial autoregressive coefficient rho in the SDM is positive and significant at the 0.05 level on the basis of the t statistic, indicating a positive spatial dependence in the data.

Output 12.1.3: Parameter Estimates of SDM

The CSPATIALREG Procedure

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


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

Spatial Error Model (SEM)

To fit a spatial error model (SEM), specify the TYPE=SEM option in the MODEL statement or the PROC CSPATIALREG statement.

The following statements fit an SEM to the CrimeOH data:

/*-- SEM --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SEM;
   spatialid sid;
   restrict _lambda<0.99;
run;

The parameter estimates are shown in Output 12.1.4. According to this output, the p-value for the spatial autocorrelation parameter lamda is 0.0002 on the basis of the t statistic. The results indicate a significant positive dependence in the error term.

Output 12.1.4: Parameter Estimates of SEM

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept159.8919275.88411710.18<.0001
income1-0.9413030.370268-2.540.0110
hvalue1-0.3022530.090552-3.340.0008
_lambda10.5617790.1524133.690.0002
_sigma2195.57264320.0376374.77<.0001


Spatial Durbin Error Model (SDEM)

To fit a spatial Durbin error model (SDEM), use the SPATIALEFFECTS statement and specify the TYPE=SEM option in the MODEL statement or the PROC CSPATIALREG statement. In this example, the spatial lags of the regressors Income and HValue are considered in the SDEM.

The following statements fit an SDEM to the CrimeOH data:

/*-- SDEM --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SEM;
   spatialeffects income hvalue;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.5.

Output 12.1.5: Parameter Estimates of SDEM

The CSPATIALREG Procedure

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, specify the TYPE=SMA option in the PROC CSPATIALREG statement or the MODEL statement.

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

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SMA;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.6. According to the results, the spatial coefficient lamda is negative and significant at the 0.05 level on the basis of the t statistic. This indicates a positive spatial dependence in the errors.

Output 12.1.6: Parameter Estimates of SMA Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept159.5016745.80836510.24<.0001
income1-0.9360440.358739-2.610.0091
hvalue1-0.2886640.085995-3.360.0008
_lambda1-0.7772760.269238-2.890.0039
_sigma21113.54928224.3002374.67<.0001


Spatial Durbin Moving Average (SDMA) Model

To fit an SDMA model, use the SPATIALEFFECTS statement and specify the TYPE=SMA option in the PROC CSPATIALREG statement or the MODEL statement.

The following statements consider the spatial lags of the regressors INCOME and HVALUE and fit an SDMA model to the CRIMEOH data:

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SMA;
   spatialeffects income hvalue;
   spatialid sid;
run;

Partial output is shown in Output 12.1.7. According to the results, the spatial coefficient lamda is negative and significant at the 0.05 level on the basis of the t statistic. This indicates a positive spatial dependence in the errors.

Output 12.1.7: Parameter Estimates of an SDMA Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept173.9571548.9674368.25<.0001
income1-1.0670900.309862-3.440.0006
hvalue1-0.2669210.091627-2.910.0036
W_income1-1.0807940.579188-1.870.0620
W_hvalue10.0701540.2076690.340.7355
_lambda1-0.6314870.291251-2.170.0301
_sigma21101.83892321.6771344.70<.0001


Spatial Autoregressive Confused (SAC) Model

To fit an SAC model, specify the TYPE=SAC option in the PROC CSPATIALREG statement or the MODEL statement.

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

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAC;
   spatialid sid;
   restrict _lambda<0.99;
run;

The parameter estimates are shown in Output 12.1.8.

Output 12.1.8: Parameter Estimates of SAC Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept147.7788699.2784425.15<.0001
income1-1.0258390.334006-3.070.0021
hvalue1-0.2816360.093366-3.020.0026
_rho10.3681440.1811182.030.0421
_lambda10.1665250.2981140.560.5764
_sigma2195.59749019.4744224.91<.0001


Spatial Durbin Autoregressive Confused (SDAC) Model

To fit an SDAC model, use the SPATIALEFFECTS statement and specify the TYPE=SAC option in the PROC CSPATIALREG statement or the MODEL statement.

The following statements consider the spatial lags of the regressors INCOME and HVALUE and fit an SDAC model to the CRIMEOH data:

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SAC;
   spatialeffects income hvalue;
   spatialid sid;
   restrict _lambda<0.99;
run;

The parameter estimates are shown in Output 12.1.9.

Output 12.1.9: Parameter Estimates of SDAC Model

The CSPATIALREG Procedure

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, specify the TYPE=SARMA option in the PROC CSPATIALREG statement or the MODEL statement.

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

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SARMA;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.10.

Output 12.1.10: Parameter Estimates of SARMA Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept148.6694109.4896145.13<.0001
income1-1.0199620.333025-3.060.0022
hvalue1-0.2864230.092418-3.100.0019
_rho10.3454230.1976831.750.0806
_lambda1-0.2493670.409692-0.610.5427
_sigma2195.84152320.1649464.75<.0001


Spatial Durbin Autoregressive Moving Average (SDARMA) Model

To fit an SDARMA model, use the SPATIALEFFECTS statement and specify the TYPE=SARMA option in the PROC CSPATIALREG statement or the MODEL statement.

The following statements consider the spatial lag of the regressor HVALUE and fit an SDARMA model to the CRIMEOH data:

proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=SARMA;
   spatialeffects hvalue;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.11.

Output 12.1.11: Parameter Estimates of SDARMA Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept130.02228816.5097841.820.0690
income1-0.9579470.331495-2.890.0039
hvalue1-0.2936470.090435-3.250.0012
W_hvalue10.2423580.2038131.190.2344
_rho10.5945380.2299512.590.0097
_lambda10.1983200.4451020.450.6559
_sigma2188.20944818.4527984.78<.0001


Linear Regression Model

To fit a linear model, specify the TYPE=LINEAR option in the MODEL statement or the PROC CSPATIALREG statement.

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

/*-- LINEAR --*/
proc cspatialreg data=mycas.CrimeOH;
   model crime=income hvalue / type=LINEAR;
run;

Partial output is shown in Output 12.1.12.

Output 12.1.12: Parameter Estimates of Linear Model

The CSPATIALREG Procedure

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 (SLX) Model

To fit a spatial lag of X (SLX) model, use the SPATIALEFFECTS statement and specify the TYPE=LINEAR option in the MODEL statement or the PROC CSPATIALREG statement.

The following statements consider the spatial lags of the regressors Income and HValue and fit an SLX model to the CrimeOH data:

/*-- SLX --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeWmat NONORMALIZE;
   model crime=income hvalue / type=LINEAR;
   spatialeffects income hvalue;
   spatialid sid;
run;

The parameter estimates are shown in Output 12.1.13.

Output 12.1.13: Parameter Estimates of SLX Model

The CSPATIALREG Procedure

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


Conditional Autoregressive (CAR) Model

The following statements fit a conditional autoregressive (CAR) model to the data by including the two regressors—Income and HValue:

/*-- CAR --*/
proc cspatialreg data=mycas.CrimeOH Wmat=mycas.CrimeCmat;
   model crime=income hvalue / type=CAR;
   spatialid sid;
run;

In this example, the TYPE=CAR option in the MODEL statement specifies a CAR model. By default, the spatial weights data table mycas.CrimeCmat is row-standardized. The parameter estimates for this model are shown in Output 12.1.14. According to the results, the spatial autoregressive coefficient rho is positive and significant at the 0.05 level on the basis of the t statistic. This indicates a positive spatial dependence in the data.

Output 12.1.14: Parameter Estimates of CAR Model

The CSPATIALREG Procedure

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept165.1059985.24046212.42<.0001
income1-1.0440470.360941-2.890.0038
hvalue1-0.3417770.099814-3.420.0006
_rho10.8334850.1547495.39<.0001
_sigma21418.23040890.0299744.65<.0001


Last updated: January 27, 2023