*Mapping Step 1 cd /Volumes/jng2/www/workshop/mapping *change the above path to your own set more off clear all *convert shapefile to *.dta files shp2dta using shapefile/regions.shp, /// database(usdb.dta) coordinates(uscoord.dta) /// gencentroids(coord) genid(id) replace *generate label positions use uscoord, clear drop if _X==. | _Y==. bys _ID: egen xcoord = mean(_X) bys _ID: egen ycoord = mean(_Y) replace ycoord = ycoord-1 if _ID==1 replace xcoord = xcoord-2 if _ID==3 replace xcoord = xcoord-1 if _ID==7 replace ycoord = ycoord-1 if _ID==7 replace xcoord = xcoord-4 if _ID==8 replace xcoord = xcoord-4 if _ID==9 replace xcoord = -121 if _ID==6 replace ycoord = 44 if _ID==6 collapse (first) xcoord ycoord, by(_ID) gen subreg_id = _ID save uslabelcoord, replace