I have a data set on India (India.dta) that includes location names at various levels, e.g. state, county, village. I want to map the data onto a state-level map of India but am running into problems when I try and map it. This is the code I have used so far:
- Download map function -
ssc install spmap
ssc install shp2dta
ssc install mif2dta
- Dowload Map of India-
Unzip file
Will be using .dbf and .shp file
-Go to Stata Command-
shp2dta using indiastates.shp, database(indiastatesdb) coordinates(indiastatescoord) genid(ID) gencentroids(india) replace
- Open indiastatesdb.dta-
merge 1:m ID using India.dta
Then when I try and run the map function:
spmap using indiastatescoord.dta, id(ID)
or
spmap Total using "indiastatescoord.dta", id(ID)
The following error comes up: r(459); Variable ID specified in option id() does not uniquely identify the observations
Does anyone know how to solve this? Would be so greatly appreciated!!!
Thank you (:
- Download map function -
ssc install spmap
ssc install shp2dta
ssc install mif2dta
- Dowload Map of India-
Unzip file
Will be using .dbf and .shp file
-Go to Stata Command-
shp2dta using indiastates.shp, database(indiastatesdb) coordinates(indiastatescoord) genid(ID) gencentroids(india) replace
- Open indiastatesdb.dta-
merge 1:m ID using India.dta
Then when I try and run the map function:
spmap using indiastatescoord.dta, id(ID)
or
spmap Total using "indiastatescoord.dta", id(ID)
The following error comes up: r(459); Variable ID specified in option id() does not uniquely identify the observations
Does anyone know how to solve this? Would be so greatly appreciated!!!
Thank you (:
Comment