Skip to main content

Posts

Showing posts from January, 2017

PROC GMAP Example: Voter Turnout

IPUMS-CPS  collects the voter turnout information for each quadrennial presidential election and mid-term election. I used respondents' feedback for the question whether he/she voted in the 2008 presidential election, and their residence information, to visualize the state turnout rates for 2008 election. Before the data visualization by PROC GMAP, I should firstly input the data and compute the turnout rates by state. DATA step and PROC MEANS were used as follows: %let path=...;  libname mylab "&path" ; filename ASCIIDAT "&path/cps.dat" ; data mylab.cps; infile ASCIIDAT pad missover lrecl = 14 ; input   STATEFIP     1-2   WTSUPP       3-12 .4   VOTEREG     13-14 ; run ; data vote08 ( rename = (STATEFIP = state)); set   mylab .cps; if VOTEREG = 99 then delete;   else if VOTEREG = 2 then vote_indicator = 1 ;   else vote_indicator = 0 ; run ; proc sort data = vote08; by state; proc means