[R-sig-Geo] Mean Effects SAR Model

Roger Bivand Roger.Bivand at nhh.no
Mon Apr 3 23:49:33 CEST 2006


On Mon, 3 Apr 2006, Larry Layne wrote:

> >> I would like to estimate the parameters for the SAR model: Y = pWY + XB
> >> +  e, as a pure mean effects model for Y.
> >
> > What is a mean effects model when it is not in your dialect of data
> > analysis?
> 
> It means exactly what you say below:

(thought so!)

> 
> > If you mean lagsarlm() with just the intercept on the right hand side,
> > please see ?formula:
> >
> > lagsarlm(Y ~ 1, ...) will just fit an intercept...
> 
> If I specify the model syntax lagsarlm(Y ~ 1, ...) I get:
> 
> Spatial lag model
> Jacobian calculated using sparse matrix techniques using SparseM
> Error: subscript out of bounds
> 
> Any idea what subscript the program is talking about?

OK. I can replicate this - there is still a bug in handling intercept-only
models in lagsarlm() with method="SparseM"; it was partly fixed in January
2005. The equivalent model for errorsarlm() works:

library(spdep)
data(columbus)
#lagsarlm(CRIME ~ 1, data=columbus, nb2listw(col.gal.nb), method="SparseM")
try1 <- residuals(errorsarlm(CRIME ~ 1, data=columbus, 
  nb2listw(col.gal.nb), method="SparseM"))
try2 <- residuals(lagsarlm(CRIME ~ 1, data=columbus, 
  nb2listw(col.gal.nb), method="eigen"))
all.equal(try1, try2, tol=1e-07)

and the residuals are the same as for the lag model, as you can see. I'll
try to fix the problem tomorrow.

Thanks for a helpful report.

Roger

> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list