Hello Everyone!
I am trying to create a variable corresponding to the distance from each municipality to a border (which includes a group of municipalities).
However, I do not know how to create a border polygon using stata.
I ran to get the coordinates dataset.
And then I attempted to create the polygon corresponding to my "treatment" area:
I manually merged the two datasets created by mergepoly.
However, now I do not know how to create a variable corresponding to the distance between each municipality and the border of the polygon I created.
Thank you very much.
Best,
Cat
I am trying to create a variable corresponding to the distance from each municipality to a border (which includes a group of municipalities).
However, I do not know how to create a border polygon using stata.
I ran to get the coordinates dataset.
Code:
shp2dta using data12, database(CountryMap) coordinates(municoord) genid(identi)
Code:
rename FID _ID mergepoly if inlist(province,"a","b","c", "d", /// "e", "f", "g", "h") using "municoord.dta", coor(merged_coord) replace mergepoly if inlist(muni_name,"m1", "m2", "m3", /// "m4", "m5", "m6", "m7","m8") using "municoord.dta", coor(merged_coord2) replace
However, now I do not know how to create a variable corresponding to the distance between each municipality and the border of the polygon I created.
Thank you very much.
Best,
Cat
Comment