----------------------------------------------------------------------
      name:  <unnamed>
       log:  analysis.log
  log type:  text
 opened on:  01 Dec 2023, 10:00:00

. ****************************************************
. * Cross-Sectional Spatial Regression in Stata:
. * Crime in Columbus Neighborhoods
. ****************************************************

. clear all

. macro drop _all

. set more off

.
. *---------------------------------------------------
. * Section 3: Setup and data loading
. *---------------------------------------------------

. * 3.1 Spatial weight matrix
. use "https://github.com/quarcs-lab/data-open/raw/master/Columbus/columbus/Wqueen_fromStata_spmat.dta", clear

. gen id = _n

. order id, first

. spset id
  Spaceset variable: id
        Data has been set.

. spmatrix fromdata WqueenS_fromStata15 = v*, normalize(row) replace

. spmatrix summarize WqueenS_fromStata15

Summary of spatial-weighting matrix WqueenS_fromStata15

                    Dimension: 49 x 49
               Stored as type: 49 x 49
        Number of stored links: 230
  Percent of stored links > 0: 100.0%
            Total stored links: 230

.
. * 3.2 Dataset
. use "https://github.com/quarcs-lab/data-open/raw/master/Columbus/columbus/columbusDbase.dta", clear

. spset id
  Sp aceset variable: id
        Data has been set.

. label var CRIME "Crime"

. label var INC   "Income"

. label var HOVAL "House value"

.
. *---------------------------------------------------
. * Section 4: OLS baseline and spatial diagnostics
. *---------------------------------------------------

. * 4.1 OLS regression
. regress CRIME INC HOVAL

      Source |       SS           df       MS      Number of obs   =        49
-------------+----------------------------------   F(2, 46)        =     28.39
       Model |  5765.1758         2  2882.58790   Prob > F        =    0.0000
    Residual |  4670.9736        46  101.54290   R-squared       =    0.5524
-------------+----------------------------------   Adj R-squared   =    0.5330
       Total |  10436.1494        48  217.41978   Root MSE        =    10.077

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         INC |  -1.597311   .3341308    -4.78   0.000    -2.269967   -.9246553
       HOVAL |  -.2739315   .1031999    -2.65   0.011    -.4816777   -.0661854
       _cons |   68.61896   4.735292    14.49   0.000     59.08750    78.15042
------------------------------------------------------------------------------

. eststo OLS

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49  -229.3837  -210.0794       3   426.1588   431.7981
             |                                        3   378.1588*  383.7981
-------------+----------------------------------------------------------------
Note: BIC uses N = number of observations. See [R] IC note.
      * indicates the best model using the respective criterion.

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. * 4.2 Moran's I test on OLS residuals
. regress CRIME INC HOVAL

      Source |       SS           df       MS      Number of obs   =        49
-------------+----------------------------------   F(2, 46)        =     28.39
       Model |  5765.1758         2  2882.58790   Prob > F        =    0.0000
    Residual |  4670.9736        46  101.54290   R-squared       =    0.5524
-------------+----------------------------------   Adj R-squared   =    0.5330
       Total |  10436.1494        48  217.41978   Root MSE        =    10.077

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         INC |  -1.597311   .3341308    -4.78   0.000    -2.269967   -.9246553
       HOVAL |  -.2739315   .1031999    -2.65   0.011    -.4816777   -.0661854
       _cons |   68.61896   4.735292    14.49   0.000     59.08750    78.15042
------------------------------------------------------------------------------

. estat moran, errorlag(WqueenS_fromStata15)

Moran's I test for spatial dependence in the error distribution

         H0: error is i.i.d.

              I = 0.2222
         E(I) = -0.0208
    sd(I) = 0.0855

              z = 2.84
         Prob > z = 0.0045

.
. * 4.3 LM tests (requires spatwmat/spatdiag)
. spatwmat using "https://github.com/quarcs-lab/data-open/raw/master/Columbus/columbus/Wqueen_fromStata_spmat.dta", name(WqueenS_spatwmat) eigenval(eWqueenS_spatwmat) standardize

.
. quietly reg CRIME INC HOVAL

. spatdiag, weights(WqueenS_spatwmat)

Spatial Diagnostics
-------------------

Diagnostic                         Statistic     df     p-value
---------------------------------------------------------------
Spatial error:
  Moran's I                          2.838        1      0.005
  Lagrange multiplier                5.327        1      0.021
  Robust Lagrange multiplier         2.196        1      0.138

Spatial lag:
  Lagrange multiplier                3.412        1      0.065
  Robust Lagrange multiplier         0.281        1      0.596
---------------------------------------------------------------

.
. *---------------------------------------------------
. * Section 5: First-generation spatial models
. *---------------------------------------------------

. * 5.1 SAR (Spatial Autoregressive / Spatial Lag)
. spregress CRIME INC HOVAL, ml dvarlag(WqueenS_fromStata15)

Spatial autoregressive model                      Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(2)    =      54.83
                                                  Prob > chi2     =     0.0000
Log-likelihood = -184.9262                        Pseudo R2       =     0.5830

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -1.031218   .3359487    -3.07   0.002    -1.689665   -.3727706
       HOVAL |  -.2654187   .0921835    -2.88   0.004    -.4460950   -.0847425
       _cons |   45.07187   7.840615     5.75   0.000     29.70452    60.43923
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
       CRIME |   .4282614   .1228467     3.49   0.000     .1874863    .6690364
-------------+----------------------------------------------------------------
   /sigma2_e |   80.93012   16.36204                      54.90534   119.31143
------------------------------------------------------------------------------

. eststo SAR

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -184.9262       5   379.8524   389.2615
             |                                        5   373.8524*  383.2615
-------------+----------------------------------------------------------------
Note: BIC uses N = number of observations. See [R] IC note.

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC | -1.1024     .3486     -3.16   0.002    -1.7857    -.4191
                HOVAL |  -.2838     .0983     -2.89   0.004    -.4765    -.0911
----------------------------------------------------------------------------------
Indirect              |
                  INC |  -.7594     .3712     -2.05   0.041    -1.4870    -.0319
                HOVAL |  -.1954     .1123     -1.74   0.082    -.4156     .0247
----------------------------------------------------------------------------------
Total                 |
                  INC | -1.8618     .5803     -3.21   0.001    -2.9991    -.7245
                HOVAL |  -.4792     .1722     -2.78   0.005    -.8167    -.1417
----------------------------------------------------------------------------------

.
. * 5.2 SEM (Spatial Error Model)
. spregress CRIME INC HOVAL, ml errorlag(WqueenS_fromStata15)

Spatial error model                               Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(2)    =      50.51
                                                  Prob > chi2     =     0.0000
Log-likelihood = -184.3792                        Pseudo R2       =     0.5877

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -.9376126   .3393120    -2.76   0.006    -1.6026520   -.2725732
       HOVAL |  -.3023101   .0909284    -3.32   0.001    -.4805264   -.1240937
       _cons |   59.62283   5.472159    10.90   0.000     48.89758    70.34808
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
     lambda  |   .5623481   .1329743     4.23   0.000     .3017234    .8229728
-------------+----------------------------------------------------------------
   /sigma2_e |   74.68211   15.10203                      50.71684   109.96143
------------------------------------------------------------------------------

. eststo SEM

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -184.3792       5   378.7584   388.1675
             |                                        5   372.7584*  382.1675
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC |  -.9376     .3393     -2.76   0.006    -1.6027    -.2726
                HOVAL |  -.3023     .0909     -3.32   0.001    -.4805    -.1241
----------------------------------------------------------------------------------
Indirect              |
                  INC |   .0000     .0000         .       .        .         .
                HOVAL |   .0000     .0000         .       .        .         .
----------------------------------------------------------------------------------
Total                 |
                  INC |  -.9376     .3393     -2.76   0.006    -1.6027    -.2726
                HOVAL |  -.3023     .0909     -3.32   0.001    -.4805    -.1241
----------------------------------------------------------------------------------

.
. *---------------------------------------------------
. * Section 6: Models with spatial lags of X
. *---------------------------------------------------

. * 6.1 SLX (Spatial Lag of X)
. spregress CRIME INC HOVAL, ml ivarlag(WqueenS_fromStata15: INC HOVAL)

Spatial lag of X model                            Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(4)    =      59.12
                                                  Prob > chi2     =     0.0000
Log-likelihood = -187.5218                        Pseudo R2       =     0.5607

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -1.472514   .3564127    -4.13   0.000    -2.171071   -.7739571
       HOVAL |  -.3087321   .0942617    -3.27   0.001    -.4934816   -.1239826
       _cons |   74.27642   7.564388     9.82   0.000     59.45050    89.10233
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
         INC |   .4965121   .5309834     0.94   0.350    -.5442062    1.537231
       HOVAL |  -.1487230   .2529164    -0.59   0.557    -.6444300    .3469841
-------------+----------------------------------------------------------------
   /sigma2_e |   87.47219   17.68413                      59.34671   128.84631
------------------------------------------------------------------------------

. eststo SLX

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -187.5218       6   387.0436   398.3325
             |                                        6   379.0436*  390.3325
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC | -1.4725     .3564     -4.13   0.000    -2.1711    -.7740
                HOVAL |  -.3087     .0943     -3.27   0.001    -.4935    -.1240
----------------------------------------------------------------------------------
Indirect              |
                  INC |   .4965     .5310      0.94   0.350    -.5442    1.5372
                HOVAL |  -.1487     .2529     -0.59   0.557    -.6444     .3470
----------------------------------------------------------------------------------
Total                 |
                  INC |  -.9760     .5825     -1.68   0.094    -2.1177     .1657
                HOVAL |  -.4575     .2639     -1.73   0.083    -.9747     .0598
----------------------------------------------------------------------------------

.
. * 6.2 SDM (Spatial Durbin Model)
. spregress CRIME INC HOVAL, ml dvarlag(WqueenS_fromStata15) ivarlag(WqueenS_fromStata15: INC HOVAL)

Spatial Durbin model                              Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(4)    =      55.48
                                                  Prob > chi2     =     0.0000
Log-likelihood = -183.1451                        Pseudo R2       =     0.5983

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -1.012437   .3620147    -2.80   0.005    -1.721972   -.3029020
       HOVAL |  -.3005824   .0887134    -3.39   0.001    -.4744575   -.1267072
       _cons |   50.87235   9.843765     5.17   0.000     31.57882    70.16589
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
       CRIME |   .4362571   .1398223     3.12   0.002     .1622104    .7103038
         INC |   .5344928   .6075781     0.88   0.379    -.6563393    1.725325
       HOVAL |  -.1756174   .3017351    -0.58   0.561    -.7670074    .4157726
-------------+----------------------------------------------------------------
   /sigma2_e |   72.93415   14.75478                      49.53071   107.38752
------------------------------------------------------------------------------

. eststo SDM

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -183.1451       7   380.2902   393.4590
             |                                        7   374.2902*  387.4590
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC | -1.0793     .3757     -2.87   0.004    -1.8157    -.3429
                HOVAL |  -.3208     .0922     -3.48   0.001    -.5015    -.1401
----------------------------------------------------------------------------------
Indirect              |
                  INC |  -.2954     .8203     -0.36   0.719    -1.9031    1.3123
                HOVAL |  -.4531     .4816     -0.94   0.347    -1.3971     .4909
----------------------------------------------------------------------------------
Total                 |
                  INC | -1.3747     .8952     -1.54   0.125    -3.1293     .3799
                HOVAL |  -.7740     .5102     -1.52   0.129    -1.7740     .2260
----------------------------------------------------------------------------------

.
. *---------------------------------------------------
. * Section 7: Wald specification tests from SDM
. *---------------------------------------------------

. quietly spregress CRIME INC HOVAL, ml dvarlag(WqueenS_fromStata15) ivarlag(WqueenS_fromStata15: INC HOVAL)

.
. * Wald test: Reduce to SLX? (rho = 0; NO if p < 0.05)
. test ([WqueenS_fromStata15]CRIME = 0)

 ( 1)  [WqueenS_fromStata15]CRIME = 0

           chi2(  1) =    7.76
         Prob > chi2 =    0.0053

.
. * Wald test: Reduce to SAR? (theta = 0; NO if p < 0.05)
. test ([WqueenS_fromStata15]INC = 0) ([WqueenS_fromStata15]HOVAL = 0)

 ( 1)  [WqueenS_fromStata15]INC = 0
 ( 2)  [WqueenS_fromStata15]HOVAL = 0

           chi2(  2) =    3.51
         Prob > chi2 =    0.1726

.
. * Wald test: Reduce to SEM? (common factor; NO if p < 0.05)
. testnl ([WqueenS_fromStata15]INC = -[WqueenS_fromStata15]CRIME*[CRIME]INC) ([WqueenS_fromStata15]HOVAL = -[WqueenS_fromStata15]CRIME*[CRIME]HOVAL)

  (1)  [WqueenS_fromStata15]INC = -[WqueenS_fromStata15]CRIME*[CRIME]INC
  (2)  [WqueenS_fromStata15]HOVAL = -[WqueenS_fromStata15]CRIME*[CRIME]HOVAL

           chi2(  2) =    2.08
         Prob > chi2 =    0.3535

.
. *---------------------------------------------------
. * Section 8: Extended spatial models
. *---------------------------------------------------

. * 8.1 SDEM (Spatial Durbin Error Model)
. spregress CRIME INC HOVAL, ml ivarlag(WqueenS_fromStata15: INC HOVAL) errorlag(WqueenS_fromStata15)

Spatial Durbin error model                        Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(4)    =      49.60
                                                  Prob > chi2     =     0.0000
Log-likelihood = -183.3561                        Pseudo R2       =     0.5965

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -.8725810   .3634289    -2.40   0.016    -1.5848886   -.1602734
       HOVAL |  -.3287133   .0895607    -3.67   0.000    -.5042491   -.1531775
       _cons |   62.40312   6.296218     9.91   0.000     50.06277    74.74347
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
         INC |   .4575841   .5463231     0.84   0.402    -.6131896    1.528358
       HOVAL |  -.1082341   .2814122    -0.38   0.700    -.6597918    .4433236
     lambda  |   .5424611   .1504228     3.61   0.000     .2476378    .8372843
-------------+----------------------------------------------------------------
   /sigma2_e |   72.32144   14.62892                      49.11537   106.52419
------------------------------------------------------------------------------

. eststo SDEM

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -183.3561       7   380.7122   393.8810
             |                                        7   374.7122*  387.8810
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC |  -.8726     .3634     -2.40   0.016    -1.5849    -.1603
                HOVAL |  -.3287     .0896     -3.67   0.000    -.5042    -.1532
----------------------------------------------------------------------------------
Indirect              |
                  INC |   .4576     .5463      0.84   0.402    -.6132    1.5284
                HOVAL |  -.1082     .2814     -0.38   0.700    -.6598     .4433
----------------------------------------------------------------------------------
Total                 |
                  INC |  -.4150     .6178     -0.67   0.502    -1.6259     .7960
                HOVAL |  -.4369     .2882     -1.52   0.130    -1.0018     .1279
----------------------------------------------------------------------------------

.
. * 8.2 SAC (Spatial Autoregressive Combined)
. spregress CRIME INC HOVAL, ml dvarlag(WqueenS_fromStata15) errorlag(WqueenS_fromStata15)

Spatial autoregressive combined model             Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(2)    =      51.17
                                                  Prob > chi2     =     0.0000
Log-likelihood = -184.0543                        Pseudo R2       =     0.5905

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -1.037145   .3295422    -3.15   0.002    -1.683036   -.3912536
       HOVAL |  -.2819738   .0937163    -3.01   0.003    -.4656545   -.0982931
       _cons |   50.36122   9.268145     5.43   0.000     32.19601    68.52644
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
       CRIME |   .3172541   .1870263     1.70   0.090    -.0493107    .6838189
     lambda  |   .3818241   .2414286     1.58   0.114    -.0913672    .8550154
-------------+----------------------------------------------------------------
   /sigma2_e |   74.28175   15.02908                      50.44438   109.37122
------------------------------------------------------------------------------

. eststo SAC

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -184.0543       6   380.1086   391.3975
             |                                        6   374.1086*  385.3975
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC | -1.0806     .3444     -3.14   0.002    -1.7557    -.4056
                HOVAL |  -.2937     .0976     -3.01   0.003    -.4850    -.1024
----------------------------------------------------------------------------------
Indirect              |
                  INC |  -.4829     .3481     -1.39   0.165    -1.1651     .1994
                HOVAL |  -.1311     .0890     -1.47   0.141    -.3056     .0434
----------------------------------------------------------------------------------
Total                 |
                  INC | -1.5635     .5267     -2.97   0.003    -2.5957    -.5312
                HOVAL |  -.4248     .1505     -2.82   0.005    -.7197    -.1299
----------------------------------------------------------------------------------

.
. * 8.3 GNS (General Nesting Spatial)
. spregress CRIME INC HOVAL, ml dvarlag(WqueenS_fromStata15) ivarlag(WqueenS_fromStata15: INC HOVAL) errorlag(WqueenS_fromStata15)

General nesting spatial model                     Number of obs   =         49
Maximum likelihood estimates                      Wald chi2(4)    =      50.24
                                                  Prob > chi2     =     0.0000
Log-likelihood = -182.8123                        Pseudo R2       =     0.6012

------------------------------------------------------------------------------
       CRIME | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       CRIME |
         INC |  -.9525834   .3712653    -2.57   0.010    -1.6802509   -.2249160
       HOVAL |  -.3061482   .0908217    -3.37   0.001    -.4841555   -.1281409
       _cons |   52.46351   10.46128     5.02   0.000     31.95977    72.96724
-------------+----------------------------------------------------------------
WqueenS_fr~5 |
       CRIME |   .3497814   .1812371     1.93   0.054    -.0054368    .7049996
         INC |   .4021345   .6234862     0.64   0.519    -.8198751    1.624144
       HOVAL |  -.1178234   .3092185    -0.38   0.703    -.7238805    .4882338
     lambda  |   .2487314   .2812653     0.88   0.377    -.3025383    .8000012
-------------+----------------------------------------------------------------
   /sigma2_e |   70.81472   14.33318                      48.09246   104.27931
------------------------------------------------------------------------------

. eststo GNS

.
. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+----------------------------------------------------------------
       Model |          N   ll(null)  ll(model)      df        AIC        BIC
-------------+----------------------------------------------------------------
           . |         49            -182.8123       8   381.6246   396.6733
             |                                        8   375.6246*  390.6733
-------------+----------------------------------------------------------------

. mat s = r(S)

. quietly estadd scalar AIC = s[1,5]

.
. estat impact

Average impacts

                                    Delta-method
                          dy/dx   std. err.      z    P>|z|   [95% conf. interval]
----------------------------------------------------------------------------------
Direct                |
                  INC | -1.0104     .3883     -2.60   0.009    -1.7715    -.2494
                HOVAL |  -.3264     .0950     -3.44   0.001    -.5126    -.1403
----------------------------------------------------------------------------------
Indirect              |
                  INC |  -.1344     .8564     -0.16   0.875    -1.8130    1.5441
                HOVAL |  -.3897     .5012     -0.78   0.437    -1.3721     .5927
----------------------------------------------------------------------------------
Total                 |
                  INC | -1.1449     .9527     -1.20   0.229    -3.0122     .7224
                HOVAL |  -.7161     .5284     -1.35   0.176    -1.7517     .3195
----------------------------------------------------------------------------------

.
. *---------------------------------------------------
. * Section 9: Model comparison
. *---------------------------------------------------

. esttab OLS SAR SEM SLX SDM SDEM SAC GNS, label stats(AIC) mtitle("OLS" "SAR" "SEM" "SLX" "SDM" "SDEM" "SAC" "GNS")

------------------------------------------------------------------------------------------------------------
                      (1)          (2)          (3)          (4)          (5)          (6)          (7)          (8)
                      OLS          SAR          SEM          SLX          SDM         SDEM          SAC          GNS
------------------------------------------------------------------------------------------------------------
Crime
Income            -1.597***    -1.031***    -0.938***    -1.473***    -1.012***    -0.873**     -1.037***    -0.953**
                 (-4.78)      (-3.07)      (-2.76)      (-4.13)      (-2.80)      (-2.40)      (-3.15)      (-2.57)

House value       -0.274***    -0.265***    -0.302***    -0.309***    -0.301***    -0.329***    -0.282***    -0.306***
                 (-2.65)      (-2.88)      (-3.32)      (-3.27)      (-3.39)      (-3.67)      (-3.01)      (-3.37)

Constant          68.619***    45.072***    59.623***    74.276***    50.872***    62.403***    50.361***    52.464***
                 (14.49)       (5.75)      (10.90)       (9.82)       (5.17)       (9.91)       (5.43)       (5.02)
------------------------------------------------------------------------------------------------------------
AIC              378.159      373.852      372.758      379.044      374.290      374.712      374.109      375.625
------------------------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.1, ** p<0.05, *** p<0.01

.
. log close
      name:  <unnamed>
       log:  analysis.log
  log type:  text
 closed on:  01 Dec 2023, 10:15:00
----------------------------------------------------------------------
