x cd /pub/data/acs/Tools; %let pgm=app_hcostburdenedover65NWMO; filename pgm "&pgm..sas"; *---Pull data on housing cost burdened households with head 65+ per request from Tracy G-R 4/2015. Aggregates data to Community Foundation of NWMO counties. Same as setup with sim name for kidscnt partnerships. ---; 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---; *---Not really, not for this run. Instead we have the counties that make up the NWMO foundation---; value copartner 5, 147, 227, 81, 129, 171, 87, 3, 75, 61, 79, 211, 21, 63, 25, 117, 115, 49 = "Community Foundation of NWMO" other=' ' ; run; 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; 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; 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 "Community Foundation of NWMO"; 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);