x cd /pub/data/acspums/Tools; %let pgm=uninsured_povertyratio; filename pgm "&pgm..sas" ; *---See if we can get an estimate of the Missouri pop is specified povert-ratio categories and insured/uninsured. We use the 2009-2011 3 year Mo pums datasets. Instigated pere request from Becky Veit at dss.mo.gov who asked for: .. looking for the number of uninsured children in the state and how many of them are under 300% of poverty vs. over 300% poverty. ----; libname user '/SAS_temp/user'; libname acspums '/pub/data/acspums'; ods html file="&pgm..html"; /* ========================begin comment==================================== ==========================end comment====================================== */ data kids; set acspums.moprecs113yr(keep=pwgtp povpip agep hins1-hins7) end=last; where agep <= 18 ; array hins hins1-hins7; Insured='No '; do _i=1 to dim(hins); if hins{_i}='1' then do; insured='Yes'; goto afterloop; end; end; afterloop: if povpip=. then do; IncCat='5: Not Determined'; output; delete; end; ***else if povpip <= 300 then IncCat="1: <= 300%"; ***else if povpip <=400 then IncCat='2: 200-300%'; else IncCat="3: > 400%"; *---lets try a new approach where we generate multiple observations so we can get counts for overlapping intervals-; if povpip <=250 then do; inccat='1: <=250%'; output; end; if povpip <=300 then do; inccat='2: <=300%'; output; end; if povpip <=400 then do; inccat='3: <=400%'; output; end; if povpip > 400 then do; inccat='4: > 400%'; output; end; label Inccat="Poverty Ratio Interval"; run; title "Missouri Children (Under 19) by Poverty Ratio and Insured Status"; title2 "Estimated from ACS PUMS Data for Surveys Taken in 2009-2011"; options nodate; footnote h=1 "Report Generated by the Missouri Census Data Center on &sysdate at &systime"; proc freq data=kids; weight pwgtp; table Inccat * Insured; run; ods html close;