capture log close set more off clear log using nes3-support, replace set linesize 80 version 9.1 // pgm: nes3-support.do // task: clean-up dataset // author: tait medina // date: 2007-05-23 // #1 // get data use nes , replace // #2 // check varnames nmlab // no labels label var prebush "Rate Bush pre-92 election." label var preclint "Rate Clinton pre-92 election." label var preperot "Rate Perot pre-92 election." label var postbush "Rate Bush post-92 election." label var postclin "Rate Clinton post-92 election." label var postpero "Rate Perot post-92 election." unab vars: prebush-preperot postbush-postpero foreach v in `vars' { note `v': high scores=more favorable. } label var partyid "Party ID." label var abortion "View on abortion." label var election "Who will you vote for?" label var religion "Religious affiliation." label var age "Age." label var marital "Marital status." label var educatio "Education level." label var occup "Occupation code." label var fincome "Family income." label var sex "Sex." label var race "Race." label var didvote "Did you vote in Nov?" label var regvote "Were you registered to vote?" label var presvote "Who did you vote for?" label var prefvote "Didn't vote, but preferred." label var canparty "Party of cand gave $ to." label var whichpar "Gave $ to which party." label var campaign "Talked to people about voting." label var contact "Contacted about voting for cand." label var support "Displayed button, stickers, etc." label var attend "Attended political meeting, etc." label var enlist "Enlisted to attend meeting, etc." label var partywrk "Worked for party." label var askwork "Asked to work for party." label var taxretur "Claimed $ on tax return." label var fundcam "Gave $ to candidate." label var fundpart "Gave $ to party." label var fundgrp "Gave $ to group." label var contvote "Contacted about voting." label var mailfund "Recieved mail request for $." label var contmail "Gave b/c of mail request." label var phonfund "Recieved phone request for $." label var contphon "Gave b/c of phone request." label var persfund "Recieved personal request $." label var contpers "Gave b/c of personal request." label var alotmail "How may mail requests for $." label var alotphon "How many phone requests for $." label var persalot "How many personal requests $." codebook , compact note list // #3 // add variable labels label define feel 0 "0_unfavorable" 100 "100_favorable" foreach v in prebush preclint preperot postbush postclin postpero { label val `v' feel } label define partyid 0 "0_strong Dem" 1 "1_weak Dem" /// 2 "2_Indep-closer to Dem" 3 "3_Indep" 4 "4_Indep-closer to Repub" /// 5 "5_weak Repub" 6 "6_strong Repub" /// 7 "7_other party" label define abortion 1 "1_never permitted by law" /// 2 "2_if rape, incest, or life threatening" /// 3 "3_if need is established" /// 4 "4_personal choice" /// 6 "6_law should not be invloved" /// 7 "7_other" label define election 1 "1_Bush" 2 "2_Clinton" 5 "5_Perot" 7 "7_Other" label define religion 1 "1_Protestant" 2 "2_Catholic" 3 "3_Jewish" /// 4 "4_Other" label define marital 1 "1_married & living w/ spouse" /// 2 "2_never married" 3 "3_divorced" /// 4 "4_separated" 5 "5_widowed" 7 "7_unmarried partners" label define educatio 1 "1_8th grade or less" 2 "2_9th-11th grades" /// 3 "3_high school" 4 "4_more than 12 years" 5 "5_jr college degree" /// 6 "6_BA level degrees" 7 "7_advaned degrees" label define occup 1 "1_exec, admin and managerial" /// 2 "2_prof specialty" /// 3 "3_tech and related support" /// 4 "4_sales" /// 5 "5_admin support, including clerical" /// 6 "6_private household" /// 7 "7_protective service" /// 8 "8_service except protective & household" /// 9 "9_farming, forestry, and fishing" /// 10 "10_precision produc, craft and repair" /// 11 "11_machine op, assemblers, inspectors" /// 12 "12_transportation and material moving" /// 13 "13_handlers, equip cleaners, laborers" label define fincome 1 "1_<3K" 2 "2_3-5K" 3 "3_5-7K" 4 "4_7-9K" /// 5 "5_9-10K" 6 "6_10-11K" 7 "7_11-12K" 8 "8_12-13K" 9 "9_13-14K" /// 10 "10_14-15K" 11 "11_15-17K" 12 "12_17-20K" 13 "13_20-22K" /// 14 "14_22-25K" 15 "15_25-30K" 16 "16_30-35K" 17 "17_35-40K" /// 18 "18_40-45K" 19 "19_45-50K" 20 "20_50-60K" 21 "21_60-75K" /// 22 "22_75-90K" 23 "23_90-105K" 24 "24_>105K" /// 66 "66_Below 25K but NA" 77 "77_Above 25K but NA" label define sex 1 "1_male" 2 "2_female" label define race 1 "1_White" 2 "2_Black" 3 "3_American Indian/Alaskan" /// 4 "4_Asian/Pacific Islander" foreach v in partyid abortion election religion marital educatio occup /// fincome sex race { label val `v' `v' } label define yesno1 1 "1_yes" 5 "5_no" 6 "6_not required" label val didvote yesno1 label val regvote yesno1 label define prez 1 "1_Bush" 2 "2_Clinton" 3 "3_Perot" 7 "7_Other" label val presvote prez label val prefvote prez label define party 1 "1_Republican" 3 "3_ both" 5 "5_Democratic" 7 "7_other" label val canparty party label val whichpar party label define yesno2 1 "1_yes" 5 "5_no" unab vars: campaign-contpers foreach v in `vars' { label val `v' yesno2 } label define freq 1 "1_quite a few" 5 "5_not very many" label val alotmail freq label val alotphon freq label val persalot freq // #4 // verify codebook , compact tab1 prebush-race postbush-contpers , m save nes3 , replace log close exit // exit do-file