Skip to content
Prev 2866 / 29559 Next

row-standardized spatial weighting matrix

On Thu, 29 Nov 2007, Christina Li wrote:

            
The code shows that what is happening is that an attribute of the weights 
component of the object set by nb2listw() is being checked. If the 
attribute is not found, the warning is issued. When weights are converted 
from a matrix, the attribute is not set, and the style component of the 
listw object as a whole is set to "M". The usual solution is to do 
something like:

x <- mat2listw(xmat)
xW <- nb2listw(x$neighbours, style="W")

to get to a listw object for which we know that row standardisation holds. 
If the original specification was for general weights, use the glist= 
argument to pass x$weights.

lm.LMtests() could check itself, and not issue the warning, but checking 
would be costly, and it is better to do this once by hand rather than many 
times automatically. I'm pretty sure in addition that the ASCII file route 
introduced rounding errors, so even if it did check, row sums might miss 
unity by machine fuzz (say 1e-12).
If you check this out on the example on the help page for lm.LMtests(), 
you'll see the difference between nb2listw(COL.nb, style = "B") and 
nb2listw(COL.nb, style = "W"). If I remember correctly, the test is based 
on row-standardised weights. In general, row-standardisation increases the 
influence of observations with few neighbours, while other styles may 
increase the influence of those with many neighbours.

Roger