Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
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/