[R] spdep error message

rnaidoo rnaidoo at ualberta.ca
Fri Aug 8 00:03:55 CEST 2003

I have been using the package "spdep" to run spatial regressions on a data set 
with about 2500 observations.  It has performed well up until now, but the 
following code resulted in an error:

> load("Panel.90s.ok.R")
> attach(Panel.90s.ok)
> neighs<-dnearneigh(cbind(x,y),0,50000)
> help(nbdists)
> dists<-nbdists(neighs,cbind(x,y))
> Weights<-nb2listw(neighs,zero.policy=T,glist=dists)
Error in eigen(w, only.values = TRUE) : error code 2311 from Lapack routine 
The problem seems to be with the inclusion of the Euclidean distances 
in the spatial weights matrix, as regressions using weights matrices without a 
glist worked fine.  I tried switching the method used in errorsarlm to 
but this also resulted in an error:
Error in switch(method, eigen = if (!quiet) cat("neighbourhood matrix 
eigenvalues\n"),  :
Unknown method
Similarly, switching methods to "sparse" also resulted in an error:
Error in spwdet(sparseweights, rho = rho, debug = debug) :
        Suspicious allocation of memory in sparse functions
        ...bailing out! Save workspace and quit R!
Any help on how to incorporate distance measures into the spatial weights 
matrix for the errorsarlm/lagsarlm spatial regression commands would be 
appreciated!  Hopefully I haven't overlooked something very obvious.
Robin Naidoo
Department of Rural Economy
University of Alberta

More information about the R-help mailing list