[R] spdep error message

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


Hello,
    
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.model.rprice<-errorsarlm(log(wells+1)~log(year)+log(area)+log(lag.rprice
)+log(marketable+1)+log(prov.rds+1)+log(ind.rds+1)+log(seismic+1)+log(pipeline
s+1)+log(min.year)+log(max.year)+log(avg.year),listw=Weights,zero.policy=T)
Error in eigen(w, only.values = TRUE) : error code 2311 from Lapack routine 
dgeev
    
The problem seems to be with the inclusion of the Euclidean distances 
("dists") 
in the spatial weights matrix, as regressions using weights matrices without a 
glist worked fine.  I tried switching the method used in errorsarlm to 
"eigenw" 
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 
greatly 
appreciated!  Hopefully I haven't overlooked something very obvious.
    
Regards,
    
Robin Naidoo
Department of Rural Economy
University of Alberta
Canada




More information about the R-help mailing list