[R-sig-Geo] Problem with spatial error model - discontinuous polygons

Roger Bivand Roger.Bivand at nhh.no
Fri Jan 11 09:05:43 CET 2008


On Thu, 10 Jan 2008, Debarchana Ghosh wrote:

> Hi,
>
> I'm trying to run a spatial error model using the spdep package. I'm working
> on a windows machine with 2GB ram.
>
> baseshpPIN<-readShapePoly("tricounty_2005.shp", IDvar="PIN", verbose=TRUE)
>
> ## The shape has lots of discontinuous polygons
>
> basenb<-poly2nb(baseshpPIN, row.names=PIN)
>
> adrweights<-nb2listw(basenb, style="W", zero.policy=TRUE)
>
> modnetwork.errormod<-errorsarlm(SALE_VALUE~., data=modnetwork, adrweights)
> Error in errorsarlm(SALE_VALUE ~ ., data = modnetwork, adrweights) :
>        NAs in lagged dependent variable
> In addition: Warning message:
> NAs in lagged values in: lag.listw(listw, y, zero.policy = zero.policy)
>
> When I tried to Moran's I test, it gave similar errors. How can I solve this
> problem? Is there any wrong with the listw object (adrweights)?

Add the zero.policy=TRUE argument to each subsequent command too.

This is in ?errorsarlm:

"zero.policy: if TRUE assign zero to the lagged value of zones without
           neighbours, if FALSE (default) assign NA - causing
           'errorsarlm()' to terminate with an error"

Roger

>
> I'll appreciate any help.
>
> Thanks,
> Debs.
>
>
>
>

-- 
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