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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: spmat and spatreg LM testing


From   rraciborski@stata.com
To   statalist@hsphsun2.harvard.edu
Subject   st: spmat and spatreg LM testing
Date   Fri, 14 Oct 2011 11:50:48 -0500

Martijn Smit <martijn.smit@vu.nl> 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
model.

--Rafal
rraciborski@stata.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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