title1 "NES 2004 APB Paper #1"; title2 "Spring 2009"; title3 "Donald M. Gooch"; *options ls = 80; data robert1; infile "U:\sas\nes04dat.txt" lrecl= 3347 firstobs = 2; input partyid 1104 age 1396-1397 income 1604-1605 genrace 3064-3066 educat 1410 ideo 1039 didvote 2574 votechoice 2607 paper_days 772 natnews_tvdays 762 paper_camp 776 camp_inter 2522 camp_tv 2524 speechnum_rad 2538 prescamp_atten 2540 spendserv 1144-1145 abort 2938 femrole 1270-1271 blackasst 1192-1193 guncontrol 1254 blkfeel 2789-2791 fundfeel 2709-2711 kerry_ft 816-818 bush_ft 812-814 dems_ft 856-858 repubs_ft 860-862 cons_ft 2757-2759 libs_ft 2729-2731 army_ft 2745-2747 ; label partyid = "Summary: R party ID" age = "Respondent Age" income = "Respondent Income" genrace = "Summary: R gender/race/ethnicity status" educat = "Education Levels of Respondent 0 - 7" ideo = "Respondent Ideology 7-point scale" didvote = "Vote & Registration Status" votechoice = "Vote for Bush or Kerry in 2004" paper_days = "Number of Days Respondent Read the Newspaper" natnews_tvdays = "Number of Days Respondent Watched Nat'l News" paper_camp = "Did Respondent read a/b the campaign in a newspaper" camp_inter = "How interested was R in campaign?" camp_tv = "Did R watch the campaign on TV?" speechnum_rad = "Number of Campaign Speeches R listened to on Radio" prescam_atten = "5 point Likert Scale of Presidential Campaign Attention" attent = "Index Variable of R's Political Attentiveness" attent_lev = "3 Cat Variable of R's Political Attentiveness (Zaller)" spendserv = "7 point Likert Scale of R support for Spending & Gov't Services" abort = "4 point scale of Respondent's Abortion Position" femrole = "7 point Likert Scale of R's support for Women" blackasst = "7 point Likert Scale of R's support for Gov't Assist. 4 Blacks" guncontrol = "Respondent's Opinion on Government Gun Control Efforts" blkfeel = "Feeling Thermometer for Blacks" fundfeel = "Feeling Thermometer for Christian Fundamentalists" ; /* V043116 J1x. Summary: R party ID V043250 Y1x. Summary: Respondent age V043294 Y21b. Respondent income V045173 K0. Summary: R gender/race/ethnicity status V043254 Y3x. Summary: Respondent education level V043086 E1x. SUMMARY: R self-placement liberal-conservative V045018x C3. Summary: vote and registration status V045026 C6a. Voter: R's vote for President V043019 A9. How many days past week read a daily newspaper? V043014 A7. Days past week watch natl news on TV V043021 A9a. Did R read about campaign in newspaper? V045001 A1. How interested in political campaigns V045002 A2. Did R watch programs about campaign on TV V045005a A6a. How many campaign speeches or discussions on radio V045006 A7. How much attention to Pres campaign news in general V043136 N1a. Spending and Services - 7-point scale self-placement V045132 G7a. Abortion position: self-placement V043196 P6a. Women's role - 7-point scale self-placement V043158 N6a. Government assistance to blacks-7 point scale self-pl V043188 P5a. Should fed govt make more difficult to buy gun - self V045077 D2z. Feeling Thermometer: Blacks V045057 D2b. Feeling Thermometer: Christian Fundamentalists V043038 B1a. Feeling Thermometer: GW Bush V043039 B1b. Feeling Thermometer: John Kerry V043049 B1n. Feeling Thermometer: Democratic party V043050 B1p. Feeling Thermometer: Republican party V045069 D2q. Feeling Thermometer: Conservatives V045066 D2m. Feeling Thermometer: The Military V045062 D2g. Feeling Thermometer: Liberals */ if educat > 7 then educat = .; if spendserv > 07 then spendserv = .; if abort > 4 then abort = .; if femrole > 07 then femrole = .; if blackasst > 07 then blackasst = .; if guncontrol > 5 then guncontrol = .; if blkfeel > 100 then blkfeel = .; if fundfeel > 100 then fundfeel = .; if kerry_ft > 100 then kerry_ft = .; if bush_ft > 100 then bush_ft = .; if dems_ft > 100 then dems_ft = .; if repubs_ft > 100 then repubs_ft = .; if cons_ft > 100 then cons_ft = .; if libs_ft > 100 then libs_ft = .; if army_ft > 100 then army_ft = .; if educat < 3 then educat2 = "Some High School"; if educat = 3 then educat2 = "High School Degree"; if educat = 4 then educat2 = "Some College"; if educat > 4 then educat2 = "College Degree or +"; if blkfeel >= 0 and blkfeel < 20 then blkfeel2 = 1; if blkfeel >= 20 and blkfeel < 40 then blkfeel2 = 2; if blkfeel >= 40 and blkfeel < 60 then blkfeel2 = 3; if blkfeel >= 60 and blkfeel < 80 then blkfeel2 = 4; if blkfeel >= 80 and blkfeel <= 100 then blkfeel2 = 5; if fundfeel >= 0 and fundfeel < 20 then fundfeel2 = 1; if fundfeel >= 20 and fundfeel < 40 then fundfeel2 = 2; if fundfeel >= 40 and fundfeel < 60 then fundfeel2 = 3; if fundfeel >= 60 and fundfeel < 80 then fundfeel2 = 4; if fundfeel >= 80 and fundfeel <= 100 then fundfeel2 = 5; if paper_days > 7 then paper_days = .; if natnews_tvdays > 7 then natnews_tvdays = .; if paper_camp = 5 then paper_camp = 0; if paper_camp > 1 then paper_camp = .; if camp_inter > 5 then camp_inter = .; if camp_tv = 5 then camp_tv = 0; if camp_tv > 1 then camp_tv = .; if speechnum_rad > 5 then speechnum_rad = .; if prescamp_atten = 1 then prescamp_atten2 = 5; if prescamp_atten = 2 then prescamp_atten2 = 4; if prescamp_atten = 3 then prescamp_atten2 = 3; if prescamp_atten = 4 then prescamp_atten2 = 2; if prescamp_atten = 5 then prescamp_atten2 = 1; attent = paper_days + natnews_tvdays + paper_camp + camp_inter + camp_tv + speechnum_rad + prescamp_atten2; if attent <= 7 then attent_lev = 1; if attent >= 8 and attent < = 14 then attent_lev = 2; if attent >= 15 then attent_lev = 3; proc means data = robert1; var attent attent_lev; run; proc freq data = robert1; tables attent_lev; run; data data2; set robert1; pid2 = .; if partyid = 0 then pid2 = 7; if partyid = 1 then pid2 = 6; if partyid = 2 then pid2 = 5; if partyid = 3 then pid2 = 4; if partyid = 4 then pid2 = 3; if partyid = 5 then pid2 = 2; if partyid = 6 then pid2 = 1; if pid2 > 5 then pid3 = "Democrat"; if pid2 > 2 and pid2 < 6 then pid3 = "Independent"; if pid2 < 3 then pid3 = "Republican"; if income >= 88 then income = .; if income < 7 then class = "Lower Class"; if income >= 7 and income < 13 then class = "Lower Middle Class"; if income >= 13 and income < 16 then class = "Upper Middle Class"; if income >= 16 then class = "Upper Class"; if ideo >= 7 then ideo =.; if didvote = 1 then didvote2 = "Yes, Voted"; if didvote >= 2 and didvote < 6 then didvote2 = "No Vote"; if didvote = 6 then didvote2 = .; if votechoice = 3 then vc2 = 1; if votechoice = 1 then vc2 = 0; if votechoice >= 5 then vc2 = .; if genrace = 1 then fem = 1; if genrace = 12 then fem = 1; if genrace = 13 then fem = 1; if genrace = 123 then fem = 1; if genrace = 2 then fem = 0; if genrace = 3 then fem = 0; if genrace = 23 then fem = 0; if genrace = 0 then fem = 0; if genrace = 2 then black = 1; if genrace = 12 then black = 1; if genrace = 23 then black = 1; if genrace = 123 then black = 1; if genrace = 1 then black = 0; if genrace = 3 then black = 0; if genrace = 13 then black = 0; if genrace = 0 then black = 0; data data2; set data2; label didvote2 = "Did or Did Not Vote (1 = vote)" vc2 = "Vote Choice (1 = Bush, 0 = Kerry)" ; *proc contents data = data2; *title4 "Contents of Paper #1 Data Set"; *run; *proc freq data = data2; *title4 "Frequencies of All Variables Paper #1 Data Set"; *tables partyid age income genrace ideo didvote votechoice pid2 didvote2 vc2 black fem class; *run; *proc freq data = data2; *title4 "Cross Tabulations of PID on Demographic Factors"; *tables pid2*fem pid2*black pid2*class pid2*ideo pid2*vc2 pid2*didvote2 ; *run; data zaller; set data2; *proc freq data = zaller; *tables attent_lev*pid2 attent_lev*ideo attent_lev*class attent_lev*vc2 attent_lev*didvote2 attent_lev*black attent_lev*fem ; run; data paper2; set zaller; proc freq data = paper2; title4 "Cross Tabulations of Variables for Paper 2"; tables educat2*class*didvote2 pid2*ideo pid3*ideo pid2*spendserv pid3*spendserv pid2*femrole pid3*femrole pid2*abort pid3*abort pid2*blackasst pid3*blackasst pid2*guncontrol pid3*guncontrol pid2*blkfeel2 pid3*blkfeel2 pid2*fundfeel2 pid3*fundfeel2 educat*didvote2 attent_lev*didvote2 ; run; data reg; set paper2; proc plot data = reg; title4 "Plot Kerry FT on Bush FT"; plot kerry_ft*bush_ft; run; proc reg data = reg; title4 "Regressing Party ID (7pt) on Kerry's Feeling Thermometer"; model kerry_ft = pid2; run; proc reg data = reg; title4 "Regressing Party ID (7pt) on Bush's Feeling Thermometer"; model bush_ft = pid2; run;