[R-sig-Geo] problems using spml with a listw, where not everybody has a neighbour

Daniel Schütz schuetz_daniel at gmx.net
Wed Mar 4 09:18:34 CET 2015


Dear Community,



Before explaining my problem I want to apologize for my maybe bad English.



I am currently working at my master exam and estimating a wage curve for
Germany. With the last spatial analysis problems occur I cannot conquer.



I get the following output when using .spml for this last estimation:



> spml(formula=formel_alle_w, data=roh_kfs, model="within",
listw=w_kfs.lwnb, effect="twoways", zero.policy=TRUE, lag=TRUE,
spatial.error="kkp")

Error in lag.listw(listw2, u) : Variable contains non-finite values

In addition: There were 32 warnings (use warnings() to see them)

> warnings()

Warning messages:

1: In lag.listw(listw, u) : NAs in lagged values

…..

32: In lag.listw(listw, u) : NAs in lagged values



I introduced zero.policy to this estimation, because in the .listw object
are elements that have no neighbours.

This is the problem I think which causes the problems. But I have no idea
how I can solve this problem.





I created the listw. object the following way:



> w_kfs.matrix = as.matrix(read.csv(file="W_kfs.csv", header=T, dec=”,” ,
sep=”;” ), nrow=107, ncol=107)

> w_kfs.lwmat = mat2listw(w_kfs.matrix)

> w_kfs.nb = w_kfs.lwmat$neighbours

> w_kfs.lwnb = nb2listw(w_kfs.nb, style="W")



The names of the columns and the rows are the same. That I already checked
like I checked the symmetry what is also given.



So if you have any solution for my problem I would be very grateful.



Yours thankfully,



Daniel





---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list