x cd /pub/data/acs/Tools; %let pgm=applications_hcostburdenedover65; filename pgm "&pgm..sas"; *---Pull data on housing cost burdened households with head 65+ per request from Tracy G-R 2/2015. Aggregates data to partnership areas for kidscnt. ---; libname btabs "/pub/data/acs2013/btabs5yr"; libname temp "/pub/data/temp"; libname user "/SAS_temp/user"; proc format; *---We relate counties to Kids Count Partnership areas---; value copartner 510, 189,183,219,113="ARCHS" 95, 47, 37, 165, 177, 185, 83, 101, 107, 117 ="LINC" 21, 3, 5, 25, 49, 61, 63, 75, 87, 147, 227, 81="St. Joseph" 161, 55, 65, 125, 169, 51, 151, 29, 73, 131, 105="Rolla" 77,9,11,43,57,59,67,91,109,119,149,153,167,203,209,213,215,225,229,97,145,85="Springfield" other=' ' ; run; /*<=========================Comment out===================================== data costburdened; set btabs.mostcnty25_27(keep=sumlev county esriid b25072i: b25093i: ); where sumlev='050'; *--"CB" in variable name means "Cost Burdened"--; Over65OwnerHHs= B25093i23; Over65OwnerCBhhs=B25093i27 + B25093i28; Over65RenterHHs= B25072i23; Over65RenterCBhhs= B25072i27 + B25072i28; Over65HHs= Over65OwnerHHs + Over65RenterHHs; Over65CBhhs= Over65OwnerCBhhs + Over65RenterCBhhs; PctOver65OwnerCB=100*Over65OwnerCBhhs/Over65OwnerHHs; PctOver65RenterCB=100*Over65RenterCBhhs/Over65RenterHHs; PctOver65CB=100*Over65CBhhs/Over65HHs; format PctOver: 5.1; run; ===========================End commented out================================ */ data aggin; length partnership $32; retain Years "2009-2013"; set costburdened (drop=b25:) ; fipco=county; length _cnty 8; _cnty = substr(fipco,3,3); partnership=put(_cnty,copartner.); if partnership ne ' '; output; if fipco='29025' then do; partnership="LINC"; output; *--Caldwell is in 2 of them-; end; drop _: ; run; proc sort; by partnership county; run; %agg(aggin=aggin,aggout=temp.&pgm, aggby=partnership county, aggvars= Over65OwnerHHs Over65OwnerCBhhs Over65RenterHHs Over65RenterCBhhs Over65HHs Over65CBhhs PctOver65OwnerCB PctOver65RenterCB PctOver65CB, naggvars=9, idvars=years, means=pctOver65OwnerCB PctOver65RenterCB pctOver65CB, meanwts=Over65OwnerHHS Over65REnterHHs Over65HHs, agglvl=2, debug=0); run; ods html file="&pgm..html" style=meadow ; ods listing close; title "Cost Burdened Households With Head Age 65+"; title2 "Missouri Partnerships Areas as of Feb 2015"; footnote h=.7 "From setup in acs/Tools/&pgm..sas - Run on &sysdate at &systime"; proc print data=temp.&pgm N label; by years partnership; id county; label Over65OwnerHHs="Owner HHs Head 65+" Over65OwnerCBhhs="Cost Burdened Owner HHs 65+" Over65RenterHHs= "Renter HHs Head 65+" Over65RenterCBhhs= "Cost Burdened Rental HHs 65+" Over65HHs= "Total HHs 65+" Over65CBhhs= "Total Cost Burdened HHs Head 65+" PctOver65OwnerCB="% Owner HHs 65+ Cost Burdened" PctOver65RenterCB="% Renter HHs 65+ Cost Burdened" PctOver65CB="% Total HHs 65+ Cost Burdened"; var over65hhs over65CBHHs PctOver65CB over65Ownerhhs over65ownerCBHHs PctOver65ownerCB over65Renterhhs over65RenterCBHHs PctOver65RenterCB ; run; %include sascode (notify);