Hi,
I have a dataset containing a household ID, latitude, and longitude variables, and I want to create a variable that counts the number of households within 1 km of each household. Geonear looks perfect, but I think it only works if you have a baseid and a nborid. In this case, I only have a baseid (household_id).
I've tried:
geonear household_id latitude longitude using "cashdata.dta", ///
neighbors(household_id latitude longitude) long ignoreself within(1) near(0)
but it tells me the identifier cannot be the same. Is there another way I can do this, or is this just the wrong command?
Thanks in advance.
I have a dataset containing a household ID, latitude, and longitude variables, and I want to create a variable that counts the number of households within 1 km of each household. Geonear looks perfect, but I think it only works if you have a baseid and a nborid. In this case, I only have a baseid (household_id).
I've tried:
geonear household_id latitude longitude using "cashdata.dta", ///
neighbors(household_id latitude longitude) long ignoreself within(1) near(0)
but it tells me the identifier cannot be the same. Is there another way I can do this, or is this just the wrong command?
Thanks in advance.
Comment