*Mapping Step 2 *produce thematic map of unhappiness by Census Division cd /Volumes/jng2/www/workshop/mapping *change the above path to your own set more off clear all use GSS2012_divisions, clear gen unhappy = . replace unhappy = 1 if happy==3 replace unhappy = 0 if happy==1 | happy==2 collapse (mean) unhappy [aw=wtss], by(subreg_id) merge 1:1 subreg_id using usdb.dta drop _merge merge 1:1 subreg_id using uslabelcoord.dta drop _merge *spmap produces teh map spmap unhappy using uscoord.dta, id(subreg_id) /// clmethod(custom) clbreaks(0.09 0.11 0.13 0.15 0.17) /// label(label(subreg_id) xcoord(xcoord) ycoord(ycoord)) /// fcolor(Reds) legtitle("Fraction of respondents who were unhappy") /// title("Figure 3: Unhappiness by Census Division, 2012") graph save unhappymap, replace graph export unhappymap.png, replace