Hello everyone,

I'm trying to create the spatial lag of a variable. This variable is the amount of public transfers observed for the 2458 mexican municipalities. Unfortunatly, the data are missing for 234 municipalities.
To do so, I first created the contiguity matrix with the command:
Code:
spmat contiguity matrixNr using mexico_mun_xy, id(id) normalize(row)
. I get a 2458x2458 matrix.
I then used
Code:
spmat lag double transfer_lag matrixNr transfer
. The new variable generated only has missing values. I assumed this is due to the fact that 234 observations are missing.

My question: Is there any way Stata can handle missing values while creating a spatial lag ?

This only solution I found is to create a new 2224x2224 contiguity matrix (deleting the municipalities for which the data where missing) and deleting the 234 missings in my public transfer database. Then I can get the spatial lag. However, it doesn't seem really correct to me to proceed this way and I'm not sure the data generated are valid.

I hope someone can help me.
Thank you !

Lucie