Hi everyone, seeking help for a spatial RD. [I couldn't find the answer I was looking for in existing posts, but if I missed something please let me know.]
I have data with coordinates for a bunch of structures in the US. I also have shape files for all the census tracts in the US, as well as an eligibility indicator (some tracts are eligible, others are not). For each of my structures, I want to calculate the distance to the nearest eligibility border (i.e., where an eligible tract meets an ineligible tract), to see if these structures are placed selectively on the eligible side of the border. Is there a way to do this in Stata? There may be an efficiency concern here as I have about 130k structures, and 84k tracts. Is there a way to do this without calculating the distance between each structure and each tract's nearest border (and then minimizing this distance across all estimated structure-tract pairs for each structure)?
The difference between this task and eg the thread about the smallest distance from a point to a border (and the helpful reply about the Texas/Mexico border) is that my eligible tracts are many and not necessarily contiguous, so I am not just finding the shortest distance to one single polygon but rather to a collection of them.
Thank you in advance! Looking forward to any response.
I have data with coordinates for a bunch of structures in the US. I also have shape files for all the census tracts in the US, as well as an eligibility indicator (some tracts are eligible, others are not). For each of my structures, I want to calculate the distance to the nearest eligibility border (i.e., where an eligible tract meets an ineligible tract), to see if these structures are placed selectively on the eligible side of the border. Is there a way to do this in Stata? There may be an efficiency concern here as I have about 130k structures, and 84k tracts. Is there a way to do this without calculating the distance between each structure and each tract's nearest border (and then minimizing this distance across all estimated structure-tract pairs for each structure)?
The difference between this task and eg the thread about the smallest distance from a point to a border (and the helpful reply about the Texas/Mexico border) is that my eligible tracts are many and not necessarily contiguous, so I am not just finding the shortest distance to one single polygon but rather to a collection of them.
Thank you in advance! Looking forward to any response.

Comment