x cd /pub/data/acs2007/Tools; %let pgm=agg_cpr_hlspts; filename pgm "&pgm..sas"; *---Aggregate both 2000 census (sf32kacs) and 2007 vintage 3yr data to get "HLSPT"=High Level Suppressed Portion Totals . This is data that summarizes the areas that have no ACS data for the period and which we shall be using when we apply the CPR (county-PUMA ratio) methodology. Instead of looking at ratios of county and PUMA we shall look at ratios of counties and the portion of the PUMA which has no data. We believe this should provide significantly improved guesstimates. We also "apply CPR" in this job to get our estimated 3-yr period estimates for Missouri small counties. <======= jgb, July, 2009 Rerunning 11-4-09 to fix problem with enrolled-in-school-level variables after finding a bug in universe variable specified. Rerunning 12-9-09 to fix problem with othercommute variable after finding a bug in the sf32kacs variable. See https://mcdc.missouri.edu/pub/data/acs/cprmethod.html for a detailed description of this program. ----*; %include "cprmacros.sas"; *<--View the code at https://mcdc.missouri.edu/cgi-bin/browse?/pub/data/acs2007/Tools/cprmacros.sas@ --; %let year=2007; %let yr=%substr(&year,3,2); %let yearm1=%eval(&year-1); %let yearm2=%eval(&year-2); %let yrm1=%substr(&yearm1,3,2); %let yrm2=%substr(&yearm2,3,2); %let myrsfx=&yrm2._&yr; *--multi-year suffix. It is 05_07 when year=2007---; %let debug=1; title "&pgm: Aggregate to Higher Level Suppressed Portion Totals"; title2 "Doing Estimates of Small Mo Counties Using &year 3yr Data With HLSPTs"; libname user "/pub/data/acs&year./temp"; libname temp (user); *----make temp an alias for user. We were running into conflicts with user directory from other yrs-; libname acs "/pub/data/acs&year"; libname cprdata "/pub/data/acs&year./cprdata"; libname sf32kacs "/pub/data/sf32kacs"; %let state=29; %let stab=mo; /* =======================Begin comment================ 1-time temporary fix (modify original invoke_dosets so will not need later) proc datasets library= acs; modify usmcdcprofiles3yr; rename RoomLow=PersonsPerRoomLow; rename PctRoomLow=PctPersonsPerRoomLow; quit; ======================End comment================== */ ***************Phase 0: Create some metadata in global variables**********************; *---Code here to create the input data source via merging of data from the sf32kacs directory (county and puma data), the latest 3-year period estimates for the PUMAs, and the 3-year pop estimates data created in the acspopests setup.--; proc contents data=acs.usmcdcprofiles3yr(keep=_numeric_) noprint out=profilevars(keep=name); run; proc contents data= temp.mocos2kests(keep=TotPop--huest) noprint out=estvars(keep=name); run; %global moevars _means _mweights _aggvars _estvars; *---Create alternate metadata set that has no references to the new insurance variables---; data acs.variablesNI(label='Edited to remove insurance-releated variable obs'); set acs.variables; where index(name,'Insur')=0 and name ne 'TotPopNonInst'; run; proc sql noprint; **select put(county,$5.) into :bigcos separated by ' ' from acs.allgeos where state="&state" and sumlev='050'; select name into :moevars separated by ' ' from profilevars where name contains 'MOE'; select name into :_means separated by ' ' from acs.variablesNI where wtvar ne ' ' and dup=0; select wtvar into :_mweights separated by ' ' from acs.variablesNI where wtvar ne ' ' and dup=0; select name into :_aggvars separated by ' ' from acs.variablesNI where dup=0 ; select name into :_estvars separated by ' ' from estvars; quit; %put _all_; %***put _estvars= &_estvars; *---These are the variables being obtained from the popests data sets, icnl the single-var huest--; %macro phase1; ****************Phase 1: Create county and PUMA level ACS data that will be combined to create the ACS HLSPT summaries.***********; **** 1.1 ****; *----1-time step to add 3 counties to the cnty-puma corr list file: 3 large counties that we did not use before. (But need for doing subtraction when creating hlspt data sets. We have special code to get around this below but want to make that redundant code unnecessary in the future. --; data new3; set sf32kacs.sf3&stab.counties(keep=county totpop); select (county); *<====CUSTOM CODE HERE!!! Specify large counties (65k+) that are entirely within a PUMA and not = a PUMA-; when('29021') puma5='00200'; when('29031') puma5='02000'; when('29051') puma5='00500'; otherwise delete; end; fipco=county; pop2k=totpop; size='l'; drop totpop; run cancel; *<====; data cprdata.mocnty_puma&yr(label="Correlation list: Mo county to PUMA &year w 3 large cos added"); set cprdata.mocnty_puma&yr._bkup new3; by county; run cancel; *<=====; **** 1.2 ****; *---create intermediata data sets with PUMA and County level summaries for the state and year/period with MOE vars removed--; data &stab.cntys (drop=puma5) &stab.pumas (drop=county); set acs.usmcdcprofiles3yr(where=(sumlev in ('050','795') and state='29') drop=&moevars ); length puma5 $5; if sumlev='795' then puma5=substr(geoid,10,5); if sumlev='050' then output &stab.cntys; else output &stab.pumas; keep sumlev county areaname puma5 datecreated _numeric_; run; data &stab.cntys2; merge &stab.cntys(in=inacsdata) cprdata.mocnty_puma&yr (in=ingeo); by county; if inacsdata; if ingeo; run; proc sort; by puma5; run; data agginacs; set &stab.pumas &stab.cntys2; by puma5; if sumlev='795' then wt=1; else if sumlev='050' then wt=-1; else abort abend; run; %mend phase1; %macro phase2; ***************************Phase 2: Aggregate the data created in Phase 1. Use our %agg utility ***************************; *** 2.1 ****; %agg(aggin=agginacs,aggout=acs.&stab.hlspt_acs, aggvars=&_aggvars, means=&_means, mweights=&_mweights, idvars=datecreated, dropvars=_lvl_ wt, aggby=puma5, facvar=wt) run; data hlspt1; set acs.&stab.hlspt_acs(obs=1); run; proc fsbrowse printall data=hlspt1; title3 "First Obs on the &stab.hlspt_acs data set"; run; title3 ; %mend phase2; options mprint; %phase1 %phase2 ************************Phase 3: Comparable to Phase 1, but now working with 2k census data for the same geographic areas****************; *------New steps to create the corresponding "HLSPT" summaries from the 2k census data. We attempt to replicate any missing data so that if a variable for a county is missing on the acs 3yr data then we force it to be missing on the 2k data set as well. This is a little messy, to say the least.------; *** 3.1 ***; data temp.cnty2kwpuma; merge sf32kacs.sf3&stab.counties cprdata.&stab.cnty_puma&yr (in=ingeo); by county; if sumlev='050'; if ingeo; %macro dum; %*--This code is no longer needed since we added the 3 larger counties to the equivalency data set in step 1.1---; if not ingeo then do; size='l'; *--thats the letter "l", for "large" as opposed to 'm' or 's'.--; select (county); *<====CUSTOM CODE HERE!!! Specify large counties (65k+) that are entirely within a PUMA and not = a PUMA-; when('29021') puma5='00200'; when('29031') puma5='02000'; when('29051') puma5='00500'; otherwise delete; end; end; %mend dum; run; proc sort; by puma5 county; run; data temp.aggin_pre2k; set sf32kacs.sf3&stab.pumas temp.cnty2kwpuma; by puma5; *---interleave----; drop esriid areaname counties places logrecno intPt: stab geocode pop2k fipco; drop PctOver15--PctMoveInBefore1969; *----a whole bunch of variables that are not on the sf32kacs data sets--; run; *** 3.2 ***; %genrenam(user.agginacs,xvars=sumlev puma5 county wt areaname logrecno dateCreated fipco size,sfx=_acs) data aggin2k ; merge temp.aggin_pre2k (in=in2k) user.agginacs ( &rename in=inacs); by puma5 county; if inacs; *--we only keep data for the relevant pumas and counties---; if not in2k then do; put '**** ' puma5= county= " ****Not matched on 2k data set***** aborting run.... " ; abort abend; end; if sumlev='050' then do; *---here is where we check for missing values in the acs data set and make the corresponding variable missing for 2k data--; %macro recode_missing; %global _aggvars; %let naggvars=%lenlst(&_aggvars); %do i=1 %to &naggvars; %let var=%scan(&_aggvars,&i); if &var._acs=. or &var._acs=.N then &var=.A; %end; drop %do i=1 %to &naggvars; %let var=%scan(&_aggvars,&i); &var._acs %str( ) %end; ; %mend recode_missing; options mprint; *<========================================================================; %recode_missing end; run; ********************************Phase 4: Aggregate the 2k census data to get that HLSPT data set**********************************; options NOmprint; *** 4.1 ***; %agg(aggin=aggin2k,aggout=sf32kacs.&stab.hlspt_2k, aggvars=&_aggvars, means=&_means, mweights=&_mweights, dropvars=_lvl_ wt, aggby=puma5, facvar=wt) run; data hlspt2; set sf32kacs.&stab.hlspt_2k(obs=1); run; proc fsbrowse printall data=hlspt2; title3 "First Obs on the &stab.hlspt_2k data set"; run; title3 ; *************************Phase 5: Prepare the various data sets to be used in the CPR step. Lots of variable renaming here**************; *** 5.1 ***; *---Use utility macro to generate the rename code to be used in subsequent data step to append a sfx to all numeric vars-; %genrenam(sf32kacs.sf3&stab.counties,xvars=state county sumlev,sfx=_c2x) data cnty2k; merge sf32kacs.sf3&stab.counties ( &rename where=(state="&state" and sumlev="050") ) cprdata.&stab.cnty_puma&yr (in=ingeos); by county; if size='s' ; *** or size='m'; *---we cannot keep the m size cos & estimate their data for checking purposes with this hlspt--; run; data temp.&stab.cos2kests(label="2k census county data with _c2x varname suffixes + &yr 3yr estimates" ); merge cnty2k(in=in2kdata) cprdata.&stab.estimates3yr(in=inests) cprdata.&stab.cnty_puma&yr(in=inclist); by county; if in2kdata; if not (in2kdata and inests and inclist) then do; put / '*****ERROR: county not matched on county-puma equivalency dataset or on estimates dataset ***** ' / _all_; abort abend; end; run; proc sort; by puma5 county; run; %***content(temp.&stab.cos2kests); *** 5.2 ***; %genrenam(sf32kacs.&stab.hlspt_2k,xvars=state puma5,sfx=_p2x) *---Save the rename global just generated so we can use it in Step 5.3, below---; %let rename_p2x=&rename; %genrenam(acs.&stab.hlspt_acs,xvars=sumlev state puma5 ,sfx=_pacs) %let rename_pacs=&rename ; *** 5.3 ***; data temp.pumastemp; merge sf32kacs.&stab.hlspt_2k (in=inpuma2k &rename_p2x) acs.&stab.hlspt_acs (in=inpumaacs &rename_pacs) temp.&stab.cos2kests(in=incos); by puma5; if incos; *---We may have data for some pumas that are not needed---; if not (inpuma2k and inpumaacs and incos) then do; put '****match not working in test step****' +2 inpuma2k= inpumaacs= incos= puma5= county=; abort abend; end; else output; run; options mprint NOmlogic; *******************************Phase 6: Apply the CPR method **************************************; *** 6.1 ***; *------------------------------Data Step to "apply CPR" method to estimate data for counties for the 3yr period---------; data cprdata.SmallCounties(label='3yr estimates for all MO small counties allocated using CPR method with HLSPT'); length county $5; if 0 then set acs.usmcdcprofiles3yr(drop=&moevars); *---add more drop vars here to get rid of what we do not want. Allows us to to a double-dash keep to specify what gets kept on output. It is all we specify here.---; set temp.pumastemp; Areaname=areaname_c2x; SumLev='050'; geocode=county; geoid='05000US'||county; Period='3cp'; *--3yr, cpr method estimated--; if &debug then put / areaname=; *-------------------------------Demographic-----------------------------------; *---We have a bunch of estimates variables that are being loaded but they are counts without pcts. In this section we calculate all those missing Pct variables. Have to be careful, using double-dash lists here.--; array estspcts(*) age0_4--PctOver85 Over5--PctNonHispHawnPI; _nestspcts=dim(estspcts); _icnt=1; _ipct=2; do _i=1 to _nestspcts by 2; *--The array alternates between counts in the odd cells and Pct vars in the even cells. All pcts use Totpop as the denom.--; estspcts(_ipct)=100*estspcts(_icnt)/totpop; _icnt+2; _ipct+2; end; drop _: ; * ------------------------------end estimates pctVar calculations------------------; *-------------------------------Economic--------------------------------------; TotHUs=huest; %applycpr(PctOccHUs,acsvar=PctOccHUs); TotHHs=round(TotHUs*.01*PctOccHUs); OccHUs=TotHHs; %dodist(hhinc, 0 10 15 25 35 50 75 100 150 200, TotHHs) %applycpr(MedianHHInc) %applycpr(AvgHHInc) %applycpr(NumHHEarnings,PctOf=TotHHs) %applycpr(AvgHHEarnings) %applycpr(NumHHSocSec,PctOf=TotHHs) %applycpr(AvgHHSocSec) %applycpr(NumHHRetInc,PctOf=TotHHs) %applycpr(AvgHHRetInc) %applycpr(NumHHSuppSecInc,PctOf=TotHHs) %applycpr(AvgHHSuppSecInc) %applycpr(NumHHPubAssist,PctOf=TotHHs) %applycpr(AvgHHPubAssist) if PctFamHHs_p2x=. then do; PctFamHHs_c2x=100*FamHHs_c2x/TotHHs_c2x; PctFamHHs_p2x=100*FamHHs_p2x/TotHHs_p2x; PctFamHHs_pacs=100*FamHHs_pacs/TotHHs_pacs; end; %acprpct(FamHHs,TotHHs) %dodist(FamHHInc,0 10 15 25 35 50 75 100 150 200,FamHHs) %applycpr(MedianFamInc) %applycpr(AvgFamInc) %applycpr(PCI) NonFamHHs=TotHHs - FamHHs; PctNonFamHHs=100*NonFamHHs/TotHHs; %apcprlst(MedianNonFamInc AvgNonFamInc MedianEarnings MedianEarningsFemale MedianEarningsMale) %applycpr(PctPovUniverse) PovUniverse=round(PctPovUniverse*.01*TotPop); ***PctPovUniverse=100*PovUniverse/TotPop; *--Poverty universes for 3 age cohorts are estimated by assuming the pu as a pctage of total pop in the cohort is fixed--; PovUniverseUnder18= round( (PovUniverseUnder18_c2x/Under18_c2x)*Under18 ); _age18_64_c2x=Totpop_c2x - Under18_c2x - Over65_c2x; _Age18_64=Totpop - Under18 - Over65; PovUniverse18_64= round( (PovUniverse18_64_c2x/_Age18_64_c2x)*_Age18_64 ); PovUniverseOver65= round( (PovUniverseOver65_c2x/Over65_c2x)*Over65 ); *---edit this drop list to always start with the next variable not yet estimated--; %applycpr(PctPoor) Poor=round( PovUniverse*.01*PctPoor ); %applycpr(PctPoorUnder18) PoorUnder18=round( PctPoorUnder18*.01*PovUniverseUnder18 ); %applycpr(PctPoor18to64) Poor18to64=round( PctPoor18to64*.01*PovUniverse18_64); %applycpr(PctPoorOver65) PoorOver65=round( PctPoorOver65*.01*PovUniverseOver65); %acprpct(FamilyPop,TotPop) %acprpct(PoorInFamily,FamilyPop) %acprpct(PovUniverseUnrelated,TotPop) %acprpct(PoorUnrelated,PovUniverseUnrelated) %***dodist(PovRatio,UnderHalf v5tov75 v75to1 1to2) ;*** rest not available in 2k census... 2to3 Over3,PovUniverse); *--NOT full dist; %acprpct(PovRatioUnderHalf,PovUniverse) %acprpct(PovRatiov5tov75,PovUniverse) %acprpct(PovRatiov75to1,PovUniverse) %acprpct(PovRatio1to2,PovUniverse) PovRatioOver2=0; PovRatioOver2=PovUniverse - sum(of PovRatioUnderHalf PovRatiov5tov75 PovRatiov75to1 PovRatio1to2); MeanPovRatio= (PovRatioUnderHalf*0.25 + PovRatiov5tov75*0.675 + PovRatiov75to1*0.875 + PovRatio1to2*1.5 + PovRatioOver2*3.0) / PovUniverse; %acprpct(LaborForce,Over16); ***LaborForce=PctLaborForce*.01*Over16; %acprPct(CivLabForce,Over16) ***CivLabForce=PctCivLabForce*.01*Over16; %acprPct(EmployedCLF,CivLabForce) UnemployedCLF=CivLabForce-EmployedCLF; PctUnemployedCLF=100*UnemployedCLF/CivLabForce; %acprPct(Military,Over16) NOTinLF=Over16 - Military - CivLabForce; PctNOTinLF=100*NOTinLF/Over16; %acprPct(Over16Females,Over16); %acprPct(LaborForceFemales,Over16Females) %acprPct(CivLabForceFemales,Over16Females) %acprPct(EmployedFemales,CivLabForceFemales) %applycpr(OwnKidsUnder6) %applycpr(OwnKidsOver6) %acprPct(OwnKidsO6AllPrntsWk,OwnKidsOver6) %acprPct(OwnKidsU6AllPrntsWk,OwnKidsUnder6) %applycpr(Worker16) %acprPct(Commuters,Worker16) %acprPct(DriveAlone,Worker16) %acprPct(Carpool,Worker16) %acprPct(PublicTrans,Worker16) %acprPct(WalktoWork,Worker16) %acprPct(OtherCommute,Worker16) %acprPct(WorkAtHome,Worker16) %applycpr(AvgCommute) %acprPct(ManProfOccs,EmployedCLF) %acprPct(ServiceOccs,EmployedCLF) %acprPct(SalesOffOccs,EmployedCLF) %acprPct(FarmFishOccs,EmployedCLF) %acprPct(ConsOccs,EmployedCLF) %acprPct(TransOccs,EmployedCLF) %acprPct(Agriculture,EmployedCLF) %acprPct(Construction,EmployedCLF) %acprPct(Manufacturing,EmployedCLF) %acprPct(WholesaleTrade,EmployedCLF) %acprPct(RetailTrade,EmployedCLF) %acprPct(Transportation,EmployedCLF) %acprPct(Information,EmployedCLF) %acprPct(Finance_Ins,EmployedCLF) %acprPct(Professional,EmployedCLF) %acprPct(Educ_Health_SocSvcs,EmployedCLF) %acprPct(RecreationEtc,EmployedCLF) %acprPct(OtherIndustries,EmployedCLF) %acprPct(PublicAdmin,EmployedCLF) %acprPct(PrivWageWorkers ,EmployedCLF) %acprPct(GovWorkers ,EmployedCLF) %acprPct(SelfEmpWorkers ,EmployedCLF) %acprPct(UnpaidFamWorkers ,EmployedCLF) *-------------------------------Social----------------------------------------; Families=FamHHs; PctFamilies=PctFamHHs; %acprPct(FamsWithKids, TotHHs) %acprPct(MarriedCouples, TotHHs) %acprPct(CouplesWithKids, TotHHs) %acprPct(SingleMaleFamilies, TotHHs) %acprPct(SingleFathers, TotHHs) %acprPct(SingleFemaleFamilies, TotHHs) %acprPct(SingleMothers, TotHHs) %acprPct(NonFamHHs, TotHHs) %acprPct(LivingAlone, TotHHs) %acprPct(Over65Alone, TotHHs) %acprPct(FamsWithKids, TotHHs) %acprPct(HHsWithKids, TotHHs) %applycpr(AvgHHSize,round=%str(.1)) %applycpr(AvgFamSize,round=%str(.1)) %acprPct(HHpop,Totpop) %acprPct(FamHHPop,Totpop) NonFamHHPop=Totpop - FamHHPop; PctNonFamHHpop=100*FamHHPop/Totpop; %acprPct(GrpQuarters,TotPop) Householder=TotHHs; PctHouseholder=100*Householder/TotPop; %acprPct(Spouse, HHpop) %acprPct(Child, HHpop) %acprPct(OtherRelative, HHpop) %acprPct(NonRelative,HHpop) %acprPct(UnmarriedPartner, HHpop) UMPartnerHHsPerK=1000*UnmarriedPartner/TotHHs; %acprPct(NeverMarried,Over15) %acprPct(Married,Over15) %acprPct(Separated,Over15) %acprPct(Widowed,Over15) %acprPct(Divorced,Over15) %*<===Temp extra code to do what we should have done in the orginal data set creations to calculate the PctOver3 variables-; PctOver3_pacs=100*Over3_pacs/totpop_pacs; PctOver3_p2x=100*Over3_p2x/totpop_p2x; %acprPct(Over3,Totpop) %acprPct(EnrolledOver3,Over3) *---------------------Fixed the following 5 lines 11-4-09: replacing Over3 with EnrolledOver3 as universe var---; %acprPct(InNursery,EnrolledOver3) %acprPct(InKindergarten,EnrolledOver3) %acprPct(InElementary,EnrolledOver3) %acprPct(InHighSchool,EnrolledOver3) %*<====temporary fix here===; PctInCollege_p2x=100*InCollege_p2x/EnrolledOver3_p2x; PctInCollege_c2x=100*InCollege_c2x/EnrolledOver3_c2x; PctInCollege_pacs=100*InCollege_pacs/EnrolledOver3_pacs; %acprPct(InCollege,EnrolledOver3) *** PctBachelorsormore_c2x=100*bachelorsormore_c2x/over25_c2x; *<====will this work?===; %acprPct(LessThan9th, Over25) %acprPct(SomeHighSchool, Over25) %acprPct(HighSchool, Over25) %acprPct(SomeCollege, Over25) %acprPct(Associates, Over25) %acprPct(Bachelors, Over25) %acprPct(Bachelorsormore, Over25) %acprPct(GradProf, Over25) %acprPct(HighSchoolOrMore,Over25) %acprPct(ArmedForces, Over18) %acprPct(Civilian, Over18) %acprPct(Veteran, Over18) %applycpr(disabledUniv5) %acprPct(Disabled, DisabledUniv5) %applycpr(DisabledUniv5_15) %acprPct(Disabled5_15, DisabledUniv5_15) %applycpr(DisabledUniv65) %acprPct(DisabledElder, DisabledUniv65) %applycpr(DisabledUniv16_64) %acprPct(Disabled16_64, DisabledUniv16_64) %acprPct(UsNative, Totpop) %acprPct(BornInUS,Totpop) %acprPct(BornInCurrState, Totpop) %acprPct(BornInDiffState, Totpop) %acprPct(ForeignBorn, Totpop) %acprPct(Naturalized, Totpop) %acprPct(NonCitizen, Totpop) %acprPct(BornInDiffState, Totpop) %acprPct(FBMinusSea, Totpop) %acprPct(FBEurope, FBMinusSea) %acprPct(FBAfrica, FBMinusSea) %acprPct(FBOceania, FBMinusSea) %acprPct(FBLatinAmerica, FBMinusSea) %acprPct(FBEurope, FBMinusSea) %acprPct(FBNorthAmerica, FBMinusSea) %acprPct(EnglishOnly, Over5) %acprPct(OthLang, Over5) %acprPct(OthLangEnglishLTD, Over5) %acprPct(Spanish, Over5) %acprPct(SpanishEnglishLTD, Over5) *---------------------Housing-----------------------------*; %acprPct(OwnerOcc, TotHUs) %acprPct(RenterOcc, TotHUs) %acprPct(PersonsInOwnerUnits,TotPop) %acprPct(PersonsInRenterUnits,TotPop) %applycpr(AvgOwnerHHSize) %applycpr(AvgRenterHHSize) %acprPct(VacHUs,TotHUs) %acprPct(VacantForSale,vachus) %acprPct(VacantForRent,vachus) %acprPct(VacantSeasonal,vachus) TotalOwnerUnits=RenterOcc+VacantForRent; OwnerVacRate=100*VacantForSale/TotalOwnerUnits; TotalRentalUnits=RenterOcc+VacantForRent; RenterVacRate=100*VacantForRent/TotalOwnerUnits; %alias(MobileHomes,UnitsMH) %alias(BoatRV,UnitsRV) %dodist(units,1Detached 1Attached 2 3_4 5_9 10_19 20up MH RV, TotHUs) Units1=Units1Attached + Units1Detached; PctUnits1=100*Units1/TotHUs; MobileHomes=UnitsMH; PctMobileHomes=PctUnitsMH; *---will this work??---; BoatRV=UnitsRV; PctBoatRV=PctUnitsRV; *---will this work??---; drop unitsmh unitsrv pctunitsmh pctunitsrv; MobilehomesPerK=1000*MobileHomes/TotHUs; %alias(NoVehicles,Vehicles0) %dodist(Vehicles,0 1 2 GE3,OccHus) NoVehicles=vehicles0; PctNoVehicles=PctVehicles0; drop vehicles0 pctvehicles0; %dodist(HHF,UtilGas LPGas Electric Kerosene Coal Wood Solar Other NoFuel,OccHUs) %acprPct(NoPlumbing,OccHUs) %acprPct(NoKitchen,OccHUs) %acprPct(NoPhone,OccHUs) %acprPct(PersonsPerRoomLow,OccHUs) %acprPct(PersonsPerRoomMedium,OccHUs) %acprPct(PersonsPerRoomHigh,OccHUs) %dodist(Hval,Under50 50 100 150 200 300 500 OverMillion,OwnerOcc) *<----Not exactly, we have "specified" units in 2k--; %applycpr(MedianHValue) %applycpr(AvgHValue) %acprPct(HUsMort,OwnerOcc) %acprPct(HUsMortOver30Pct,OwnerOcc) %applycpr(MedianOwnerCostsMort) %acprPct(HUsNoMort,OwnerOcc) %acprPct(HUsNoMortOver30Pct,OwnerOcc) %applycpr(MedianOwnerCostsNoMort) %acprPct(NOCashRenter,RenterOcc) %applycpr(MedianGrossRent) %applycpr(AvgGrossRent) %acprPct(CashRenterOver30Pct,RenterOcc) %acprPct(CashRenterOver750,RenterOcc) *---Here is where we drop all the variables that cannot (or perhaps just should not) be estimated using this technique---; drop other2 pctother2 fulltime: pctfulltime: GivingBirth: HHsWithElders: PctHHSWithElders: pctdisabledUniv: UnmarriedWomen15to50 -- PctGrandPrntsCaring5orMore NumHHFoodStmp PctNumHHFoodStmp SameHouse -- LivedAbroad PctLivedAbroad BornAbroad PctBornAbroad BornOutsideUS -- PctFBNorthAmerica Built2005orLater -- PctMovedInBefore1969; drop DateCreated -- Pop2k; *---these are all the variables we used to do the calcs with the various sfxs---; drop geocomp_name--PlaceFP sdelm--CBSAyr; drop povRatio2to3 pctPovRatio2to3 PovRatioOver3 PctPovRatioOver3; *---Not available in sf32k---; **** drop EnrolledOver3 PctEnrolledover3; *--just decided not to use--; run; **** 6.2 ***; options ls=160 ps=80 nodate; data atchison_pike; set &syslast; where county in ('29005','29163'); run; proc fsbrowse printall data=atchison_pike; title3 "Estimated data for Atchison & Pike Counties"; run; proc sort data=cprdata.smallcounties out=smallcounties; by county; run; data cprdata.allcounties3yr(label="All Missouri counties"); length fipco $5; set smallcounties acs.usmcdcprofiles3yr(where=(state='29' and sumlev='050')) ; by county; state='29'; drop geocomp_name geocomp--CashRenterOver750_moe; fipco=county; run;