Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: spmat and spatreg LM testing

Subject   st: spmat and spatreg LM testing
Date   Fri, 14 Oct 2011 11:50:48 -0500

Martijn Smit <> has a question about choosing between
spatial lag and spatial error models using the user-written -spmat- command:

> I'm using spmat (from sppack), and it works very well - except that it doesn't
> seem to give LM tests for choosing between lag and error models.

-spmat- does not offer an LM statistic.  Instead, Martijn can estimate
a spatial-autoregressive model and perform a Wald test on the
spatial-autoregressive coefficient.  The example below uses the pollute.dta
and pollutexy.dta that come with -sppack-.

. use pollute, clear
. spmat contiguity cobj using pollutexy, id(id) normalize(minmax)
. spreg gs2sls pollution factories area, id(id) dlmat(cobj)
  (output omitted)
. test _b[lambda:_cons]=0

 ( 1)  [lambda]_cons = 0

           chi2(  1) =  451.17
         Prob > chi2 =    0.0000

In this example, we can reject the null that the spatial-autoregressive term is
zero and conclude that the spatial-autoregressive model is preferable to an OLS

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index