Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: spmat and spatreg LM testing


From   [email protected]
To   [email protected]
Subject   st: spmat and spatreg LM testing
Date   Fri, 14 Oct 2011 11:50:48 -0500

Martijn Smit <[email protected]> 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
[email protected]
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index