The CSPATIALREG Procedure
Example 12.1 Columbus Crime Data
- Data Description and Objective
- Spatial Autoregressive (SAR) Model
- Spatial Durbin Model (SDM)
- Spatial Error Model (SEM)
- Spatial Durbin Error Model (SDEM)
- Spatial Moving Average (SMA) Model
- Spatial Durbin Moving Average (SDMA) Model
- Spatial Autoregressive Confused (SAC) Model
- Spatial Durbin Autoregressive Confused (SDAC) Model
- Spatial Autoregressive Moving Average (SARMA) Model
- Spatial Durbin Autoregressive Moving Average (SDARMA) Model
- Linear Regression Model
- Spatial Lag of X (SLX) Model
- Conditional Autoregressive (CAR) Model
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
| Variable | N | Mean | Std Dev | Minimum | Maximum | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 45.077070 | 7.870590 | 5.73 | <.0001 |
| income | 1 | -1.031531 | 0.328403 | -3.14 | 0.0017 |
| hvalue | 1 | -0.265924 | 0.088218 | -3.01 | 0.0026 |
| _rho | 1 | 0.431020 | 0.123594 | 3.49 | 0.0005 |
| _sigma2 | 1 | 95.487066 | 19.506312 | 4.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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 42.803457 | 13.924487 | 3.07 | 0.0021 |
| income | 1 | -0.914206 | 0.336439 | -2.72 | 0.0066 |
| hvalue | 1 | -0.293745 | 0.088857 | -3.31 | 0.0009 |
| W_income | 1 | -0.519640 | 0.594772 | -0.87 | 0.3823 |
| W_hvalue | 1 | 0.245716 | 0.176854 | 1.39 | 0.1647 |
| _rho | 1 | 0.426492 | 0.167492 | 2.55 | 0.0109 |
| _sigma2 | 1 | 91.779519 | 18.909222 | 4.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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 59.891927 | 5.884117 | 10.18 | <.0001 |
| income | 1 | -0.941303 | 0.370268 | -2.54 | 0.0110 |
| hvalue | 1 | -0.302253 | 0.090552 | -3.34 | 0.0008 |
| _lambda | 1 | 0.561779 | 0.152413 | 3.69 | 0.0002 |
| _sigma2 | 1 | 95.572643 | 20.037637 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 73.540584 | 8.860968 | 8.30 | <.0001 |
| income | 1 | -1.051699 | 0.322436 | -3.26 | 0.0011 |
| hvalue | 1 | -0.275607 | 0.091154 | -3.02 | 0.0025 |
| W_income | 1 | -1.156553 | 0.592915 | -1.95 | 0.0511 |
| W_hvalue | 1 | 0.111754 | 0.202366 | 0.55 | 0.5808 |
| _lambda | 1 | 0.425397 | 0.173831 | 2.45 | 0.0144 |
| _sigma2 | 1 | 92.533614 | 19.090022 | 4.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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 59.501674 | 5.808365 | 10.24 | <.0001 |
| income | 1 | -0.936044 | 0.358739 | -2.61 | 0.0091 |
| hvalue | 1 | -0.288664 | 0.085995 | -3.36 | 0.0008 |
| _lambda | 1 | -0.777276 | 0.269238 | -2.89 | 0.0039 |
| _sigma2 | 1 | 113.549282 | 24.300237 | 4.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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 73.957154 | 8.967436 | 8.25 | <.0001 |
| income | 1 | -1.067090 | 0.309862 | -3.44 | 0.0006 |
| hvalue | 1 | -0.266921 | 0.091627 | -2.91 | 0.0036 |
| W_income | 1 | -1.080794 | 0.579188 | -1.87 | 0.0620 |
| W_hvalue | 1 | 0.070154 | 0.207669 | 0.34 | 0.7355 |
| _lambda | 1 | -0.631487 | 0.291251 | -2.17 | 0.0301 |
| _sigma2 | 1 | 101.838923 | 21.677134 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 47.778869 | 9.278442 | 5.15 | <.0001 |
| income | 1 | -1.025839 | 0.334006 | -3.07 | 0.0021 |
| hvalue | 1 | -0.281636 | 0.093366 | -3.02 | 0.0026 |
| _rho | 1 | 0.368144 | 0.181118 | 2.03 | 0.0421 |
| _lambda | 1 | 0.166525 | 0.298114 | 0.56 | 0.5764 |
| _sigma2 | 1 | 95.597490 | 19.474422 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 50.827256 | 31.089621 | 1.63 | 0.1021 |
| income | 1 | -0.950352 | 0.353961 | -2.68 | 0.0073 |
| hvalue | 1 | -0.286559 | 0.091261 | -3.14 | 0.0017 |
| W_income | 1 | -0.690471 | 0.839980 | -0.82 | 0.4111 |
| W_hvalue | 1 | 0.208936 | 0.222585 | 0.94 | 0.3479 |
| _rho | 1 | 0.316760 | 0.414771 | 0.76 | 0.4450 |
| _lambda | 1 | 0.152884 | 0.475512 | 0.32 | 0.7478 |
| _sigma2 | 1 | 93.133958 | 19.187743 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 48.669410 | 9.489614 | 5.13 | <.0001 |
| income | 1 | -1.019962 | 0.333025 | -3.06 | 0.0022 |
| hvalue | 1 | -0.286423 | 0.092418 | -3.10 | 0.0019 |
| _rho | 1 | 0.345423 | 0.197683 | 1.75 | 0.0806 |
| _lambda | 1 | -0.249367 | 0.409692 | -0.61 | 0.5427 |
| _sigma2 | 1 | 95.841523 | 20.164946 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 30.022288 | 16.509784 | 1.82 | 0.0690 |
| income | 1 | -0.957947 | 0.331495 | -2.89 | 0.0039 |
| hvalue | 1 | -0.293647 | 0.090435 | -3.25 | 0.0012 |
| W_hvalue | 1 | 0.242358 | 0.203813 | 1.19 | 0.2344 |
| _rho | 1 | 0.594538 | 0.229951 | 2.59 | 0.0097 |
| _lambda | 1 | 0.198320 | 0.445102 | 0.45 | 0.6559 |
| _sigma2 | 1 | 88.209448 | 18.452798 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 68.618863 | 4.588210 | 14.96 | <.0001 |
| income | 1 | -1.597304 | 0.323739 | -4.93 | <.0001 |
| hvalue | 1 | -0.273931 | 0.099989 | -2.74 | 0.0062 |
| _sigma2 | 1 | 122.751696 | 24.799493 | 4.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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 75.028184 | 6.279950 | 11.95 | <.0001 |
| income | 1 | -1.109020 | 0.354232 | -3.13 | 0.0017 |
| hvalue | 1 | -0.289734 | 0.096058 | -3.02 | 0.0026 |
| W_income | 1 | -1.370866 | 0.531889 | -2.58 | 0.0100 |
| W_hvalue | 1 | 0.191785 | 0.189841 | 1.01 | 0.3124 |
| _sigma2 | 1 | 107.292373 | 21.676329 | 4.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 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
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 65.105998 | 5.240462 | 12.42 | <.0001 |
| income | 1 | -1.044047 | 0.360941 | -2.89 | 0.0038 |
| hvalue | 1 | -0.341777 | 0.099814 | -3.42 | 0.0006 |
| _rho | 1 | 0.833485 | 0.154749 | 5.39 | <.0001 |
| _sigma2 | 1 | 418.230408 | 90.029974 | 4.65 | <.0001 |