Suggested citation: >Belotti, Federico and Hughes, Gordon and Piano Mortari, Andrea, Spatial Panel Data Models Using Stata (March 25, 2016). CEIS Working Paper No. 373, Available at <https://ssrn.com/abstract=2754703 or http://dx.doi.org/10.2139/ssrn.2754703>

This work is licensed under the Creative Commons Attribution-Share Alike 4.0 International License.

1 Original data source

All data are derived from the Indonesia Central Bureau of Statistics (Badan Pusat Statistik Republik of Indonesia). https://www.bps.go.id/

2 Explore my non-spatial data: datapanel

In this case, data3.dta is the panel ( long data) form

sysuse data3
end of do-file

2.1 Label the variables

sysuse data3

label variable fips "District ID"
label variable district "District name"
label variable pov " Poverty Rate"
label variable gap " Poverty Gap Index"
label variable sev " Poverty Severity Index"
label variable agr " Total GRDP of Agriculture sector at district-i"
label variable ind "Total GRDP of Industry sector at district-i"
label variable gpov "Growth of Poverty Rate"
label variable gsev "Growth of Poverty Severity Index"
label variable ggap "Growth of Poverty Gap Index"
label variable mys "Mean Year School"
label variable shr_agr "Share of Agricultural sector to total GRDP"
label variable unemp "Unemployment Rate"
label variable gdpgr "Economic growth"
label variable shr_ind "Share of industry sector to total GRDP"
label variable subs_rice "Percentage of poor purchase subsidized rice"
label variable inv_shr "Share of Public investment to GDP"
label variable gdi "Gender Development Index"
describe
summarize
Contains data from ./data3.dta
  obs:         4,626                          
 vars:            27                          30 Dec 2020 23:29
 size:       670,770                          
-------------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------------------------------------------------------------
fips            int     %8.0g                 District ID
year            int     %8.0g                 
district        str26   %26s                  District name
service         float   %9.0g                 
pov             float   %9.0g                  Poverty Rate
gap             float   %9.0g                  Poverty Gap Index
sev             float   %9.0g                  Poverty Severity Index
mys             float   %9.0g                 Mean Year School
agr             float   %9.0g                  Total GRDP of Agriculture sector at district-i
unemp           float   %9.0g                 Unemployment Rate
gdpgr           float   %9.0g                 Economic growth
inv             double  %10.0g                
ind             float   %9.0g                 Total GRDP of Industry sector at district-i
subs_rice       float   %9.0g                 Percentage of poor purchase subsidized rice
gdi             float   %9.0g                 Gender Development Index
gdp             long    %12.0g                
island          str19   %19s                  
gpov            float   %9.0g                 Growth of Poverty Rate
ggap            float   %9.0g                 Growth of Poverty Gap Index
gsev            float   %9.0g                 Growth of Poverty Severity Index
shr_ind         float   %9.0g                 Share of industry sector to total GRDP
shr_agr         float   %9.0g                 Share of Agricultural sector to total GRDP
ln_pov          float   %9.0g                 
ln_gap          float   %9.0g                 
ln_sev          float   %9.0g                 
inv_shr         float   %9.0g                 Share of Public investment to GDP
ln_inv          float   %9.0g                 
-------------------------------------------------------------------------------------------------------------------------------------
Sorted by: 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        fips |      4,626    4574.257    2678.595       1101       9471
        year |      4,626        2014    2.582268       2010       2018
    district |          0
     service |      4,626    6.614797    9.538464          0      64.74
         pov |      4,626    14.22667    8.705273       1.67      49.58
-------------+---------------------------------------------------------
         gap |      4,626    2.374658    2.300813        .05      19.16
         sev |      4,626    .7474189      .97928        .01      10.15
         mys |      4,626    7.645441    1.717653        .25       12.6
         agr |      4,626     2863.28    3989.058      23.53      62445
       unemp |      4,626    5.343531    3.081055          0      19.84
-------------+---------------------------------------------------------
       gdpgr |      4,626    5.997218    2.943957     -14.49     107.07
         inv |      4,626    1.59e+09    1.37e+10     407000   2.22e+11
         ind |      4,626    4914.623    15559.28          0   238957.1
   subs_rice |      4,626    57.89956    25.12048          0   116.5955
         gdi |      4,626    88.12807    7.235699       24.1      99.75
-------------+---------------------------------------------------------
         gdp |      4,626    2.09e+07    3.64e+07     174740   3.65e+08
      island |          0
        gpov |      4,626   -.0517686    .0535961  -.3567133   .1496517
        ggap |      4,626   -.0500954    .2633248  -1.241657   1.161183
        gsev |      4,626   -.0745803    .3329664  -1.778151   1.342423
-------------+---------------------------------------------------------
     shr_ind |      4,626    6.462646    10.54983          0      88.27
     shr_agr |      4,626    6.618044    6.446088        .01      51.65
      ln_pov |      4,626    2.483652    .5925594   .5128236   3.903588
      ln_gap |      4,626    .5225219    .8400528  -2.995732   2.952825
      ln_sev |      4,626   -.7647654    .9530818   -4.60517   2.317474
-------------+---------------------------------------------------------
     inv_shr |      4,626    .3126588    4.260859   .0000299   149.0742
      ln_inv |      4,626    19.24801    .9199063   12.91657   26.12594

##save myPANEL data


sysuse data3
save, replace
file ./data3.dta saved

3 Explore my Map

3.1 Import and translate to stata shapa file

spshape2dta INDO_KAB_2016, replace

* NOTE:  Two stata files will be created
* INDO_KAB_2016_shp.dta
* INDO_KAB_2016.dta

*Explore my spatial data: myMAP
use INDO_KAB_2016

*Describe and summarize myMAP.dta
describe
summarize


*Generate new spatial-unit id: fips
destring IDKAB, generate(fips)

save, replace

*Change the spatial-unit id from _ID to fips
spset fips, modify replace

*Modify the coordinate system from planar to latlong
spset, modify coordsys(latlong, miles)

*Check spatial ID and coordinate system
spset
  (importing .dbf file)
  (creating _ID spatial-unit id)
  (creating _CX coordinate)
  (creating _CY coordinate)

  file INDO_KAB_2016_shp.dta created
  file INDO_KAB_2016.dta     created



Contains data from INDO_KAB_2016.dta
  obs:           522                          
 vars:            12                          30 Dec 2020 23:31
 size:        52,722                          
-------------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------------------------------------------------------------
_ID             int     %12.0g                Spatial-unit ID
_CX             double  %10.0g                x-coordinate of area centroid
_CY             double  %10.0g                y-coordinate of area centroid
PROVNO          str2    %9s                   PROVNO
KABKOTNO        str2    %9s                   KABKOTNO
PROVINSI        str26   %26s                  PROVINSI
KABKOT          str26   %26s                  KABKOT
IDKAB           str4    %9s                   IDKAB
TAHUN           str4    %9s                   TAHUN
SUMBER          str3    %9s                   SUMBER
COORD_X         double  %18.7f                COORD_X
COORD_Y         double  %18.7f                COORD_Y
-------------------------------------------------------------------------------------------------------------------------------------
Sorted by: _ID

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         _ID |        522       261.5    150.8327          1        522
         _CX |        522    113.2422    10.98185    95.3056   140.8089
         _CY |        522   -3.223506    3.866893  -10.72604   5.837818
      PROVNO |          0
    KABKOTNO |          0
-------------+---------------------------------------------------------
    PROVINSI |          0
      KABKOT |          0
       IDKAB |          0
       TAHUN |          0
      SUMBER |          0
-------------+---------------------------------------------------------
     COORD_X |        522    113.2427    10.97469   95.27568   140.7202
     COORD_Y |        522   -3.238102    3.875886  -10.69717    5.85758

IDKAB: all characters numeric; fips generated as int

file INDO_KAB_2016.dta saved

  (_shp.dta file saved)
  (data in memory saved)
  Sp dataset INDO_KAB_2016.dta
                data:  cross sectional
     spatial-unit id:  _ID (equal to fips)
         coordinates:  _CX, _CY (planar)
    linked shapefile:  INDO_KAB_2016_shp.dta

  Sp dataset INDO_KAB_2016.dta
                data:  cross sectional
     spatial-unit id:  _ID (equal to fips)
         coordinates:  _CY, _CX (latitude-and-longitude, miles)
    linked shapefile:  INDO_KAB_2016_shp.dta


  Sp dataset INDO_KAB_2016.dta
                data:  cross sectional
     spatial-unit id:  _ID (equal to fips)
         coordinates:  _CY, _CX (latitude-and-longitude, miles)
    linked shapefile:  INDO_KAB_2016_shp.dta

3.2 Merge with myPANEL data : data3.dta

sysuse data3
xtset fips year 
spbalance 
merge m:1 fips using INDO_KAB_2016
keep if _merge==3 
drop _merge
tset

**Save the merge of my map and panel data
save mymap_and_panel,replace 
       panel variable:  fips (strongly balanced)
        time variable:  year, 2010 to 2018
                delta:  1 unit

  (data strongly balanced)

    Result                           # of obs.
    -----------------------------------------
    not matched                             8
        from master                         0  (_merge==1)
        from using                          8  (_merge==2)

    matched                             4,626  (_merge==3)
    -----------------------------------------

(8 observations deleted)

       panel variable:  fips (strongly balanced)
        time variable:  year, 2010 to 2018
                delta:  1 unit

file mymap_and_panel.dta saved

4 Describe the new dataset

This is my mymap_and_panel.dta ( the merge between MAP and panel data)


sysuse mymap_and_panel
describe
Contains data from ./mymap_and_panel.dta
  obs:         4,626                          
 vars:            39                          30 Dec 2020 23:31
 size:     1,137,996                          
-------------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------------------------------------------------------------
fips            int     %8.0g                 Spatial-unit ID
year            int     %8.0g                 
district        str26   %26s                  District name
service         float   %9.0g                 
pov             float   %9.0g                 
gap             float   %9.0g                 
sev             float   %9.0g                 
mys             float   %9.0g                 Mean Year School
agr             float   %9.0g                 
unemp           float   %9.0g                 Unemployment Rate
gdpgr           float   %9.0g                 Economic growth
inv             double  %10.0g                
ind             float   %9.0g                 
subs_rice       float   %9.0g                 Percentage of poor receiving subsidized rice
gdi             float   %9.0g                 Gender Development Index
gdp             long    %12.0g                
island          str19   %19s                  
gpov            float   %9.0g                 Growth of Poverty Rate
ggap            float   %9.0g                 Growth of Poverty Gap Index
gsev            float   %9.0g                 Growth of Poverty Severity Index
shr_ind         float   %9.0g                 Share of Manufacturing sector GRDP
shr_agr         float   %9.0g                 Share of Agricultural sector GRDP
ln_pov          float   %9.0g                 
ln_gap          float   %9.0g                 
ln_sev          float   %9.0g                 
inv_shr         float   %9.0g                 Public investment to GDP
ln_inv          float   %9.0g                 
_ID             int     %10.0g                Spatial-unit ID
_CX             double  %10.0g                x-coordinate of area centroid
_CY             double  %10.0g                y-coordinate of area centroid
PROVNO          str2    %9s                   PROVNO
KABKOTNO        str2    %9s                   KABKOTNO
PROVINSI        str26   %26s                  PROVINSI
KABKOT          str26   %26s                  KABKOT
IDKAB           str4    %9s                   IDKAB
TAHUN           str4    %9s                   TAHUN
SUMBER          str3    %9s                   SUMBER
COORD_X         double  %18.7f                COORD_X
COORD_Y         double  %18.7f                COORD_Y
-------------------------------------------------------------------------------------------------------------------------------------
Sorted by: fips  year

5 Create our spatial weights matrix Wa generated from STATA (for cross-sectional dataset)

To create weight matrix in panel model, firstly we must create weight matrix in the cross-sectional (wide) data containing COORD (X) and COORD (Y) and spatial-ID. In this case, I rename my cross-sectional data with datacross.dta. I use inverse distance matrix as an example.

sysuse datacross.dta
spmat idistance datacross coord_x coord_y, id(fips) normalize (row)
spmat export datacross using Wa
Wa already exists
r(498);

end of do-file
r(498);

6 Run the OLS: Non spatial model

The similar syntax for poverty rate, poverty gap, and poverty severity index

**OLS Fixed Effect
sysuse mymap_and_panel

*Poverty rate
xtreg gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, fe
gen speed1 = - (log(1+_b[ln_pov])/8)
gen halfLife1 = log(2)/speed1
estat ic

*The same for poverty gap
xtreg ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, fe 
gen speed2 = - (log(1+_b[ln_gap])/8)
gen halfLife2  = log(2)/speed2
estat ic


*The same for poverty severity
xtreg gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, fe
gen speed3 = - (log(1+_b[ln_sev])/8)
gen halfLife3 = log(2)/speed3
estat ic

estimates store ols_fe
Fixed-effects (within) regression               Number of obs     =      4,626
Group variable: fips                            Number of groups  =        514

R-sq:                                           Obs per group:
     within  = 0.0602                                         min =          9
     between = 0.0045                                         avg =        9.0
     overall = 0.0071                                         max =          9

                                                F(9,4103)         =      29.23
corr(u_i, Xb)  = -0.2102                        Prob > F          =     0.0000

------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ln_pov |  -.0248764   .0017738   -14.02   0.000     -.028354   -.0213988
         mys |  -.0037537   .0006006    -6.25   0.000    -.0049312   -.0025763
       gdpgr |  -.0008429    .000226    -3.73   0.000     -.001286   -.0003997
       unemp |    .000074   .0002596     0.28   0.776     -.000435     .000583
   subs_rice |   .0001402   .0000331     4.23   0.000     .0000752    .0002051
         gdi |  -.0000637   .0001201    -0.53   0.596    -.0002992    .0001719
     inv_shr |   .0000279   .0001806     0.15   0.877    -.0003262     .000382
     shr_agr |   .0003998   .0001141     3.50   0.000     .0001761    .0006235
     shr_ind |  -.0003887   .0000643    -6.04   0.000    -.0005148   -.0002625
       _cons |    .040727   .0116697     3.49   0.000     .0178481     .063606
-------------+----------------------------------------------------------------
     sigma_u |  .04045799
     sigma_e |  .03813812
         rho |  .52949061   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(513, 4103) = 8.92                   Prob > F = 0.0000




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626  8680.788   8824.509      10   -17629.02  -17564.62
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.


Fixed-effects (within) regression               Number of obs     =      4,626
Group variable: fips                            Number of groups  =        514

R-sq:                                           Obs per group:
     within  = 0.1750                                         min =          9
     between = 0.1622                                         avg =        9.0
     overall = 0.1671                                         max =          9

                                                F(9,4103)         =      96.71
corr(u_i, Xb)  = -0.0112                        Prob > F          =     0.0000

------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ln_gap |  -.1451411   .0050111   -28.96   0.000    -.1549656   -.1353166
         mys |   -.025839   .0023898   -10.81   0.000    -.0305242   -.0211537
       gdpgr |   .0000283   .0009331     0.03   0.976    -.0018011    .0018578
       unemp |   .0004958   .0010725     0.46   0.644    -.0016069    .0025984
   subs_rice |   .0005541   .0001361     4.07   0.000     .0002873    .0008208
         gdi |   .0004766   .0004963     0.96   0.337    -.0004964    .0014497
     inv_shr |   .0004305   .0007455     0.58   0.564    -.0010311    .0018921
     shr_agr |   .0008507   .0004713     1.80   0.071    -.0000734    .0017748
     shr_ind |    .000435   .0002651     1.64   0.101    -.0000847    .0009547
       _cons |   .1378133   .0412592     3.34   0.001      .056923    .2187036
-------------+----------------------------------------------------------------
     sigma_u |   .1892742
     sigma_e |  .15745587
         rho |  .59100053   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(513, 4103) = 12.56                  Prob > F = 0.0000




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626  1820.185   2265.161      10   -4510.321  -4445.927
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.


Fixed-effects (within) regression               Number of obs     =      4,626
Group variable: fips                            Number of groups  =        514

R-sq:                                           Obs per group:
     within  = 0.2466                                         min =          9
     between = 0.1735                                         avg =        9.0
     overall = 0.2091                                         max =          9

                                                F(9,4103)         =     149.21
corr(u_i, Xb)  = -0.1243                        Prob > F          =     0.0000

------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ln_sev |  -.2054647   .0057387   -35.80   0.000    -.2167156   -.1942138
         mys |  -.0380807   .0034354   -11.08   0.000    -.0448159   -.0313455
       gdpgr |   .0001107   .0013638     0.08   0.935     -.002563    .0027844
       unemp |   -.001831   .0015667    -1.17   0.243    -.0049026    .0012407
   subs_rice |   .0010426    .000197     5.29   0.000     .0006565    .0014287
         gdi |   .0011136   .0007254     1.54   0.125    -.0003085    .0025357
     inv_shr |   .0011671   .0010894     1.07   0.284    -.0009687    .0033029
     shr_agr |  -.0021391   .0006884    -3.11   0.002    -.0034888   -.0007894
     shr_ind |   .0011273   .0003873     2.91   0.004      .000368    .0018866
       _cons |  -.0834493   .0590254    -1.41   0.158    -.1991711    .0322726
-------------+----------------------------------------------------------------
     sigma_u |  .20349282
     sigma_e |  .23013405
         rho |  .43879288   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(513, 4103) = 6.76                   Prob > F = 0.0000




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626 -145.3874   509.5162      10   -999.0324   -934.638
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

7 Run the spatial model: SAR Fixed Effect with Region (District) Fixed Effect and SAR Random Effect Model

7.1 Import our weight matrix Wa into our panel dataset

This syntax generates direct and indirect effects as well by adding code ‘effects’ into model.

**SAR Fixed Effect Model 
sysuse mymap_and_panel

**Import Wa ( our weight matrix) into our panel model. I rename with Wi

spmat import Wi using Wa

**Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sar) fe type (ind) effects
gen speed4 = - (log(1+_b[ln_pov])/8)
gen halfLife4 = log(2)/speed4
estat ic

** The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sar) fe type (ind) effects
gen speed5 = - (log(1+_b[ln_gap])/8)
gen halfLife5 = log(2)/speed5
estat ic

** The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, wmat (Wi) model (sar) fe type (ind) effects
gen speed6 = - (log(1+_b[ln_sev])/8)
gen halfLife6 = log(2)/speed6
estat ic

estimates store sar_fe


** SAR Random Effect


*Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, wmat (Wi) model (sar) re 
gen speed7 = - (log(1+_b[ln_pov])/8)
gen halfLife7 = log(2)/speed7
estat ic

*The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, wmat (Wi) model (sar) re  
gen speed8 = - (log(1+_b[ln_gap])/8)
gen halfLife8  = log(2)/speed8
estat ic


*The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr  shr_agr shr_ind, wmat (Wi) model (sar) re 
gen speed9 = - (log(1+_b[ln_sev])/8)
gen halfLife9 = log(2)/speed9
estat ic

estimates store sar_re

** Conducting Hausman Test

hausman sar_fe sar_re
Iteration 0:   Log-likelihood =  8809.3045  
Iteration 1:   Log-likelihood =  8832.5646  
Iteration 2:   Log-likelihood =  8832.6339  
Iteration 3:   Log-likelihood =  8832.6339  
Computing marginal effects standard errors using MC simulation...

SAR with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0605
         between = 0.0046
         overall = 0.0071

Mean of fixed-effects =  0.0162

Log-likelihood =  8832.6339
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |  -.0248986    .001666   -14.94   0.000    -.0281639   -.0216332
         mys |  -.0037459   .0005641    -6.64   0.000    -.0048515   -.0026403
       gdpgr |  -.0008415   .0002123    -3.96   0.000    -.0012576   -.0004254
       unemp |   .0000732   .0002439     0.30   0.764    -.0004048    .0005511
   subs_rice |   .0001414   .0000311     4.54   0.000     .0000804    .0002023
         gdi |  -.0000579   .0001128    -0.51   0.608    -.0002791    .0001632
     inv_shr |   .0000106   .0001697     0.06   0.950     -.000322    .0003431
     shr_agr |   .0003938   .0001072     3.67   0.000     .0001837    .0006038
     shr_ind |  -.0003803   .0000605    -6.29   0.000    -.0004988   -.0002618
-------------+----------------------------------------------------------------
Spatial      |
         rho |   -.449106   .1130602    -3.97   0.000    -.6706999   -.2275122
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0012831   .0000267    48.05   0.000     .0012308    .0013354
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_pov |  -.0248851    .001712   -14.54   0.000    -.0282406   -.0215296
         mys |  -.0037675   .0005449    -6.91   0.000    -.0048355   -.0026995
       gdpgr |  -.0008207   .0002033    -4.04   0.000    -.0012193   -.0004221
       unemp |   .0000754   .0002388     0.32   0.752    -.0003926    .0005435
   subs_rice |   .0001414   .0000302     4.68   0.000     .0000821    .0002006
         gdi |  -.0000504   .0001132    -0.44   0.656    -.0002722    .0001715
     inv_shr |   .0000103   .0001761     0.06   0.953    -.0003348    .0003554
     shr_agr |   .0003917   .0001025     3.82   0.000     .0001908    .0005926
     shr_ind |  -.0003757   .0000593    -6.34   0.000    -.0004919   -.0002596
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_pov |   .0075849    .001472     5.15   0.000     .0046997    .0104701
         mys |   .0011489   .0002734     4.20   0.000     .0006131    .0016847
       gdpgr |   .0002497   .0000754     3.31   0.001     .0001019    .0003974
       unemp |  -.0000236   .0000751    -0.31   0.754    -.0001707    .0001236
   subs_rice |  -.0000432   .0000124    -3.48   0.001    -.0000675   -.0000188
         gdi |   .0000155   .0000348     0.44   0.657    -.0000528    .0000837
     inv_shr |  -2.94e-06   .0000554    -0.05   0.958    -.0001115    .0001056
     shr_agr |  -.0001191   .0000376    -3.17   0.002    -.0001929   -.0000454
     shr_ind |   .0001144   .0000271     4.22   0.000     .0000612    .0001675
-------------+----------------------------------------------------------------
LR_Total     |
      ln_pov |  -.0173002    .001906    -9.08   0.000    -.0210358   -.0135645
         mys |  -.0026186   .0004352    -6.02   0.000    -.0034716   -.0017656
       gdpgr |   -.000571   .0001521    -3.76   0.000    -.0008691    -.000273
       unemp |   .0000518   .0001659     0.31   0.755    -.0002733     .000377
   subs_rice |   .0000982   .0000222     4.41   0.000     .0000546    .0001418
         gdi |  -.0000349   .0000793    -0.44   0.660    -.0001903    .0001205
     inv_shr |   7.36e-06    .000122     0.06   0.952    -.0002318    .0002465
     shr_agr |   .0002725   .0000767     3.55   0.000     .0001222    .0004228
     shr_ind |  -.0002614   .0000478    -5.46   0.000    -.0003551   -.0001676
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   8832.634      11   -17643.27  -17572.43
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  2261.7899  
Iteration 1:   Log-likelihood =  2265.2939  
Iteration 2:   Log-likelihood =  2265.3048  
Iteration 3:   Log-likelihood =  2265.3048  
Computing marginal effects standard errors using MC simulation...

SAR with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1750
         between = 0.1640
         overall = 0.1682

Mean of fixed-effects =  0.1409

Log-likelihood =  2265.3048
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1451404   .0047192   -30.76   0.000    -.1543898   -.1358911
         mys |  -.0258585   .0022508   -11.49   0.000      -.03027    -.021447
       gdpgr |   .0000338   .0008788     0.04   0.969    -.0016887    .0017563
       unemp |   .0005002     .00101     0.50   0.620    -.0014795    .0024798
   subs_rice |   .0005527   .0001282     4.31   0.000     .0003016    .0008039
         gdi |   .0004772   .0004674     1.02   0.307    -.0004389    .0013934
     inv_shr |   .0004283   .0007021     0.61   0.542    -.0009478    .0018044
     shr_agr |   .0008521   .0004439     1.92   0.055    -.0000179    .0017221
     shr_ind |   .0004351   .0002496     1.74   0.081    -.0000542    .0009244
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .0513628   .0953995     0.54   0.590    -.1356167    .2383423
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0219874   .0004572    48.09   0.000     .0210914    .0228835
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_gap |  -.1449875   .0048472   -29.91   0.000    -.1544878   -.1354872
         mys |  -.0259323   .0021664   -11.97   0.000    -.0301783   -.0216863
       gdpgr |   .0001263   .0008406     0.15   0.881    -.0015213    .0017738
       unemp |   .0005078   .0009886     0.51   0.607    -.0014298    .0024454
   subs_rice |    .000552   .0001244     4.44   0.000     .0003081    .0007958
         gdi |   .0005092   .0004684     1.09   0.277    -.0004089    .0014272
     inv_shr |   .0004273   .0007274     0.59   0.557    -.0009984    .0018529
     shr_agr |     .00084   .0004244     1.98   0.048     8.28e-06    .0016717
     shr_ind |   .0004566   .0002439     1.87   0.061    -.0000215    .0009347
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_gap |  -.0101095   .0163689    -0.62   0.537    -.0421919     .021973
         mys |  -.0018062   .0029437    -0.61   0.539    -.0075757    .0039633
       gdpgr |   3.91e-06   .0001182     0.03   0.974    -.0002277    .0002356
       unemp |   .0000322   .0001455     0.22   0.825    -.0002529    .0003173
   subs_rice |   .0000377   .0000629     0.60   0.549    -.0000856    .0001611
         gdi |   .0000369   .0000852     0.43   0.665      -.00013    .0002038
     inv_shr |   .0000287   .0001056     0.27   0.786    -.0001784    .0002358
     shr_agr |    .000061   .0001177     0.52   0.605    -.0001698    .0002917
     shr_ind |   .0000305    .000059     0.52   0.605    -.0000851    .0001462
-------------+----------------------------------------------------------------
LR_Total     |
      ln_gap |   -.155097   .0175685    -8.83   0.000    -.1895306   -.1206633
         mys |  -.0277385   .0037718    -7.35   0.000    -.0351311   -.0203459
       gdpgr |   .0001302   .0009078     0.14   0.886     -.001649    .0019094
       unemp |     .00054   .0010595     0.51   0.610    -.0015366    .0026166
   subs_rice |   .0005897   .0001447     4.08   0.000     .0003061    .0008733
         gdi |   .0005461   .0005115     1.07   0.286    -.0004566    .0015487
     inv_shr |   .0004559    .000777     0.59   0.557     -.001067    .0019788
     shr_agr |    .000901   .0004764     1.89   0.059    -.0000328    .0018347
     shr_ind |   .0004871    .000265     1.84   0.066    -.0000323    .0010066
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   2265.305      11    -4508.61  -4437.776
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  505.24135  
Iteration 1:   Log-likelihood =  509.52649  
Iteration 2:   Log-likelihood =    509.536  
Iteration 3:   Log-likelihood =    509.536  
Computing marginal effects standard errors using MC simulation...

SAR with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2465
         between = 0.1735
         overall = 0.2091

Mean of fixed-effects = -0.0819

Log-likelihood =   509.5360
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.2054804   .0054051   -38.02   0.000    -.2160742   -.1948867
         mys |  -.0380943   .0032361   -11.77   0.000    -.0444369   -.0317517
       gdpgr |   .0001138   .0012844     0.09   0.929    -.0024037    .0026312
       unemp |  -.0018342   .0014756    -1.24   0.214    -.0047263    .0010579
   subs_rice |    .001043   .0001855     5.62   0.000     .0006794    .0014065
         gdi |   .0011141   .0006831     1.63   0.103    -.0002248     .002453
     inv_shr |   .0011612   .0010264     1.13   0.258    -.0008505    .0031728
     shr_agr |  -.0021405   .0006484    -3.30   0.001    -.0034112   -.0008697
     shr_ind |   .0011279   .0003648     3.09   0.002      .000413    .0018428
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .0194291   .0975725     0.20   0.842    -.1718094    .2106676
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0469734   .0009767    48.09   0.000     .0450591    .0488877
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_sev |  -.2053052   .0055512   -36.98   0.000    -.2161854   -.1944251
         mys |  -.0382116   .0031143   -12.27   0.000    -.0443155   -.0321077
       gdpgr |   .0002487   .0012286     0.20   0.840    -.0021594    .0026567
       unemp |  -.0018214   .0014419    -1.26   0.207    -.0046475    .0010047
   subs_rice |   .0010423   .0001807     5.77   0.000     .0006882    .0013964
         gdi |   .0011607   .0006844     1.70   0.090    -.0001808    .0025022
     inv_shr |   .0011599   .0010638     1.09   0.276    -.0009252     .003245
     shr_agr |  -.0021579    .000619    -3.49   0.000    -.0033711   -.0009447
     shr_ind |   .0011592   .0003561     3.25   0.001     .0004612    .0018572
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_sev |  -.0071022   .0221457    -0.32   0.748    -.0505069    .0363025
         mys |   -.001318   .0041405    -0.32   0.750    -.0094334    .0067973
       gdpgr |   1.75e-06   .0001498     0.01   0.991    -.0002918    .0002953
       unemp |  -.0000696   .0002626    -0.26   0.791    -.0005843    .0004451
   subs_rice |   .0000354   .0001127     0.31   0.754    -.0001856    .0002563
         gdi |    .000042   .0001473     0.28   0.776    -.0002468    .0003308
     inv_shr |   .0000355   .0001715     0.21   0.836    -.0003006    .0003716
     shr_agr |  -.0000717   .0002377    -0.30   0.763    -.0005375    .0003941
     shr_ind |   .0000384   .0001293     0.30   0.766     -.000215    .0002918
-------------+----------------------------------------------------------------
LR_Total     |
      ln_sev |  -.2124074   .0234105    -9.07   0.000    -.2582912   -.1665236
         mys |  -.0395296   .0052745    -7.49   0.000    -.0498674   -.0291919
       gdpgr |   .0002504   .0012829     0.20   0.845     -.002264    .0027648
       unemp |   -.001891   .0015167    -1.25   0.212    -.0048636    .0010817
   subs_rice |   .0010777   .0002162     4.98   0.000     .0006539    .0015014
         gdi |   .0012027   .0007302     1.65   0.100    -.0002285    .0026339
     inv_shr |   .0011955   .0010996     1.09   0.277    -.0009596    .0033506
     shr_agr |  -.0022296    .000681    -3.27   0.001    -.0035644   -.0008948
     shr_ind |   .0011976   .0003864     3.10   0.002     .0004402    .0019551
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .    509.536      11    -997.072  -926.2381
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.


Iteration 0:   Log-likelihood =  7283.2829  (not concave)
Iteration 1:   Log-likelihood =  7822.3184  
Iteration 2:   Log-likelihood =  7945.5979  
Iteration 3:   Log-likelihood =   7973.996  
Iteration 4:   Log-likelihood =  7974.9238  
Iteration 5:   Log-likelihood =   7974.926  
Iteration 6:   Log-likelihood =   7974.926  

SAR with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0576
         between = 0.0000
         overall = 0.0143

Log-likelihood =  7974.9260
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |  -.0201417   .0016821   -11.97   0.000    -.0234387   -.0168448
         mys |  -.0032205    .000586    -5.50   0.000    -.0043691    -.002072
       gdpgr |  -.0009522   .0002219    -4.29   0.000    -.0013872   -.0005172
       unemp |  -.0002552   .0002536    -1.01   0.314    -.0007524    .0002419
   subs_rice |   .0000781   .0000319     2.45   0.014     .0000156    .0001406
         gdi |  -.0000137   .0001163    -0.12   0.906    -.0002417    .0002143
     inv_shr |   -.000059   .0001727    -0.34   0.733    -.0003975    .0002796
     shr_agr |   .0003998   .0001113     3.59   0.000     .0001817    .0006179
     shr_ind |  -.0003812   .0000641    -5.95   0.000    -.0005068   -.0002557
       _cons |   .0499395   .0121872     4.10   0.000      .026053    .0738261
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .4404706   .0820365     5.37   0.000     .2796819    .6012593
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.6363097   .0554577   -11.47   0.000    -.7450047   -.5276147
    sigma2_e |    .001468   .0000326    45.05   0.000     .0014041    .0015319
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   7974.926      13   -15923.85  -15840.14
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  724.02894  (not concave)
Iteration 1:   Log-likelihood =  1163.1261  
Iteration 2:   Log-likelihood =  1324.9129  
Iteration 3:   Log-likelihood =  1360.4176  
Iteration 4:   Log-likelihood =  1361.3834  
Iteration 5:   Log-likelihood =  1361.3859  
Iteration 6:   Log-likelihood =  1361.3859  

SAR with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1738
         between = 0.1964
         overall = 0.1876

Log-likelihood =  1361.3859
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1431656   .0046879   -30.54   0.000    -.1523537   -.1339774
         mys |  -.0259901   .0023389   -11.11   0.000    -.0305743   -.0214059
       gdpgr |  -.0001017   .0009173    -0.11   0.912    -.0018996    .0016962
       unemp |  -.0000866   .0010488    -0.08   0.934    -.0021422    .0019689
   subs_rice |   .0004479   .0001309     3.42   0.001     .0001913    .0007045
         gdi |   .0003153   .0004828     0.65   0.514     -.000631    .0012616
     inv_shr |   .0002694   .0007178     0.38   0.707    -.0011374    .0016762
     shr_agr |   .0005259   .0004613     1.14   0.254    -.0003782      .00143
     shr_ind |   .0004202   .0002635     1.59   0.111    -.0000962    .0009365
       _cons |   .1969698   .0410418     4.80   0.000     .1165294    .2774103
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .5604701   .0696162     8.05   0.000     .4240247    .6969154
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.8362968   .0492492   -16.98   0.000    -.9328234   -.7397702
    sigma2_e |   .0248169    .000548    45.29   0.000     .0237429    .0258909
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   1361.386      13   -2696.772  -2613.059
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  -504.7949  
Iteration 1:   Log-likelihood =  -348.0637  
Iteration 2:   Log-likelihood = -259.59283  
Iteration 3:   Log-likelihood = -258.05935  
Iteration 4:   Log-likelihood = -258.05275  
Iteration 5:   Log-likelihood = -258.05275  

SAR with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2451
         between = 0.1797
         overall = 0.2123

Log-likelihood =  -258.0528
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.1976194   .0053163   -37.17   0.000    -.2080391   -.1871997
         mys |  -.0386616   .0033222   -11.64   0.000     -.045173   -.0321502
       gdpgr |   .0001607   .0013248     0.12   0.903    -.0024358    .0027573
       unemp |  -.0023628   .0015074    -1.57   0.117    -.0053173    .0005917
   subs_rice |    .001069   .0001853     5.77   0.000     .0007059    .0014321
         gdi |   .0004944   .0006932     0.71   0.476    -.0008642     .001853
     inv_shr |   .0006186   .0010249     0.60   0.546    -.0013901    .0026273
     shr_agr |  -.0027115   .0006647    -4.08   0.000    -.0040144   -.0014086
     shr_ind |   .0011587   .0003832     3.02   0.002     .0004076    .0019097
       _cons |   .0051845   .0573022     0.09   0.928    -.1071258    .1174949
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .2452659   .0892069     2.75   0.006     .0704235    .4201083
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.4650608   .0548417    -8.48   0.000    -.5725485   -.3575731
    sigma2_e |   .0529378    .001169    45.29   0.000     .0506466     .055229
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .  -258.0528      13    542.1055   625.8183
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

                 ---- Coefficients ----
             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
             |     sar_fe       sar_re       Difference          S.E.
-------------+----------------------------------------------------------------
      ln_sev |   -.2054804    -.1976194        -.007861        .0009758
         mys |   -.0380943    -.0386616        .0005673               .
       gdpgr |    .0001138     .0001607       -.0000469               .
       unemp |   -.0018342    -.0023628        .0005286               .
   subs_rice |     .001043      .001069        -.000026        9.42e-06
         gdi |    .0011141     .0004944        .0006197               .
     inv_shr |    .0011612     .0006186        .0005426        .0000556
     shr_agr |   -.0021405    -.0027115         .000571               .
     shr_ind |    .0011279     .0011587       -.0000308               .
------------------------------------------------------------------------------
                           b = consistent under Ho and Ha; obtained from xsmle
            B = inconsistent under Ha, efficient under Ho; obtained from xsmle

    Test:  Ho:  difference in coefficients not systematic

                  chi2(9) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                          =      133.24
                Prob>chi2 =      0.0000
                (V_b-V_B is not positive definite)

8 Run the spatial model; SEM Fixed Effect with Region (District) Fixed Effect

8.1 Import our weight matrix Wa into our panel dataset

*SEM Fixed Effect Model 
sysuse mymap_and_panel

spmat import Wi using Wa

**Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, emat (Wi) model (sem) fe type (ind) effects
gen speed10 = - (log(1+_b[ln_pov])/8)
gen halfLife10 = log(2)/speed10
estat ic


**The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, emat (Wi) model (sem) fe type (ind) effects
gen speed11 = - (log(1+_b[ln_gap])/8)
gen halfLife11 = log(2)/speed11
estat ic

**The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, emat (Wi) model (sem) fe type (ind) effects
gen speed12 = - (log(1+_b[ln_sev])/8)
gen halfLife12 = log(2)/speed12
estat ic

estimates store sem_fe
Warning: Option -effects- is redundant
Iteration 0:   Log-likelihood =  8820.6157  
Iteration 1:   Log-likelihood =  8831.9436  
Iteration 2:   Log-likelihood =  8831.9583  
Iteration 3:   Log-likelihood =  8831.9583  

SEM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0602
         between = 0.0046
         overall = 0.0069

Mean of fixed-effects =  0.0396

Log-likelihood =  8831.9583
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |  -.0249179    .001665   -14.97   0.000    -.0281811   -.0216546
         mys |  -.0037214   .0005638    -6.60   0.000    -.0048265   -.0026163
       gdpgr |   -.000841   .0002122    -3.96   0.000     -.001257   -.0004251
       unemp |   .0000787    .000244     0.32   0.747    -.0003996     .000557
   subs_rice |   .0001434   .0000311     4.62   0.000     .0000825    .0002042
         gdi |   -.000056   .0001128    -0.50   0.619     -.000277     .000165
     inv_shr |   .0000114   .0001598     0.07   0.943    -.0003017    .0003246
     shr_agr |    .000394    .000107     3.68   0.000     .0001842    .0006037
     shr_ind |  -.0003725   .0000606    -6.14   0.000    -.0004913   -.0002537
-------------+----------------------------------------------------------------
Spatial      |
      lambda |  -.4385749   .1154665    -3.80   0.000    -.6648852   -.2122647
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0012836   .0000267    48.05   0.000     .0012312    .0013359
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   8831.958      11   -17641.92  -17571.08
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: Option -effects- is redundant
Iteration 0:   Log-likelihood =  2265.3368  
Iteration 1:   Log-likelihood =  2265.3873  
Iteration 2:   Log-likelihood =  2265.3874  

SEM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1750
         between = 0.1623
         overall = 0.1672

Mean of fixed-effects =  0.1376

Log-likelihood =  2265.3874
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1451348   .0047187   -30.76   0.000    -.1543832   -.1358863
         mys |  -.0259097   .0022527   -11.50   0.000    -.0303249   -.0214945
       gdpgr |   .0000369   .0008788     0.04   0.966    -.0016855    .0017593
       unemp |   .0004986   .0010097     0.49   0.621    -.0014804    .0024777
   subs_rice |   .0005518   .0001282     4.30   0.000     .0003006    .0008031
         gdi |   .0004859   .0004676     1.04   0.299    -.0004306    .0014023
     inv_shr |   .0004092   .0007088     0.58   0.564    -.0009801    .0017985
     shr_agr |   .0008452    .000444     1.90   0.057     -.000025    .0017153
     shr_ind |   .0004355   .0002496     1.74   0.081    -.0000537    .0009247
-------------+----------------------------------------------------------------
Spatial      |
      lambda |   .0680783   .1006588     0.68   0.499    -.1292094     .265366
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0219862   .0004572    48.09   0.000     .0210902    .0228822
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   2265.387      11   -4508.775  -4437.941
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: Option -effects- is redundant
Iteration 0:   Log-likelihood =  509.89632  
Iteration 1:   Log-likelihood =  509.90061  
Iteration 2:   Log-likelihood =  509.90061  

SEM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2466
         between = 0.1736
         overall = 0.2092

Mean of fixed-effects = -0.0844

Log-likelihood =   509.9006
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.2055367   .0054029   -38.04   0.000    -.2161262   -.1949471
         mys |  -.0382404   .0032394   -11.80   0.000    -.0445896   -.0318913
       gdpgr |   .0001235   .0012842     0.10   0.923    -.0023934    .0026404
       unemp |   -.001879   .0014759    -1.27   0.203    -.0047716    .0010137
   subs_rice |    .001047   .0001856     5.64   0.000     .0006833    .0014108
         gdi |   .0011382   .0006836     1.66   0.096    -.0002016     .002478
     inv_shr |   .0011141   .0010394     1.07   0.284    -.0009231    .0031512
     shr_agr |  -.0021597   .0006487    -3.33   0.001    -.0034311   -.0008882
     shr_ind |   .0011334   .0003647     3.11   0.002     .0004186    .0018481
-------------+----------------------------------------------------------------
Spatial      |
      lambda |   .0905081   .1025432     0.88   0.377    -.1104728     .291489
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0469621   .0009765    48.09   0.000     .0450482    .0488761
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   509.9006      11   -997.8012  -926.9673
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

9 Run the spatial model: SAC Fixed Effect with Region (District) Fixed Effect

9.1 Import our weight matrix Wa into our panel dataset

*SAC Fixed Effect Model 
sysuse mymap_and_panel

spmat import Wi using Wa

**Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) emat (Wi) model (sac) fe type (ind) effects
gen speed13 = - (log(1+_b[ln_pov])/8)
gen halfLife13 = log(2)/speed13
estat ic


**The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) emat (Wi) model (sac) fe type (ind) effects
gen speed14 = - (log(1+_b[ln_gap])/8)
gen halfLife14 = log(2)/speed14
estat ic

**The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) emat (Wi) model (sac) fe type (ind) effects
gen speed15 = - (log(1+_b[ln_sev])/8)
gen halfLife15 = log(2)/speed15
estat ic

estimates store sac_fe
Iteration 0:   Log-likelihood =    8815.76  
Iteration 1:   Log-likelihood =  8832.4596  
Iteration 2:   Log-likelihood =  8832.5845  
Iteration 3:   Log-likelihood =  8832.6375  
Iteration 4:   Log-likelihood =  8832.6379  
Computing marginal effects standard errors using MC simulation...

SAC with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0606
         between = 0.0046
         overall = 0.0071

Mean of fixed-effects =  0.0144

Log-likelihood =  8832.6379
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |  -.0248898   .0016688   -14.91   0.000    -.0281606    -.021619
         mys |  -.0037469   .0005641    -6.64   0.000    -.0048526   -.0026413
       gdpgr |  -.0008413   .0002123    -3.96   0.000    -.0012573   -.0004252
       unemp |   .0000728   .0002438     0.30   0.765    -.0004052    .0005507
   subs_rice |   .0001411   .0000312     4.52   0.000     .0000799    .0002023
         gdi |  -.0000581   .0001128    -0.51   0.607    -.0002793    .0001631
     inv_shr |    .000011   .0001704     0.06   0.949     -.000323     .000345
     shr_agr |   .0003938   .0001072     3.68   0.000     .0001838    .0006038
     shr_ind |  -.0003808   .0000607    -6.27   0.000    -.0004999   -.0002618
-------------+----------------------------------------------------------------
Spatial      |
         rho |  -.4826244   .3846835    -1.25   0.210     -1.23659    .2713414
      lambda |    .032039   .3491747     0.09   0.927     -.652331    .7164089
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0014431   .0000271    53.31   0.000       .00139    .0014961
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_pov |  -.0249067   .0017114   -14.55   0.000    -.0282609   -.0215524
         mys |  -.0037733   .0005461    -6.91   0.000    -.0048437   -.0027029
       gdpgr |  -.0008215   .0002034    -4.04   0.000    -.0012202   -.0004227
       unemp |   .0000751   .0002392     0.31   0.754    -.0003937    .0005438
   subs_rice |   .0001413   .0000303     4.66   0.000     .0000818    .0002008
         gdi |  -.0000506   .0001133    -0.45   0.655    -.0002726    .0001714
     inv_shr |   .0000107   .0001771     0.06   0.952    -.0003364    .0003579
     shr_agr |   .0003922   .0001027     3.82   0.000      .000191    .0005934
     shr_ind |  -.0003767   .0000597    -6.31   0.000    -.0004937   -.0002598
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_pov |    .006334   .0068908     0.92   0.358    -.0071717    .0198396
         mys |   .0009662   .0010611     0.91   0.362    -.0011135     .003046
       gdpgr |   .0002089   .0002252     0.93   0.354    -.0002325    .0006502
       unemp |  -.0000191   .0001067    -0.18   0.858    -.0002282    .0001899
   subs_rice |  -.0000358   .0000417    -0.86   0.391    -.0001175    .0000459
         gdi |   .0000141   .0000423     0.33   0.740    -.0000688    .0000969
     inv_shr |  -3.63e-06   .0000665    -0.05   0.956     -.000134    .0001267
     shr_agr |  -.0000991    .000121    -0.82   0.413    -.0003363    .0001381
     shr_ind |   .0000971   .0001066     0.91   0.362    -.0001119     .000306
-------------+----------------------------------------------------------------
LR_Total     |
      ln_pov |  -.0185727   .0071461    -2.60   0.009    -.0325788   -.0045666
         mys |  -.0028071    .001119    -2.51   0.012    -.0050003   -.0006138
       gdpgr |  -.0006126   .0002739    -2.24   0.025    -.0011494   -.0000758
       unemp |    .000056   .0001991     0.28   0.779    -.0003343    .0004462
   subs_rice |   .0001055    .000048     2.20   0.028     .0000114    .0001996
         gdi |  -.0000366   .0000902    -0.41   0.685    -.0002133    .0001402
     inv_shr |   7.11e-06    .000136     0.05   0.958    -.0002594    .0002736
     shr_agr |   .0002931   .0001468     2.00   0.046     5.32e-06    .0005809
     shr_ind |  -.0002796   .0001123    -2.49   0.013    -.0004998   -.0000594
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   8832.638      12   -17641.28     -17564
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  2264.4047  
Iteration 1:   Log-likelihood =  2265.4132  
Iteration 2:   Log-likelihood =  2265.4355  
Iteration 3:   Log-likelihood =  2265.4356  
Computing marginal effects standard errors using MC simulation...

SAC with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1750
         between = 0.1593
         overall = 0.1653

Mean of fixed-effects =  0.1317

Log-likelihood =  2265.4356
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1450847   .0047231   -30.72   0.000    -.1543417   -.1358277
         mys |  -.0259623   .0022568   -11.50   0.000    -.0303856    -.021539
       gdpgr |   .0000382   .0008786     0.04   0.965    -.0016837    .0017601
       unemp |   .0004949   .0010093     0.49   0.624    -.0014832     .002473
   subs_rice |   .0005508   .0001283     4.29   0.000     .0002994    .0008022
         gdi |   .0004971   .0004688     1.06   0.289    -.0004218    .0014159
     inv_shr |    .000385   .0007204     0.53   0.593     -.001027     .001797
     shr_agr |   .0008355   .0004449     1.88   0.060    -.0000366    .0017075
     shr_ind |    .000436   .0002495     1.75   0.081    -.0000531     .000925
-------------+----------------------------------------------------------------
Spatial      |
         rho |    -.09494   .3075249    -0.31   0.758    -.6976777    .5077977
      lambda |   .1573699   .2953601     0.53   0.594    -.4215252     .736265
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0247263   .0004583    53.95   0.000     .0238279    .0256246
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_gap |  -.1450677    .004855   -29.88   0.000    -.1545833   -.1355521
         mys |  -.0260613    .002176   -11.98   0.000    -.0303262   -.0217964
       gdpgr |   .0001308   .0008412     0.16   0.876    -.0015179    .0017795
       unemp |   .0005028   .0009889     0.51   0.611    -.0014354    .0024411
   subs_rice |   .0005505   .0001246     4.42   0.000     .0003063    .0007948
         gdi |   .0005297   .0004702     1.13   0.260     -.000392    .0014513
     inv_shr |   .0003837   .0007474     0.51   0.608    -.0010813    .0018486
     shr_agr |    .000824   .0004261     1.93   0.053    -.0000112    .0016591
     shr_ind |   .0004579    .000244     1.88   0.061    -.0000204    .0009362
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_gap |  -.0045494   .0669042    -0.07   0.946    -.1356792    .1265803
         mys |  -.0007399    .011977    -0.06   0.951    -.0242144    .0227347
       gdpgr |  -2.70e-06   .0005035    -0.01   0.996    -.0009895    .0009841
       unemp |   .0000103   .0006479     0.02   0.987    -.0012594    .0012801
   subs_rice |   .0000171   .0002714     0.06   0.950    -.0005148     .000549
         gdi |   7.36e-06   .0003021     0.02   0.981    -.0005848    .0005995
     inv_shr |   .0000433   .0004019     0.11   0.914    -.0007444     .000831
     shr_agr |   .0000474   .0005012     0.09   0.925     -.000935    .0010297
     shr_ind |   9.74e-06   .0002269     0.04   0.966     -.000435    .0004545
-------------+----------------------------------------------------------------
LR_Total     |
      ln_gap |  -.1496171   .0676456    -2.21   0.027    -.2822001   -.0170341
         mys |  -.0268012   .0120959    -2.22   0.027    -.0505087   -.0030936
       gdpgr |   .0001281   .0010277     0.12   0.901    -.0018861    .0021423
       unemp |   .0005132   .0012145     0.42   0.673    -.0018672    .0028936
   subs_rice |   .0005676   .0003024     1.88   0.061    -.0000251    .0011603
         gdi |    .000537   .0005661     0.95   0.343    -.0005725    .0016465
     inv_shr |   .0004269   .0008708     0.49   0.624    -.0012797    .0021336
     shr_agr |   .0008713   .0007071     1.23   0.218    -.0005147    .0022573
     shr_ind |   .0004676   .0003307     1.41   0.157    -.0001805    .0011158
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   2265.436      12   -4506.871  -4429.598
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Iteration 0:   Log-likelihood =  508.72518  
Iteration 1:   Log-likelihood =  510.54136  
Iteration 2:   Log-likelihood =  510.56009  
Iteration 3:   Log-likelihood =  510.56011  
Computing marginal effects standard errors using MC simulation...

SAC with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2469
         between = 0.1740
         overall = 0.2097

Mean of fixed-effects = -0.1047

Log-likelihood =   510.5601
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.2052711   .0054055   -37.97   0.000    -.2158658   -.1946765
         mys |  -.0383951   .0032353   -11.87   0.000    -.0447362    -.032054
       gdpgr |   .0001131   .0012827     0.09   0.930    -.0024009    .0026272
       unemp |  -.0019451   .0014741    -1.32   0.187    -.0048342    .0009441
   subs_rice |    .001051   .0001855     5.67   0.000     .0006875    .0014145
         gdi |   .0011849   .0006838     1.73   0.083    -.0001553    .0025251
     inv_shr |   .0010557   .0010638     0.99   0.321    -.0010293    .0031407
     shr_agr |  -.0021866   .0006483    -3.37   0.001    -.0034573   -.0009159
     shr_ind |   .0011391   .0003641     3.13   0.002     .0004254    .0018528
-------------+----------------------------------------------------------------
Spatial      |
         rho |  -.2322128   .2022482    -1.15   0.251     -.628612    .1641865
      lambda |   .2845535   .1831747     1.55   0.120    -.0744623    .6435693
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0527459   .0009796    53.84   0.000     .0508259    .0546659
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_sev |  -.2052474   .0055326   -37.10   0.000    -.2160911   -.1944037
         mys |  -.0385413   .0031179   -12.36   0.000    -.0446523   -.0324303
       gdpgr |    .000248   .0012278     0.20   0.840    -.0021585    .0026546
       unemp |  -.0019341   .0014416    -1.34   0.180    -.0047596    .0008915
   subs_rice |   .0010512   .0001807     5.82   0.000     .0006969    .0014054
         gdi |   .0012326   .0006856     1.80   0.072    -.0001111    .0025763
     inv_shr |   .0010547   .0011034     0.96   0.339    -.0011078    .0032173
     shr_agr |  -.0022058   .0006198    -3.56   0.000    -.0034206   -.0009909
     shr_ind |   .0011713   .0003559     3.29   0.001     .0004737    .0018688
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_sev |    .032659   .0319562     1.02   0.307    -.0299741     .095292
         mys |    .006168   .0060757     1.02   0.310    -.0057401    .0180761
       gdpgr |  -.0000479   .0002829    -0.17   0.866    -.0006024    .0005066
       unemp |   .0003081   .0004458     0.69   0.489    -.0005656    .0011818
   subs_rice |  -.0001691   .0001685    -1.00   0.316    -.0004993    .0001612
         gdi |  -.0002001   .0002435    -0.82   0.411    -.0006773    .0002772
     inv_shr |  -.0001616   .0003044    -0.53   0.595    -.0007582    .0004349
     shr_agr |     .00036   .0003666     0.98   0.326    -.0003585    .0010785
     shr_ind |  -.0001899    .000199    -0.95   0.340      -.00058    .0002001
-------------+----------------------------------------------------------------
LR_Total     |
      ln_sev |  -.1725885   .0329564    -5.24   0.000    -.2371817   -.1079952
         mys |  -.0323733   .0064825    -4.99   0.000    -.0450788   -.0196679
       gdpgr |   .0002001   .0010606     0.19   0.850    -.0018786    .0022789
       unemp |  -.0016259   .0012659    -1.28   0.199    -.0041071    .0008552
   subs_rice |   .0008821   .0002191     4.03   0.000     .0004526    .0013115
         gdi |   .0010325   .0006153     1.68   0.093    -.0001734    .0022384
     inv_shr |   .0008931   .0009548     0.94   0.350    -.0009784    .0027646
     shr_agr |  -.0018458   .0006082    -3.04   0.002    -.0030377   -.0006538
     shr_ind |   .0009813   .0003442     2.85   0.004     .0003066     .001656
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   510.5601      12   -997.1202  -919.8469
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

10 Run the spatial model; SDM Fixed Effect with Region (District) Fixed Effect and SDM Random Effect Model

10.1 Import our weight matrix Wa into our panel dataset

*SDM Fixed Effect Model 
sysuse mymap_and_panel

spmat import Wi using Wa

**Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) fe type (ind) effects
gen speed16 = - (log(1+_b[ln_pov])/8)
gen halfLife16 = log(2)/speed16
estat ic


**The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) fe type (ind) effects
gen speed17 = - (log(1+_b[ln_gap])/8)
gen halfLife17 = log(2)/speed17
estat ic

**The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) fe type (ind) effects
gen speed18 = - (log(1+_b[ln_sev])/8)
gen halfLife18 = log(2)/speed18
estat ic

estimates store sdm_fe


*SDM Random Effect Model 

**Poverty rate
xsmle gpov ln_pov mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) re 
gen speed19 = - (log(1+_b[ln_pov])/8)
gen halfLife19 = log(2)/speed19
estat ic


**The same for poverty gap
xsmle ggap ln_gap mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) re
gen speed20 = - (log(1+_b[ln_gap])/8)
gen halfLife20 = log(2)/speed20
estat ic

**The same for poverty severity
xsmle gsev ln_sev mys gdpgr unemp subs_rice gdi inv_shr shr_agr shr_ind, wmat (Wi) model (sdm) re
gen speed21 = - (log(1+_b[ln_sev])/8)
gen halfLife21 = log(2)/speed21
estat ic

estimates store sdm_re

**Conducting Hausman Test

hausman sdm_fe sdm_re
Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood =  8816.9685  
Iteration 1:   Log-likelihood =  8842.9842  
Iteration 2:   Log-likelihood =  8843.1133  
Iteration 3:   Log-likelihood =  8843.1133  
Computing marginal effects standard errors using MC simulation...

SDM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0631
         between = 0.0002
         overall = 0.0131

Mean of fixed-effects = -0.0990

Log-likelihood =  8843.1133
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |  -.0249862   .0016641   -15.01   0.000    -.0282477   -.0217246
         mys |     -.0037   .0005638    -6.56   0.000    -.0048051   -.0025949
       gdpgr |  -.0008567   .0002121    -4.04   0.000    -.0012724    -.000441
       unemp |   .0000549   .0002436     0.23   0.822    -.0004224    .0005323
   subs_rice |   .0001349   .0000311     4.33   0.000     .0000739    .0001959
         gdi |  -.0000575   .0001127    -0.51   0.610    -.0002783    .0001633
     inv_shr |   .0000426   .0001891     0.23   0.822    -.0003281    .0004133
     shr_agr |   .0004026   .0001073     3.75   0.000     .0001923    .0006129
     shr_ind |  -.0003823   .0000605    -6.32   0.000    -.0005009   -.0002638
-------------+----------------------------------------------------------------
Wx           |
      ln_pov |  -.0178354   .0183666    -0.97   0.332    -.0538332    .0181624
         mys |   .0049249   .0067209     0.73   0.464    -.0082478    .0180976
       gdpgr |   -.000764   .0026015    -0.29   0.769    -.0058628    .0043348
       unemp |   .0003019   .0026602     0.11   0.910     -.004912    .0055158
   subs_rice |   .0003587    .000314     1.14   0.253    -.0002567    .0009742
         gdi |   .0010064   .0012394     0.81   0.417    -.0014228    .0034357
     inv_shr |   -.000095   .0006647    -0.14   0.886    -.0013978    .0012078
     shr_agr |  -7.70e-06   .0011125    -0.01   0.994    -.0021882    .0021728
     shr_ind |   .0018242   .0006656     2.74   0.006     .0005196    .0031288
-------------+----------------------------------------------------------------
Spatial      |
         rho |  -.5226486    .117485    -4.45   0.000    -.7529151   -.2923822
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0012765   .0000266    48.03   0.000     .0012244    .0013286
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_pov |  -.0249048   .0017208   -14.47   0.000    -.0282775    -.021532
         mys |  -.0037463   .0005458    -6.86   0.000     -.004816   -.0026766
       gdpgr |  -.0008336   .0002033    -4.10   0.000    -.0012321   -.0004351
       unemp |   .0000563   .0002384     0.24   0.813    -.0004111    .0005236
   subs_rice |   .0001332   .0000303     4.40   0.000     .0000738    .0001926
         gdi |  -.0000545   .0001134    -0.48   0.631    -.0002769    .0001678
     inv_shr |   .0000429   .0001981     0.22   0.828    -.0003453    .0004312
     shr_agr |   .0004005   .0001027     3.90   0.000     .0001992    .0006018
     shr_ind |  -.0003865   .0000594    -6.51   0.000    -.0005029     -.00027
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_pov |  -.0026675    .012078    -0.22   0.825      -.02634    .0210049
         mys |   .0044666   .0043132     1.04   0.300    -.0039873    .0129204
       gdpgr |  -.0000864   .0018219    -0.05   0.962    -.0036572    .0034845
       unemp |    .000112   .0017346     0.06   0.949    -.0032878    .0035118
   subs_rice |   .0001938   .0002122     0.91   0.361     -.000222    .0006097
         gdi |   .0006664   .0008055     0.83   0.408    -.0009123    .0022451
     inv_shr |  -.0000777   .0004891    -0.16   0.874    -.0010364    .0008809
     shr_agr |  -.0000972   .0007845    -0.12   0.901    -.0016348    .0014403
     shr_ind |   .0013307   .0004666     2.85   0.004     .0004162    .0022452
-------------+----------------------------------------------------------------
LR_Total     |
      ln_pov |  -.0275723   .0119176    -2.31   0.021    -.0509305   -.0042142
         mys |   .0007202   .0042969     0.17   0.867    -.0077015     .009142
       gdpgr |    -.00092   .0018229    -0.50   0.614    -.0044927    .0026528
       unemp |   .0001683   .0017401     0.10   0.923    -.0032423    .0035789
   subs_rice |   .0003271   .0002119     1.54   0.123    -.0000881    .0007423
         gdi |   .0006119      .0008     0.76   0.444    -.0009562    .0021799
     inv_shr |  -.0000348   .0004074    -0.09   0.932    -.0008334    .0007638
     shr_agr |   .0003033   .0007824     0.39   0.698    -.0012302    .0018368
     shr_ind |   .0009442   .0004697     2.01   0.044     .0000237    .0018648
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   8843.113      20   -17646.23  -17517.44
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood =  2268.2397  
Iteration 1:   Log-likelihood =  2271.9225  
Iteration 2:   Log-likelihood =  2271.9288  
Iteration 3:   Log-likelihood =  2271.9288  
Computing marginal effects standard errors using MC simulation...

SDM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1774
         between = 0.1624
         overall = 0.1681

Mean of fixed-effects =  0.2404

Log-likelihood =  2271.9288
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1457719   .0047219   -30.87   0.000    -.1550266   -.1365172
         mys |  -.0257834   .0022527   -11.45   0.000    -.0301987   -.0213681
       gdpgr |   7.52e-07    .000879     0.00   0.999     -.001722    .0017235
       unemp |   .0005162   .0010101     0.51   0.609    -.0014637     .002496
   subs_rice |   .0005534   .0001284     4.31   0.000     .0003017     .000805
         gdi |    .000503   .0004673     1.08   0.282    -.0004129     .001419
     inv_shr |   .0000264   .0007837     0.03   0.973    -.0015095    .0015624
     shr_agr |   .0008533    .000445     1.92   0.055    -.0000188    .0017255
     shr_ind |   .0004064   .0002501     1.62   0.104    -.0000838    .0008965
-------------+----------------------------------------------------------------
Wx           |
      ln_gap |   .0038393   .0515668     0.07   0.941    -.0972299    .1049084
         mys |   .0769483   .0270892     2.84   0.005     .0238545    .1300422
       gdpgr |  -.0107517   .0107324    -1.00   0.316    -.0317869    .0102834
       unemp |  -.0010465   .0110385    -0.09   0.924    -.0226815    .0205885
   subs_rice |   .0021184   .0012799     1.66   0.098      -.00039    .0046269
         gdi |  -.0088292   .0051529    -1.71   0.087    -.0189286    .0012702
     inv_shr |   .0029426   .0027502     1.07   0.285    -.0024476    .0083328
     shr_agr |   .0059087   .0046305     1.28   0.202    -.0031669    .0149843
     shr_ind |  -.0014087   .0027554    -0.51   0.609    -.0068093    .0039919
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .0272658   .1025017     0.27   0.790    -.1736339    .2281655
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |    .021925   .0004559    48.09   0.000     .0210315    .0228185
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_gap |  -.1455953   .0048476   -30.03   0.000    -.1550965   -.1360941
         mys |  -.0258319   .0021677   -11.92   0.000    -.0300804   -.0215833
       gdpgr |   .0000898   .0008423     0.11   0.915    -.0015611    .0017408
       unemp |   .0005234   .0009894     0.53   0.597    -.0014158    .0024626
   subs_rice |    .000553   .0001247     4.43   0.000     .0003085    .0007974
         gdi |   .0005325   .0004686     1.14   0.256    -.0003861     .001451
     inv_shr |   .0000265   .0008124     0.03   0.974    -.0015658    .0016188
     shr_agr |   .0008429   .0004253     1.98   0.047     9.42e-06    .0016764
     shr_ind |   .0004274   .0002446     1.75   0.081     -.000052    .0009068
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_gap |   .0023616   .0509103     0.05   0.963    -.0974208     .102144
         mys |   .0783523    .027979     2.80   0.005     .0235144    .1331902
       gdpgr |  -.0104111   .0118844    -0.88   0.381    -.0337042    .0128819
       unemp |  -.0015474   .0113206    -0.14   0.891    -.0237354    .0206406
   subs_rice |   .0022258   .0013415     1.66   0.097    -.0004035     .004855
         gdi |  -.0092411   .0052249    -1.77   0.077    -.0194816    .0009995
     inv_shr |   .0030499   .0029356     1.04   0.299    -.0027039    .0088036
     shr_agr |   .0064284   .0051163     1.26   0.209    -.0035993     .016456
     shr_ind |  -.0015277   .0029963    -0.51   0.610    -.0074003    .0043448
-------------+----------------------------------------------------------------
LR_Total     |
      ln_gap |  -.1432337   .0509602    -2.81   0.005    -.2431139   -.0433534
         mys |   .0525204   .0281079     1.87   0.062    -.0025701    .1076109
       gdpgr |  -.0103213   .0119711    -0.86   0.389    -.0337843    .0131417
       unemp |   -.001024    .011427    -0.09   0.929    -.0234204    .0213724
   subs_rice |   .0027787   .0013497     2.06   0.040     .0001333    .0054242
         gdi |  -.0087086   .0052424    -1.66   0.097    -.0189836    .0015664
     inv_shr |   .0030763   .0026699     1.15   0.249    -.0021566    .0083092
     shr_agr |   .0072713   .0051417     1.41   0.157    -.0028063    .0173488
     shr_ind |  -.0011003   .0030271    -0.36   0.716    -.0070334    .0048328
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   2271.929      20   -4503.858  -4375.069
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood =  521.46387  
Iteration 1:   Log-likelihood =  524.63885  
Iteration 2:   Log-likelihood =  524.64484  
Iteration 3:   Log-likelihood =  524.64484  
Computing marginal effects standard errors using MC simulation...

SDM with spatial fixed-effects                       Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2514
         between = 0.1731
         overall = 0.2110

Mean of fixed-effects =  0.0722

Log-likelihood =   524.6448
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.2062572   .0053952   -38.23   0.000    -.2168316   -.1956828
         mys |  -.0379153   .0032325   -11.73   0.000    -.0442508   -.0315798
       gdpgr |  -8.77e-06   .0012822    -0.01   0.995    -.0025219    .0025044
       unemp |  -.0017744   .0014731    -1.20   0.228    -.0046617    .0011129
   subs_rice |   .0010581   .0001854     5.71   0.000     .0006947    .0014216
         gdi |   .0012048    .000682     1.77   0.077     -.000132    .0025416
     inv_shr |   .0003783   .0011434     0.33   0.741    -.0018627    .0026194
     shr_agr |  -.0022435   .0006485    -3.46   0.001    -.0035146   -.0009725
     shr_ind |   .0010984   .0003647     3.01   0.003     .0003836    .0018133
-------------+----------------------------------------------------------------
Wx           |
      ln_sev |   .0806642    .060373     1.34   0.182    -.0376648    .1989931
         mys |   .1340604   .0391803     3.42   0.001     .0572684    .2108524
       gdpgr |  -.0128497   .0156897    -0.82   0.413    -.0436009    .0179015
       unemp |   .0324251   .0160923     2.01   0.044     .0008848    .0639655
   subs_rice |  -.0011843   .0018482    -0.64   0.522    -.0048068    .0024382
         gdi |  -.0135375    .007491    -1.81   0.071    -.0282196    .0011445
     inv_shr |   .0051749   .0039811     1.30   0.194    -.0026279    .0129777
     shr_agr |   .0109156   .0067001     1.63   0.103    -.0022163    .0240475
     shr_ind |  -.0051374   .0040263    -1.28   0.202    -.0130289     .002754
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .0446306   .1033237     0.43   0.666    -.1578802    .2471414
-------------+----------------------------------------------------------------
Variance     |
    sigma2_e |   .0466668   .0009703    48.09   0.000      .044765    .0485686
-------------+----------------------------------------------------------------
LR_Direct    |
      ln_sev |  -.2060217   .0055344   -37.23   0.000    -.2168688   -.1951745
         mys |  -.0379619    .003112   -12.20   0.000    -.0440613   -.0318626
       gdpgr |   .0001197   .0012286     0.10   0.922    -.0022884    .0025277
       unemp |  -.0017458   .0014395    -1.21   0.225    -.0045672    .0010756
   subs_rice |   .0010567   .0001808     5.84   0.000     .0007023    .0014111
         gdi |   .0012442   .0006841     1.82   0.069    -.0000967    .0025851
     inv_shr |   .0003795   .0011848     0.32   0.749    -.0019427    .0027018
     shr_agr |  -.0022552   .0006191    -3.64   0.000    -.0034686   -.0010418
     shr_ind |    .001127   .0003564     3.16   0.002     .0004285    .0018255
-------------+----------------------------------------------------------------
LR_Indirect  |
      ln_sev |   .0781179   .0614649     1.27   0.204    -.0423511    .1985869
         mys |   .1390579   .0424721     3.27   0.001     .0558141    .2223018
       gdpgr |  -.0124243   .0176555    -0.70   0.482    -.0470284    .0221798
       unemp |   .0334941   .0169358     1.98   0.048     .0003006    .0666876
   subs_rice |  -.0011634   .0020175    -0.58   0.564    -.0051176    .0027909
         gdi |  -.0144744    .007877    -1.84   0.066    -.0299131    .0009643
     inv_shr |   .0055044   .0043627     1.26   0.207    -.0030463    .0140551
     shr_agr |     .01189    .007576     1.57   0.117    -.0029587    .0267386
     shr_ind |  -.0055068   .0044663    -1.23   0.218    -.0142605    .0032469
-------------+----------------------------------------------------------------
LR_Total     |
      ln_sev |  -.1279038   .0615718    -2.08   0.038    -.2485823   -.0072252
         mys |    .101096   .0426821     2.37   0.018     .0174405    .1847514
       gdpgr |  -.0123046   .0177787    -0.69   0.489    -.0471502    .0225409
       unemp |   .0317483   .0170792     1.86   0.063    -.0017263    .0652229
   subs_rice |  -.0001067    .002032    -0.05   0.958    -.0040893    .0038759
         gdi |  -.0132302   .0079078    -1.67   0.094    -.0287293    .0022689
     inv_shr |    .005884   .0039795     1.48   0.139    -.0019157    .0136837
     shr_agr |   .0096348   .0076155     1.27   0.206    -.0052914     .024561
     shr_ind |  -.0043798   .0045122    -0.97   0.332    -.0132235    .0044639
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   524.6448      20    -1009.29  -880.5007
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.


Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood =   7396.441  (not concave)
Iteration 1:   Log-likelihood =  7923.7125  
Iteration 2:   Log-likelihood =  8011.0662  
Iteration 3:   Log-likelihood =  8013.0278  
Iteration 4:   Log-likelihood =  8013.0309  
Iteration 5:   Log-likelihood =  8013.0309  

SDM with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.0531
         between = 0.1780
         overall = 0.1176

Log-likelihood =  8013.0309
------------------------------------------------------------------------------
        gpov |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_pov |   -.019622   .0016736   -11.72   0.000    -.0229022   -.0163418
         mys |  -.0031761   .0005845    -5.43   0.000    -.0043218   -.0020304
       gdpgr |  -.0009622   .0002214    -4.35   0.000    -.0013962   -.0005282
       unemp |   -.000266   .0002525    -1.05   0.292    -.0007609    .0002289
   subs_rice |   .0000801   .0000318     2.52   0.012     .0000178    .0001424
         gdi |  -.0000253   .0001159    -0.22   0.827    -.0002525    .0002018
     inv_shr |   -.000023   .0001932    -0.12   0.905    -.0004016    .0003557
     shr_agr |   .0003698   .0001112     3.32   0.001     .0001518    .0005879
     shr_ind |  -.0003532   .0000642    -5.50   0.000    -.0004791   -.0002274
       _cons |  -.2538549   .1232401    -2.06   0.039     -.495401   -.0123088
-------------+----------------------------------------------------------------
Wx           |
      ln_pov |   .0092457   .0178024     0.52   0.604    -.0256464    .0441377
         mys |   .0175386   .0067446     2.60   0.009     .0043194    .0307579
       gdpgr |  -.0051751   .0026239    -1.97   0.049    -.0103179   -.0000322
       unemp |  -.0063801   .0025646    -2.49   0.013    -.0114066   -.0013537
   subs_rice |  -.0009586   .0002922    -3.28   0.001    -.0015314   -.0003858
         gdi |   .0027868   .0012377     2.25   0.024     .0003609    .0052127
     inv_shr |  -.0002416   .0006797    -0.36   0.722    -.0015737    .0010905
     shr_agr |  -.0003624   .0011551    -0.31   0.754    -.0026263    .0019015
     shr_ind |   .0018163   .0007059     2.57   0.010     .0004329    .0031998
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .1996357    .092009     2.17   0.030     .0193013    .3799701
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.5432103   .0561066    -9.68   0.000    -.6531773   -.4332433
    sigma2_e |   .0014661   .0000326    45.02   0.000     .0014023    .0015299
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   8013.031      22   -15982.06  -15840.39
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood =  861.33864  (not concave)
Iteration 1:   Log-likelihood =  1291.1812  
Iteration 2:   Log-likelihood =  1377.2866  
Iteration 3:   Log-likelihood =  1383.3368  
Iteration 4:   Log-likelihood =   1383.377  
Iteration 5:   Log-likelihood =   1383.377  

SDM with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.1703
         between = 0.3186
         overall = 0.2608

Log-likelihood =  1383.3770
------------------------------------------------------------------------------
        ggap |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_gap |  -.1424265   .0046847   -30.40   0.000    -.1516084   -.1332446
         mys |  -.0257667   .0023406   -11.01   0.000    -.0303541   -.0211792
       gdpgr |  -.0001462    .000918    -0.16   0.873    -.0019453     .001653
       unemp |  -.0000567   .0010479    -0.05   0.957    -.0021106    .0019972
   subs_rice |   .0004695   .0001311     3.58   0.000     .0002125    .0007265
         gdi |   .0002721    .000483     0.56   0.573    -.0006745    .0012187
     inv_shr |   .0000536   .0008048     0.07   0.947    -.0015237     .001631
     shr_agr |   .0004188   .0004626     0.91   0.365    -.0004879    .0013255
     shr_ind |   .0004648   .0002643     1.76   0.079    -.0000531    .0009828
       _cons |  -.1378425   .4403658    -0.31   0.754    -1.000944    .7252586
-------------+----------------------------------------------------------------
Wx           |
      ln_gap |   .0052243    .049096     0.11   0.915    -.0910022    .1014507
         mys |   .1067199   .0276546     3.86   0.000     .0525178     .160922
       gdpgr |  -.0301852   .0108678    -2.78   0.005    -.0514857   -.0088846
       unemp |  -.0211848   .0108305    -1.96   0.050    -.0424121    .0000425
   subs_rice |  -.0018836   .0012243    -1.54   0.124    -.0042832    .0005159
         gdi |  -.0012599   .0051719    -0.24   0.808    -.0113966    .0088769
     inv_shr |   .0024761    .002825     0.88   0.381    -.0030608     .008013
     shr_agr |   .0050637   .0048051     1.05   0.292    -.0043541    .0144815
     shr_ind |  -.0011804   .0029107    -0.41   0.685    -.0068852    .0045245
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .4303674   .0822257     5.23   0.000     .2692079    .5915269
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.7805233   .0499531   -15.63   0.000    -.8784297    -.682617
    sigma2_e |    .024837   .0005495    45.20   0.000     .0237601    .0259139
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   1383.377      22   -2722.754  -2581.086
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

Warning: All regressors will be spatially lagged 

Iteration 0:   Log-likelihood = -479.80286  
Iteration 1:   Log-likelihood = -297.53837  
Iteration 2:   Log-likelihood = -241.00889  
Iteration 3:   Log-likelihood =  -240.6194  
Iteration 4:   Log-likelihood = -240.61898  
Iteration 5:   Log-likelihood = -240.61898  

SDM with random-effects                              Number of obs =      4626

Group variable: fips                              Number of groups =       514
Time variable: year                                   Panel length =         9

R-sq:    within  = 0.2495
         between = 0.2010
         overall = 0.2247

Log-likelihood =  -240.6190
------------------------------------------------------------------------------
        gsev |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Main         |
      ln_sev |  -.1975043   .0053084   -37.21   0.000    -.2079085   -.1871001
         mys |  -.0387483   .0033165   -11.68   0.000    -.0452486   -.0322481
       gdpgr |    .000121   .0013229     0.09   0.927    -.0024718    .0027138
       unemp |  -.0021902   .0015042    -1.46   0.145    -.0051383    .0007579
   subs_rice |   .0011287   .0001857     6.08   0.000     .0007648    .0014926
         gdi |   .0005539   .0006928     0.80   0.424    -.0008041    .0019118
     inv_shr |   .0003071   .0011507     0.27   0.790    -.0019483    .0025624
     shr_agr |  -.0029054    .000665    -4.37   0.000    -.0042088   -.0016021
     shr_ind |   .0011754   .0003832     3.07   0.002     .0004242    .0019266
       _cons |   .0109046   .6071885     0.02   0.986    -1.179163    1.200972
-------------+----------------------------------------------------------------
Wx           |
      ln_sev |   .1577857   .0589354     2.68   0.007     .0422744     .273297
         mys |   .1578271   .0388894     4.06   0.000     .0816054    .2340488
       gdpgr |  -.0099658   .0153617    -0.65   0.517    -.0400742    .0201425
       unemp |   .0073235   .0149551     0.49   0.624     -.021988    .0366349
   subs_rice |  -.0033627   .0017012    -1.98   0.048     -.006697   -.0000284
         gdi |  -.0101382   .0073284    -1.38   0.167    -.0245016    .0042252
     inv_shr |   .0022603   .0040126     0.56   0.573    -.0056043    .0101249
     shr_agr |   .0067015   .0068989     0.97   0.331      -.00682     .020223
     shr_ind |  -.0049252    .004229    -1.16   0.244    -.0132139    .0033634
-------------+----------------------------------------------------------------
Spatial      |
         rho |   .2666974   .0956696     2.79   0.005     .0791885    .4542063
-------------+----------------------------------------------------------------
Variance     |
   lgt_theta |  -.4494071   .0554867    -8.10   0.000    -.5581591   -.3406551
    sigma2_e |   .0526456   .0011634    45.25   0.000     .0503654    .0549259
------------------------------------------------------------------------------




Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      4,626         .   -240.619      22     525.238   666.9058
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

                 ---- Coefficients ----
             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
             |     sdm_fe       sdm_re       Difference          S.E.
-------------+----------------------------------------------------------------
      ln_sev |   -.2062572    -.1975043        -.008753        .0009642
         mys |   -.0379153    -.0387483         .000833               .
       gdpgr |   -8.77e-06      .000121       -.0001298               .
       unemp |   -.0017744    -.0021902        .0004158               .
   subs_rice |    .0010581     .0011287       -.0000706               .
         gdi |    .0012048     .0005539        .0006509               .
     inv_shr |    .0003783     .0003071        .0000713               .
     shr_agr |   -.0022435    -.0029054        .0006619               .
     shr_ind |    .0010984     .0011754        -.000077               .
------------------------------------------------------------------------------
                           b = consistent under Ho and Ha; obtained from xsmle
            B = inconsistent under Ha, efficient under Ho; obtained from xsmle

    Test:  Ho:  difference in coefficients not systematic

                  chi2(9) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                          =       77.17
                Prob>chi2 =      0.0000
                (V_b-V_B is not positive definite)
LS0tCnRpdGxlOiAiUmVnaW9uYWwgUG92ZXJ0eSwgQ29udmVyZ2VuY2UsIGFuZCBTcGF0aWFsIEVmZmVjdHM6IgpzdWJ0aXRsZTogIkEgU3BhdGlhbCBFY29ub21ldHJpYyBBcHByb2FjaCIKYXV0aG9yOiAiUmFnZGFkIENhbmkgTWlyYW50aSIKb3V0cHV0OgogIGh0bWxfZG9jdW1lbnQ6CiAgICBjb2RlX2Rvd25sb2FkOiB0cnVlCiAgICBkZl9wcmludDogcGFnZWQKICAgIHRvYzogdHJ1ZQogICAgdG9jX2Zsb2F0OgogICAgICBjb2xsYXBzZWQ6IGZhbHNlCiAgICAgIHNtb290aF9zY3JvbGw6IGZhbHNlCiAgICB0b2NfZGVwdGg6IDQKICAgIG51bWJlcl9zZWN0aW9uczogdHJ1ZQogICAgY29kZV9mb2xkaW5nOiAic2hvdyIKICAgIHRoZW1lOiAiY29zbW8iCiAgICBoaWdobGlnaHQ6ICJtb25vY2hyb21lIgogIHBkZl9kb2N1bWVudDogZGVmYXVsdAogIHdvcmRfZG9jdW1lbnQ6IGRlZmF1bHQKYmlibGlvZ3JhcGh5OiBiaWJsaW8uYmliCi0tLQoKPHN0eWxlPgpoMS50aXRsZSB7Zm9udC1zaXplOiAxOHB0OyBjb2xvcjogRGFya0JsdWU7fSAKYm9keSwgaDEsIGgyLCBoMywgaDQge2ZvbnQtZmFtaWx5OiAi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