Hi all,
I am working with monthly rainfall data over years 1993-2010, for seven district. Each district have certain number of grids with information on longitude and latitude, monthly rainfall, area in sqkm. My problem concerns when creating district variable; whenever two districts share the same values for longitude and latitude, only information for one of the two districts is kept with my current coding.
Ex.
gen district = .
/*district 1 */
replace district =1 if a==77.25 & b==17.25
replace district =1 if a==77.25 & b==17.50
replace district =1 if a==77.25 & b==17.75
/*district 2*/
replace district=2 if a==77.25 & b==17.25
replace district=2 if a==77.25 & b==17.50
replace district=2 if a==77.50& b==17.25
Evidently for district 1, only one case will be kept because the first two cases will be overwritten by the "replace" command in district 2. How can I keep all information for each district despite the overlap.
Thanks !
I am working with monthly rainfall data over years 1993-2010, for seven district. Each district have certain number of grids with information on longitude and latitude, monthly rainfall, area in sqkm. My problem concerns when creating district variable; whenever two districts share the same values for longitude and latitude, only information for one of the two districts is kept with my current coding.
Ex.
gen district = .
/*district 1 */
replace district =1 if a==77.25 & b==17.25
replace district =1 if a==77.25 & b==17.50
replace district =1 if a==77.25 & b==17.75
/*district 2*/
replace district=2 if a==77.25 & b==17.25
replace district=2 if a==77.25 & b==17.50
replace district=2 if a==77.50& b==17.25
Evidently for district 1, only one case will be kept because the first two cases will be overwritten by the "replace" command in district 2. How can I keep all information for each district despite the overlap.
Thanks !