x cd /pub/data/pums2000/Tools; %let pgm=interracial_couples; filename pgm "&pgm..sas"; /* ------------------------------------------------------------------------ Program: interracial_couples Description: Client wanted a count of interracial couples living in St. Louis county and city of St. Louis. Couples were defined as married or unmarried partner. Interracial was defined as different single race or either being multi-racial. Lori Siegel at Washington U was contact person. ------------------------------------------------------------------------ */ libname pums2000 "/pub/data/pums2000"; libname user "/SAS_temp/user"; proc format; value $race 1 = 'White alone' 2 = 'Black or African American alone' 3 = 'American Indian alone and Alaska Native' 6 = 'Asian alone' 7 = 'Native Hawaiian and Other Pacific Islander alone' 8 = 'Some other race alone' 9 = 'Two or more major race groups'; run; /* =======================Begin comment================ data couples; set pums2000.moprecs5 (keep=puma5 pweight race1 relate ); where puma5=:'017' or puma5=:'018'; retain racehead ' ' weighthead; if relate='01' then do; racehead=race1; *--we need to remember the race of the head of household ---; weighthead=pweight; end; if relate in ('02','19'); *---we have a spouse or an unmarried partner. This means a "couple"--; if racehead='9' or race1='9' or (racehead ne race1) then interracial=1; else interracial=0; if puma5=:'017' then Area='St. Louis County'; else Area='St. Louis City '; output; run; ======================End comment================== */ title "&pgm: Estimate Number of Interracial Couples in St. Louis City and County"; title2 "Source: 2000 Decennial Census, Missouri PUMS File"; title3 "Programming by the Missouri Census Data Center"; footnote "Setup in pums2000/Tools/&pgm..sas"; ods html file ="&pgm..html"; proc tabulate data=couples; class Area ; *freq pweight; freq weighthead; *---for some reason we prefer to use the person weight for the household head---; var interracial; table area all='Combined', interracial*(sum="# Interracial Couples" mean="% of All Couples"*f=percent7.1); run; ods html close;