/********************************************************/ /* Program: labelswgt2.sas */ /* Purpose: To add labels and formats to mcclure data */ /* Use With: after formats.sas */ /* Date: 4/24/2014 */ /* Last updated: 5/16/2014 */ /* User: Renae */ /********************************************************/ %let data1=final_clean_w_refused_wgt; %let data2=final_clean_w0_refused_wgt; %let data3=final_clean_w0_refused_dk_wgt; * This will prepare the data and formats. formats.sas needs to be run before this program or use the LIBNAME formlib and the OPTIONS FMTSEARCH=(formlib); options nodate; libname in 'S:\COS\STATS-SCC\Renae\archive\SSRU\mcclure'; *========================================================================================== the libname for the formats has to be run to find the formats (unless you just ran the formats.sas program in this session). If the format library is annoying, just omit the libname at the top of the format.sas program and the LIBRARY=formlib statement in PROC FORMAT (on formats.sas) and make sure the formats.sas program is run at the beginning of your session. if you choose not to save formats to a library, then the options fmtsearch=(formlib) can be omitted; ===========================================================================================; libname formlib 'S:\COS\STATS-SCC\Renae\archive\SSRU'; options fmtsearch=(formlib); data in.mc; set in.&data3; keep _DISTRICT Q1_IMPECON Q2_IDNEED Q3_PERNEED Q4_TENNEED Q5_COMMUTE Q6_AVGCOMM Q5_WORKDAY Q5_PER Q5_REC Q7_RATE_1 Q7_RATE_2 Q7_RATE_3 Q7_RATE_4 Q9B_ECONGROW Q9D_SAFE Q10A_RAISETAX Q10B_HURTECON Q10C_GOV Q10D_SPRAWL Q11_SOURCES_1 Q11_SOURCES_2 Q10E_GOVMISUSE Q11_SOURCES_3 Q11_SOURCES_4 Q11_SOURCES_5 Q8_FUND2 Q11_SOURCES_6 Q11_SOURCES_7 Q11_SOURCES_8 Q11_SOURCES_9 DEM_YEAR DEM_COUNTY DEM_ED DEM_INCOME DEM_LAND DEM_CELL DEM_ADULTS DEM_SEX IDCounty District HHType calltype Age1 AgeCat1 AgeCat2 AgeCat_W RU Dist3_state Dual_ind Q5_Commute_cat1 Q5_per_cat1 Q5_rec_cat1 commute_dist HH_income Ed_Attain BaseWeight_sam FinalWeight ; label Age1='Age' _district='District' Dist3_state='District 3 vs. rest of Districts' Dem_sex='Gender' Calltype='Call Type' HHType='Household Type' HH_Income='Household Income' Ed_attain='Education Attained' RU='County Type' Commute_dist='Commute Distance' Agecat1='Census Age Categories' Agecat2='Age Categories' Idcounty='County' Q1_ImpEcon='Importance of roads and bridges to Idaho''s economy' Q2_IDNeed='Views on roads and bridges being adequate to meet Idaho''s needs today' Q3_PerNeed='Views on Idaho''s roads and bridges for personal needs today' Q4_TenNeed='Views on roads and bridges being adequate to meet Idaho''s needs ten years from now' Q5_Commute='Days a week use roads to commute from work and back' Q5_per_cat1='Number of days roads are used for personal business' Q5_rec_cat1='Number of days roads are used for recreation' Q5_commute_cat1='Use the roads to commute to work and back' Q6_AvgComm='Length of average, one-way commute (in minutes)' Q5_Per='Number of days per week you use the roads for personal business' Q5_Rec='Number of days per week you use the roads for recreation' Q7_Rate_1='Rate major highways' Q7_Rate_2='Rate bridges' Q7_Rate_3='Rate city streets' Q7_Rate_4='Rate county roads' Q8_Fund2='Priority of the state legislature increasing funding for Idaho''s roads and bridges' Q9b_EconGrow='Bridges and roads are essential to Idaho''s economy and must be maintained for state growth' Q9d_Safe='Additional funding will allow Idaho to make older bridges and roads safer and reduce accidents' Q10a_RaiseTax='No support in raising taxes or fees for roads and bridges because taxes and fees are too high, ' Q10e_Govmisuse='We shouldn''t support additional funding for roads and bridges because the government will only waste or misuse it' Q11_Sources_1='Raising money from increasing fuel taxes to pay for Idaho roads and bridges' Q11_Sources_2='Raising money from charging sales tax on fuel to pay for Idaho roads and bridges' Q11_Sources_3='Raising money from the use of the current sales tax on automotive parts and tires to fund roads and bridges' Q11_Sources_4='Raising money from the increase of registration fees for passenger cars and light trucks' Q11_Sources_5='Raising money from the increase of registration fees for commercial vehicles' Q11_Sources_6='Raising money from charging a one-time fee on the purchase of new or used vehicles' Q11_Sources_7='Raising money from adding a mileage-based fee for how many miles people drive each year' Q11_Sources_8='Raising money from an increase in property taxes' Q11_Sources_9='Raising money from establishing toll roads'; format Q1_ImpEcon import. AgeCat1 $agecen. Agecat2 $agePS. HH_Income hhinc. Ed_Attain edatt. Dual_ind dualind. Dist3_state d3st. Q2_IDNeed adequate. Q3_PerNeed adequate. Q4_TenNeed adequate. Q7_Rate_1 grade. Q7_Rate_2 grade. Q7_Rate_3 grade. Q7_Rate_4 grade. Q8_Fund2 priorities. Q9b_EconGrow convince. Q9d_Safe convince. Q10a_RaiseTax convince. Q10e_Govmisuse convince. Q11_Sources_1 support. Q11_Sources_2 support. Q11_Sources_3 support. Q11_Sources_4 support. Q11_Sources_5 support. Q11_Sources_6 support. Q11_Sources_7 support. Q11_Sources_8 support. Q11_Sources_9 support. Q5_per_cat1 $comcat. Q5_rec_cat1 $comcat. Q5_commute_cat1 $comcat. Commute_dist $comdist. Dem_sex gender. _district $dstlab.; * Formats for collasped categories (the first ones); *format Q1_ImpEcon import_coll. AgeCat1 $agecen. Agecat2 $agePS. HH_Income hhinc. Ed_Attain edatt. Dual_ind dualind. Dist3_state d3st. Q2_IDNeed adequate_coll. Q3_PerNeed adequate_coll. Q4_TenNeed adequate_coll. Q7_Rate_1 grade_coll. Q7_Rate_2 grade_coll. Q7_Rate_3 grade_coll. Q7_Rate_4 grade_coll. Q8_Fund2 priorities. Q9b_EconGrow convince_coll. Q9d_Safe convince_coll. Q10a_RaiseTax convince_coll. Q10e_Govmisuse convince_coll. Q11_Sources_1 support_coll. Q11_Sources_2 support_coll. Q11_Sources_3 support_coll. Q11_Sources_4 support_coll. Q11_Sources_5 support_coll. Q11_Sources_6 support_coll. Q11_Sources_7 support_coll. Q11_Sources_8 support_coll. Q11_Sources_9 support_coll. Q5_per_cat1 $comcat. Q5_rec_cat1 $comcat. Q5_commute_cat1 $comcat. Commute_dist $comdist_coll. Dem_sex gender. _district $dstlab.; * Formats for second collapsed categories; *format Q1_ImpEcon import_coll. AgeCat1 $agecen. Agecat2 $agePS. HH_Income hhinc. Ed_Attain edatt. Dual_ind dualind. Dist3_state d3st. Q2_IDNeed adequate_coll. Q3_PerNeed adequate_coll. Q4_TenNeed adequate_coll. Q7_Rate_1 grade_colltwo. Q7_Rate_2 grade_colltwo. Q7_Rate_3 grade_colltwo. Q7_Rate_4 grade_colltwo. Q8_Fund2 priorities. Q9b_EconGrow convince_coll. Q9d_Safe convince_coll. Q10a_RaiseTax convince_coll. Q10e_Govmisuse convince_coll. Q11_Sources_1 support_coll. Q11_Sources_2 support_coll. Q11_Sources_3 support_coll. Q11_Sources_4 support_coll. Q11_Sources_5 support_coll. Q11_Sources_6 support_coll. Q11_Sources_7 support_coll. Q11_Sources_8 support_coll. Q11_Sources_9 support_coll. Q5_per_cat1 $comcat. Q5_rec_cat1 $comcat. Q5_commute_cat1 $comcat. Commute_dist $comdist_colltwo. Dem_sex gender. _district $dstlab.; run; proc print data=in.mc label; run;