I hope there is someone that will be able to help me. I have been looking at previous FAQ on Statalist but could not find the one that will give me the code I need.
I have two datasets. In the first dataset I have 60 obs of small gold mines in Burkina Faso. I have the longitude and latitude of each mine. It is just a point, not a polygon. So the database looks something like this: (The "objectid" is just each mine numbered and the longitude and latitude is the specific mine's coordinates.)
| objectid longitude latitude |
|--------------------------------------------|
| 1 12.019287 1.3967028 |
| 2 12.471074 .76883174 |
| 3 13.353399 -.29639484 |
| 4 12.411368 -.72431002 |
| 5 12.246743 -.87246019 |
In the second database I use data from the DHS survey from USAID - I have more than 25000 observations of households in Burkina Faso. With variables that describe the household (wealth, if they have electricity, literacy, etc) as well as the longitude and latitude of the village the household is in. It looks something like this:
id longit~e latitude wealth~x litera~y |
|-------------------------------------------------------------------|
| 517 -4.307324 11.18618 richest able to |
| 164 -2.36086 13.205 richer cannot r |
| 200 -5.289879 10.70456 poorest cannot r |
| 349 0.304598 13.81315 poorest cannot r |
| 173 -4.324343 9.669069 richest cannot r |
My question:
I want to create a dummy variable in my second database called vicinity_mine that is 1 if the household's village (longitude and latitude attached to the household) is in the vicinity of a mine and 0 if not. Let's say "vicinity" is defined as within a 5km radius of the mine. I want to use the coordinates of the mines in the first database to create such a database but I am not sure where to start.
I have very little experience with distances and using coordinates on Stata so any help on what code I should use will be very helpful.
Thank you very much.
All the bet,
Nettie
Related Posts with What code will match longitude and latitudes
Help with new variable generationHi, I`m trying to generate a new variable = different expressions by sex, but only if sex==0 the exp…
Why different results for tests for serial correlation / autocorrelation in panel data (abar, actest, xtserial)?I would like to test my panel data for serial correlation. The panel data is unbalanced and has gaps…
Finding percentage change and correlation Code: +-----------------------------+ | date year usd_to~r | |----------------------…
Merge Panel Data set by IdsI have a panel data set (Master) with id, name, month, and year. I have another data set (Data set …
Creating a change variable, panel dataHi everyone, I have a Panel Data Set and want to create a variable which shows me the change of the…
Subscribe to:
Post Comments (Atom)
0 Response to What code will match longitude and latitudes
Post a Comment