Dear all,
I have two datasets in which for every observation there are two variables, lat and long, providing the geographic coordinates to that observation. Now, in dataset A, I want to create two dummy varibales that for every observation are defined in the following way:
- they are both zero if there is no obervation in dataset B that lies within 50km spatial distance from the observation in dataset A
- dummy_1 is 1 if there is an observation in dataset B that lies within 50km spatial distance from the observation in dataset A and variable_1 for the obs. in dataset B is "up"
- dummy_2 is 1 if there is an observation in dataset B that lies within 50km spatial distance from the observation in dataset A and variable_1 for the obs. in dataset B is "down"
Variable_1 can have other values than up and down, but I guess I could modify the sample such as for up and down to be the only two possibilities.
Can anyone help me out on that? I'm a Stata beginnner, so please don't take too much knowledge for granted
Thank you a lot in advance.
Best regards,
Marco
I have two datasets in which for every observation there are two variables, lat and long, providing the geographic coordinates to that observation. Now, in dataset A, I want to create two dummy varibales that for every observation are defined in the following way:
- they are both zero if there is no obervation in dataset B that lies within 50km spatial distance from the observation in dataset A
- dummy_1 is 1 if there is an observation in dataset B that lies within 50km spatial distance from the observation in dataset A and variable_1 for the obs. in dataset B is "up"
- dummy_2 is 1 if there is an observation in dataset B that lies within 50km spatial distance from the observation in dataset A and variable_1 for the obs. in dataset B is "down"
Variable_1 can have other values than up and down, but I guess I could modify the sample such as for up and down to be the only two possibilities.
Can anyone help me out on that? I'm a Stata beginnner, so please don't take too much knowledge for granted
Thank you a lot in advance.
Best regards,
Marco
Comment