***This includes all the data compilation and analyses in LRNP clear all set more off local path [path to files cd "`path'/" **Some processing and variable creation of CCES Common Content. use `path'/CCES16_Common_OUTPUT_Jul2017_VV.dta, clear gen zipidA=lookupzip tab inputstate, mis gen(state) tab lookupzip if inputstate==17 //Illinois tab countyname if inputstate==17 //"Cook IL" tab race, mis //white==1 recode race (2 3 4 5 6 7 8=0), gen(white) recode race (1 3 4 5 6 7 8=0)(2=1), gen(black) recode race (1 2 4 5 6 7 8=0)(3=1), gen(latino) recode faminc (97=.) recode ownhome (2/8=0), gen(homeowner) recode pid7 (8 98 99=.), gen(gop7) tab CC16_340a, nol recode CC16_340a (8 98=.), gen(cons7) *Income recode faminc (98=.) *Votes2016 recode CC16_410a (2=0)(3/5=.)(6/99=.), gen(djtvote2) //two-party vote, 2016 **South tab inputstate recode inputstate (1 5 10 11 12 13 21 22 24 28 29 37 45 47 48 51=1) /// (2 4 6 8 9 15 16 17 18 19 20 23 25 26 27 30/36 38/44 46 49 50 52/56=0), gen(South15) recode inputstate (1 5 12 13 22 28 29 37 45 47 48 51=1) /// (2/4 6/11 14/21 23/27 30/36 38/44 46 49 50 52/56=0), gen(seceded) recode urbanp (.=0)(0/1=1), gen(metrocounty) recode urbanp (.=0) save CCES16a, replace drop CC16* save CCES16lean, replace **County levels for antiantislavery use CCES16a, clear **ZIPs by Place set more off use "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/CCES/CCES16a.dta", clear //This is produced by the other do-file merge m:1 zipidA using zipCentroids drop _merge merge m:1 zipidA using "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/ZIPCodeDataCensus2015/ZIPdemog20002015.dta" //This is a bunch of ZIP-code and place-level demography *drop if _merge==2 //15801 ZIPs with no respondents...High? 132 respondents with no ZIP. *drop _merge *merge m:1 zipidA using ZIPswithPlaceb *drop if _merge==2 //ZIPs with no respondents ren _merge placeZIPmerge //Note if this is 1, respondent zip has centroid in a non-place (typically, a geographically large zip in a sparsely populated area) drop if placeZIPmerge==2 sort cbsafp merge m:1 cbsafp using "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/MetroEconomicChars2016/MetroEcon" ren _merge metromerge // drop if metromerge==2 //Zero metros not in the data? 10970 without a metro sort countyfips merge m:1 countyfips using "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/CountyEcononicChars2016/CountyEcon" ren _merge countymerge drop if countymerge==2 //474 counties not in the data, 99% <10k merge m:1 countyfips using CountyCentroids drop if _merge==2 drop if V101==. //contexts with no respondents /* For robustness check of nearest neighbors, which uses geographic points based on ZIP or county centroids use "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/CCES/CCES16a.dta", clear **Merge in ZIP centroids, lat/long merge m:1 zipidA using zipCentroids drop _merge merge m:1 zipidA using "/Users/tko782/Desktop/Northwestern/CityNeighborhoodStudy/ZIPCodeDataCensus2015/ZIPdemog20002015.dta" drop if _merge==2 //ZIPs with no respondents drop _merge merge m:1 zipidA using ZIPswithPlaceb drop if _merge==2 //ZIPs with no respondents ren _merge placeZIPmerge //Note if this is 1, respondent zip has centroid in a non-place (typically, a geographically large zip in a sparsely populated area) **Merge in County Centroids, lat/long merge m:1 countyfips using CountyCentroids drop if _merge==2 */ **Generic recodes from schools analysis *ren inputstate statefips recode faminc (98=.) xtile faminc5=faminc, nq(5) gen age=2016-birthyr recode age (0/20=0)(21/50=1)(51/99=0), gen(midage) gen bap=batot/poptot recode gender(2=0), gen(male) gen mergeZIP=lookupzip destring lookupzip, gen(zip) gen year=2016 gen medinchhk=medinchh2015/1000 //divide ZIP-level median by 1000 to compare to famincEst (below) gen pl_medinchhk=pl_medinchh/1000 //divide place-level median by 1000 to compare to famincEst (below) gen MT_medinchhk=MET_medinchh/1000 //divide metro-level median by 1000 to compare to famincEst (below) gen CTY_medinchhk=CTY_medinchh/1000 //divide county-level median by 1000 to compare to famincEst (below) ren CC16_410a prezvote recode prezvote (1=1)(2 3 4 5 8=0)(6 7 98 99=.),gen(djt16) recode faminc (31=13)(98=.), gen(faminc2) *twoway scatter faminc2 medinchh2015 || hline(6.5) recode faminc2 (1 2 3=0)(4 5 6=1)(7 8=3)(4/16=4) ,gen(incnat4) gen medinchh10k=medinchh2015/1000 recode faminc2 (1=5)(2=15)(3=25)(4=35)(5=45)(6=55)(7=65)(8=75)(9=90)(10=11)(11=13)(12=17.5)(13=22.5)(14=30)(15=35)(16=50), gen(famincEst) gen richrich=0 replace richrich=1 if famincEst>medinchh10k & faminc2>6 gen localrich=0 replace localrich=1 if famincEst>medinchh10k & faminc2<6 gen localpoor=0 replace localpoor=1 if famincEst6 gen poorpoor=0 replace poorpoor=1 if faminc2<6 & famincEst49 replace community=state if nMetro<50 encode community, gen(community1) xtile natincq16=faminc2, nq(16) //16-quantile national income distribution gen natincq1=natincq16/16 //Rescales the 16-quantile national income distribution to [0,1] xtile natincq14b=faminc2, nq(14) //14-quantiles. For some reason I like the look of this distribution gen natincq141=natincq14b/14 //rescales the 14-quantile measure to [0,1] gen natincq100=natincq1*100 **Calculate more quantile-type income measure at ZIP level. gen incZIPqX=. replace incZIPqX=hhinc10p2015/2 if faminc2==1 //Puts it at the middle of the bin replace incZIPqX=hhinc10p2015+hhinc15p2015*.5 if faminc2==2 //sums all the lower bins replace incZIPqX=hhinc10p2015+hhinc15p2015 if faminc2==3 //summs all the lower bins replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 if faminc2==4 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 if faminc2==5 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 if faminc2==6 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015*.66 if faminc2==7 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015*.2 if faminc2==8 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 if faminc2==9 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015*.4 if faminc2==10 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 if faminc2==11 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 + hhinc200p2015 if faminc2==12 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 + hhinc200p2015 + hhinc200plusp2015*.5 if faminc2==13 //divides the top-code up a little--geometrically. replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 + hhinc200p2015 + hhinc200plusp2015*.75 if faminc2==14 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 + hhinc200p2015 + hhinc200plusp2015*.875 if faminc2==15 replace incZIPqX=hhinc10p2015 + hhinc15p2015 + hhinc25p2015 + hhinc35p2015 + hhinc50p2015 + hhinc75p2015 + hhinc100p2015 + hhinc150p2015 + hhinc200p2015 + hhinc200plusp2015 if faminc2==16 replace incZIPqX=100 if incZIPqX>100 gen incZIPq100=incZIPqX gen incZIPq1=incZIPqX/100 //rescales to [0,1] gen commincq16 = . sum community1 quietly forval i = 1/`r(max)' { xtile commincq16_`i' = faminc2 if community1 == `i', nquantiles(16) replace commincq16 = commincq16_`i' if community1 == `i' drop commincq16_`i' } label variable commincq16 "Community class (16-quantile)" label variable natincq16 "National class (16-quantile)" twoway scatter natincq16 commincq16 encode state, gen(stateN) //create numeric version of state, for indicator/fixed effect in regressions encode community, gen(communityN) //similar, for community gen incdiffNAT=famincEst-55 //variable for difference between respondent's income and national median (~55k) gen incdiffZIP=famincEst-medinchhk //variable for difference between respondent's income and local (ZIP) median gen incratNAT=famincEst/55 //variable for ratio of respondent's income to national median gen incratZIP=famincEst/medinchhk //variable for ratio of respondent's income to local (ZIP) median gen incratPL=famincEst/pl_medinchhk //variable for ratio of respondent's income to local (place-level) median gen incdiffPL=famincEst-pl_medinchhk //variable for difference between respondent's income and local (ZIP) median gen incratMT=famincEst/MT_medinchhk gen incdiffMT=famincEst-MT_medinchhk gen incratCTY=famincEst/CTY_medinchhk gen incdiffCTY=famincEst-CTY_medinchhk gen incratCOMM=. replace incratCOMM=incratMT if nMetro>50 replace incratCOMM=incratCTY if nMetro<50 gen incdiffCOMM=. replace incdiffCOMM=incdiffMT if nMetro>50 replace incdiffCOMM=incdiffCTY if nMetro<50 gen commnatdiffq16=commincq16-natincq16 //variable for difference between respondent's place in community(metro/state) income dist and national income dist recode incratZIP (-1000/-.999999999=-1)(1=1)(1.000000001/10000000=1), gen(incratZIP3) recode incratNAT (-1000/-.999999999=-1)(1=1)(1.000000001/10000000=1), gen(incratNAT3) xtile incdiffZIP16=incdiffZIP, nq(16) pwcorr incdiffPL incdiffZIP incdiffNAT incdiffZIP incratZIP incdiffMT incratCTY incratCOMM incratMT incratNAT incdiffNAT incdiffCTY incratCTY commnatdiffq16 commincq16 natincq16, obs gen incomegroups4=. replace incomegroups4=1 if poorpoor==1 replace incomegroups4=2 if localpoor==1 replace incomegroups4=3 if localrich==1 replace incomegroups4=4 if richrich==1 label define incomegroups4 1 "poorpoor" 2 "localpoor" 3 "localrich" 4 "richrich" label values incomegroups4 incomegroups4 **Contextual changes (not already in the data) gen medincshift=medinchh2015/medinchh2000 gen laborforce16shift=laborforce16t2015-laborforce16t2000 gen laborforce16shiftp=(laborforce16t2015/(laborforce16t2015+nonlabor16t2015))-(laborforce16t2000/pop16t2000) ************** *SP coding *minwage gen minwage=CC16_351K recode minwage 8=. 2=0 tab minwage CC16_351K, miss *ideology gen ideo=CC16_340a recode ideo 98=. 8=. gen ideo0to1=(ideo-1)/6 tab ideo0to1 CC16_340a, miss *ideonotsure dummy gen ideonotsure=0 recode ideonotsure 0=. if CC16_340a==98 recode ideonotsure 0=. if CC16_340a==. recode ideonotsure 0=1 if CC16_340a==8 tab ideonotsure CC16_340a, miss *party id gen pidrep=pid7 recode pidrep 8=. 98=. 99=. gen pidrep0to1=(pidrep-1)/6 *has national economy gotten better or worse in past year gen nateconworse=CC16_302 recode nateconworse 8=. 6=. gen nateconworse0to1=(nateconworse-1)/4 tab nateconworse0to1 CC16_302, miss *two-category measure of income gen incnat2=. replace incnat2=0 if incnat4==0 replace incnat2=0 if incnat4==1 replace incnat2=1 if incnat4==3 replace incnat2=1 if incnat4==4 tab incnat2 incnat4, miss gen famincind=faminc recode famincind 31=. gen djtsmall=djt16 recode djtsmall 0=. if prezvote==3|prezvote==4|prezvote==5|prezvote==8 tab djtsmall prezvote, miss alpha raiseminwage spendwelfare spendhealth, gen(redist2) item gen incdiffzip0to1=incdiffZIP+196.563 replace incdiffzip0to1=incdiffzip0to1/696.563 gen faminc20to1=(faminc2-1)/15 *4-category income to get the 25th, 50th, 75th percentiles (more or less) gen faminc4cat=. recode faminc4cat .=1 if faminc2<=3 recode faminc4cat .=2 if faminc2<=6 recode faminc4cat .=3 if faminc2<=9 recode faminc4cat .=4 if faminc2<=16 gen n=int(uniform()*10) save ClassIncomeElection2016a, replace /**Loops to calculate income distribution for each obs in set of 200 nearest neighbors **These take a long time, and create incArea, a local income variable used in robustness appendix use ClassIncomeElection2016a, clear keep V101 countyfips zipidA CtyC* ZCent* faminc2 gen X=ZCentLong replace X=CtyCentLon if ZCentLong==. & CtyCentLon!=. gen Y=ZCentLat replace Y=CtyCentLat if ZCentLat==. & CtyCentLat!=. drop if X==. drop if Y==. sort V101 egen obs=seq() save ClassIncomeElection2016GeoOnly, replace use ClassIncomeElection2016GeoOnly, clear set more off sum obs *local obsmax=r(max) local obsmax=200 //for diagnostics forvalues obs=1/`obsmax'{ use ClassIncomeElection2016GeoOnly, clear gen one=1 if obs==`obs' gen baseX1=X*one egen baseX=max(baseX1) gen baseY1=Y*one egen baseY=max(baseY1) geodist Y X baseY baseX , gen(distance) miles *sort distance egen distrank=rank(distance), track gen keepflag1=1 if distance <50 //Get ready to keep neighbors within 50 miles of `obs' gen keepflag2=1 if distrank<50 //For very rural, keep the 50 nearest neighbors instead of those within 50 miles keep if keepflag1==1 | keepflag2==1 //Keep either egen incAreaN=count(faminc2) sum incAreaN local AreaN=r(max)-1 xtile incAreaq50b=faminc2, nq(`AreaN') // very precise quantiles, up to one for each obs (though lumpier because of faminc) xtile incAreaq16b=faminc2, nq(16) //16 quantiles, because we like that for some reason keep if obs==`obs' keep V101 incAreaq* incAreaN save incAreaq100_`obs', replace } use incAreaq100_1, clear forvalues obs=2/`obsmax'{ append using incAreaq100_`obs' } save incAreaq100All, replace gen incAreaq50=incAreaq50b/incAreaN //rescale to 1 gen incAreaq32=incAreaq16b/16 //rescale to 1 **Save a gig or 2 forvalues obs=1/`obsmax'{ erase incAreaq100_`obs' } */ /* This screwed up. Don't loop it back in for now (though necessary for full replication with robustness checks). use ClassIncomeElection2016a, clear merge 1:1 V101 using incAreaq100All save ClassIncomeElection2016, replace */ use ClassIncomeElection2016, clear *make a couple more variables xtile incZIPq116cat=incZIPq1, nq(16) xtile incZIPq14cat=incZIPq1, nq(4) *missing income gen incmiss=0 recode incmiss 0=1 if faminc2==. gen nocollege=. replace nocollege=1 if educ==1|educ==2|educ==3 replace nocollege=0 if educ==4|educ==5|educ==6 tab nocollege educ, miss gen college=. replace college=0 if educ==1|educ==2|educ==3 replace college=1 if educ==4|educ==5|educ==6 tab college educ, miss gen south=0 replace south=1 if stateN==41 replace south=1 if stateN==26 replace south=1 if stateN==10 replace south=1 if stateN==2 replace south=1 if stateN==11 replace south=1 if stateN==19 replace south=1 if stateN==44 replace south=1 if stateN==46 replace south=1 if stateN==3 replace south=1 if stateN==43 replace south=1 if stateN==28 gen poorst=0 replace poorst=1 if stateN==50 replace poorst=1 if stateN==43 replace poorst=1 if stateN==3 replace poorst=1 if stateN==26 replace poorst=1 if stateN==2 replace poorst=1 if stateN==14 replace poorst=1 if stateN==37 replace poorst=1 if stateN==41 replace poorst=1 if stateN==36 replace poorst=1 if stateN==23 replace poorst=1 if stateN==22 replace poorst=1 if stateN==27 replace poorst=1 if stateN==28 replace poorst=1 if stateN==16 replace poorst=1 if stateN==25 replace poorst=1 if stateN==30 replace poorst=1 if stateN==34 gen richst=0 replace richst=1 if stateN==51 replace richst=1 if stateN==31 replace richst=1 if stateN==48 replace richst=1 if stateN==44 replace richst=1 if stateN==24 replace richst=1 if stateN==7 replace richst=1 if stateN==15 replace richst=1 if stateN==29 replace richst=1 if stateN==5 replace richst=1 if stateN==35 replace richst=1 if stateN==21 replace richst=1 if stateN==20 replace richst=1 if stateN==32 replace richst=1 if stateN==46 replace richst=1 if stateN==1 replace richst=1 if stateN==8 replace richst=1 if stateN==12 gen middlest=0 replace middlest=1 if poorst==0 & richst==0 gen ownhome2cat=0 replace ownhome2cat=1 if ownhome==1 replace ownhome2cat=. if ownhome==8 gen bornagain=0 replace bornagain=1 if pew_bornagain==1 replace bornagain=. if pew_bornagain==8 recode afamp2015 (.05/1=1)(0/.0499999999=0), gen(BlackContext05) tab BlackContext05 xtile incdiffzip16=incdiffZIP, nq(16) xtile incdiffzip4=incdiffZIP, nq(4) xtile lpopdens4cat=lpopdens2015, nq(4) label variable faminc2 "National Income" label variable incdiffzip16 "Local Income" *participation index: attend local meeting, put up sign, work for campaign, donate money to campaign egen particsmall=rowmean(polact_meeting polact_sign polact_workcand polact_donatecand) *min wage - reverse coded recode raiseminwage 0=1 1=0, gen(oppminwage) *voted trump in primary (as opposed to any other republicans) gen djtp=. replace djtp=0 if CC16_328==5 replace djtp=0 if CC16_328==6 replace djtp=0 if CC16_328==7 replace djtp=0 if CC16_328==8 replace djtp=1 if CC16_328==4 *fix faminc2 gen faminc2real=faminc2 replace faminc2real=. if faminc==31 gen faminc2div=faminc2real/6 gen incZIPq1div=(incZIPqX/100)*1.4285 xtile faminc4cat=faminc2real, nq(4) gen faminc4catbig=faminc4cat recode faminc4catbig .=5 if faminc2==. xtile faminc16cat=faminc2real, nq(16) *fix zipinc replace incZIPq1=. if faminc==31 replace incZIPq14cat=. if faminc==31 replace incZIPq1div=. if faminc==31 replace incZIPqX=. if faminc==31 replace incZIPq116cat=. if faminc==31 recode incZIPq1 (0/.25=1)(.25000000001/.5=2)(.50000000001/.75=3)(.7500000001/1=4), gen(incZIPq14catb) gen incZIPq100=incZIPq1*100 xtile incZIPqq16cat=incZIPq1, nq(16) recode incZIPq1 (0/.0625=1)(.0625000000001/.125=2)(.1250000000001/.1875=3) /// (.1875000001/.25=4)(.25000001/.3125=5)(.3125000001/.375=6)(.37500001/.4375=7)(.437500001/.5=8) /// (.5000001/.5625=9)(.562500001/.625=10)(.625000001/.6825=11)(.682500001/.75=12)(.7500001/.815=13) /// (.815000001/.875=14)(.875000001/.9375=15)(.9375000001/1=16), gen(incZIPq116catb) gen validvote=0 replace validvote=1 if CL_E2016GVM=="absentee" replace validvote=1 if CL_E2016GVM=="earlyVote" replace validvote=1 if CL_E2016GVM=="mail" replace validvote=1 if CL_E2016GVM=="polling" replace validvote=1 if CL_E2016GVM=="unknown" ren validvote VV label variable faminc4cat "National Income" label variable incZIPq116cat "Local Income Quantile" label variable incZIPq14cat "Local Income Quartile" label variable djtvote2 "DJT Vote" label variable faminc2 "Family Income" label variable faminc2real "Family Income" **Merge in whites-only reference pool data and create whites-only local income measure **Calculate more quantile-type income measure at ZIP level. merge m:1 zipidA using "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/WhiteIncomeDataZIP.dta" drop if _merge==2 //zips with no respondents gen incnhwZIPqX=. replace incnhwZIPqX=nhwhhinc10p2015/2 if faminc2==1 //Puts it at the middle of the bin replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 if faminc2==2 //sums all the lower bins replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 if faminc2==3 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 if faminc2==4 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 if faminc2==5 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015*.5 if faminc2==6 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p*.3333 if faminc2==7 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p if faminc2==8 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p*.6 if faminc2==9 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015*.4 if faminc2==10 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015*.6 if faminc2==11 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015 + nhwhhinc200p2015*.5 if faminc2==12 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015 + nhwhhinc200p2015 + nhwhhinc200plusp2015*.5 if faminc2==13 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015 + nhwhhinc200p2015 + nhwhhinc200plusp2015*.75 if faminc2==14 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015 + nhwhhinc200p2015 + nhwhhinc200plusp2015*.85 if faminc2==15 replace incnhwZIPqX=nhwhhinc10p2015 + nhwhhinc15p2015 + nhwhhinc20p2015 + nhwhhinc25p2015 + nhwhhinc30p2015 + nhwhhinc35p2015 + nhwhhinc40p2015 + nhwhhinc45p2015 + nhwhhinc50p2015 + nhwhhinc60p2015 + nhwhhinc75p + nhwhhinc100p + nhwhhinc125p2015 + nhwhhinc150p2015 + nhwhhinc200p2015 + nhwhhinc200plusp2015 if faminc2==16 replace incnhwZIPqX=100 if incnhwZIPqX>100 & incnhwZIPqX!=. gen incnhwZIPq1=incnhwZIPqX xtile incnhwZIPq116cat=incnhwZIPq1, nq(16) xtile incnhwZIPq14cat=incnhwZIPq1, nq(4) **Control for ZIP income... gen richZIP=0 replace richZIP=1 if medinchh2015>70597 gen poorZIP=0 replace poorZIP=1 if medinchh2015<42101 gen weight100=commonweight_post*100 gen weight100int=round(weight100, 1) save LRNPdata, replace ********************** ****Above this line is making variables, below is doing analyses ********************** set more off use LRNPdata, clear svyset [pweight=commonweight] **Maps and Income distributions are frome elsewhere. *Figures output ***Income distribution: label variable faminc2real "Family Income ($10,000s)" label variable incZIPq14catb "Local Income Quartile" hist faminc2real if white==1 [weight=weight100int], lcol(gs5) fcol(gs8) /// percent xlab( 1 "0-1" 2 "1-2" 3 "2-3" 4 "3-4" 5 "4-5" 6 "5-6" /// 7 "6-7" 8 "7-8" 9 "$8-10" 10 "10-12" 11 "12-15" 12 "15-20" /// 13 "20-25" 14 "25-35" 15 "35-50" 16 "50+", val labsize(vsmall)) /// title("National Income Distribution, CCES Respondents") name("FamincHist", replace) graph export "FamincHist.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/FamincHist.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/FamincHist.eps", replace label variable faminc2real "Family Income" **Joint Distribution *Overlaid Densities set more off twoway kdensity incZIPq100 if faminc2==1 & white==1 [w=commonweight_post], name("JointKdensity", replace) scheme(burd) xtitle("Percentile of Local Income Dist.") ytitle("Density") title("Local Income Position of National Income Groups") legend(title("Income ($1000s)") size(small) pos(3) cols(1) label(1 "$0-10") label(2 "$10-20") label(3 "$20-30") /// label(4 "$30-40") label(5 "$40-50") label(6 "$50-60") label(7 "$60-70") label(8 "$70-80") label(9 "$80-100") label(10 "$100-120") label(11 "$120-150") label(12 "$150-200") label(13 "$200-250") label(14 "$250-350") label(15 "$350-500") label(16 "$500+" )) /// scheme(burd) /// || kdensity incZIPq100 if faminc2==2 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==3 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==4 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==5 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==6 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==7 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==8 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==9 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==10 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==11 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==12 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==13 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==14 & white==1 [w=commonweight_post] /// || kdensity incZIPq100 if faminc2==15 & white==1 [w=commonweight_post] graph export "JointKdensity.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/JointKdensity.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/JointKdensity.eps", replace *Figure. Standard approach - bivariate *n = 30,937 svyset [pweight=commonweight_post] svy, subpop(if white==1): reg redist1 i.faminc4cat margins, at(faminc4cat=(1(1)4)) marginsplot, title("National Income") name(BivarFaminc4DJT, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc4Redist.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc4Redist.eps", replace *Figure Trivar. Same but include local zip; 4-category *note that now the effect of national income is now 21 percentage points *note that now the effect of national income is now 21 percentage points *4a. effect of national income holding local income constant set more off svy, subpop(if white==1): reg redist1 i.faminc4cat i.incZIPq14catb margins, at(faminc4cat=(1(1)4) incZIPq14catb==2) marginsplot, title("National Income") name(MultRegFaminc4DJT, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegFaminc4DJT.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegFaminc4DJT.eps", replace svy, subpop(if white==1): reg redist1 faminc4cat incZIPq14catb *4b. effect of local income holding national income constant set more off svy, subpop(if white==1): reg redist1 i.faminc4cat i.incZIPq14catb margins, at(incZIPq14catb=(1(1)4) faminc4cat==2) marginsplot, title("Local Income") name(MultRegLocalInc4DJT, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegLocalInc4DJT.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegLocalInc4DJT.eps", replace graph combine MultRegFaminc4DJT MultRegLocalInc4DJT, title("Predicted Probability of Voting for Trump at Quartiles of" "National (Left) and Local Income (Right)") name(CombinedTrivar, replace) *Figure 5. coefplot (treating IVs as continuous) /*first let's check on the meaningful distribution of faminc2 *what this shows is that if incZIPq1 is in one of its middle two categories, then the 5th percentile of faminc2 is category 4 and the 95th percentile is at category 10*/ centile faminc2 if incZIPq14catb~=1 & incZIPq14catb~=4 & incZIPq14catb~=. & white==1 & djtvote2~=., centile(5 95) *note that 2234 obs are in cat 4 and 900 are in cat 10 tab faminc2 if incZIPq14catb~=1 & incZIPq14catb~=4 & incZIPq14catb~=. & white==1 & djtvote2~=. svy, subpop(if incZIPq14catb~=1 & incZIPq14catb~=4 & incZIPq14catb~=. & white==1 & djtvote2~=.): tab faminc2 /*but the tricky thing is that the margins command is written to show the effect of a unit increase in the IV. So I need to recode faminc2 such that a "unit" increase actually corresponds to movement from category 4 to category 10. If I just do margins on "faminc2" it will show the effect of moving 1/15 of the scale (15 categories; from category 1 to category 16). So here we go.*/ *gen faminc2div=faminc2/6 *see how cat 4 is now .67, and cat 10 is now 1.67? *tab faminc2div /*next we need to do something similar for local income *what this shows is that if faminc4cat is in one of its middle two categories, then the 5th percentile of incZIPqX is about 15 and the 95th percentile is about 85*/ centile incZIPqX if faminc4cat~=1 & faminc4cat~=4 & faminc4cat~=. & white==1 & djt16~=., centile(5 95) /*So I need to recode incZIPq1 such that a unit increase actually represents moving from category 15 to category 85*/ *gen incZIPq1div=(incZIPq1/100)*1.4285 *okay, now the coefplot svy, subpop(if white==1): reg gop7 faminc2div incZIPq1div svy, subpop(if white==1): reg cons7 faminc2div incZIPq1div svy, subpop(if white==1): reg redist1 faminc2div incZIPq1div svy, subpop(if white==1): reg racelib4 faminc2div incZIPq1div svy, subpop(if white==1): reg f1immlib4 faminc2div incZIPq1div label variable faminc2div "National Income" label variable incZIPq1div "Local Income" set more off svy, subpop(if white==1): reg redist1 faminc2div incZIPq1div est store AllRespondents margins, dydx(*) post est store AllResps svy, subpop(if white==1 & college==1): reg redist1 faminc2div incZIPq1div est store CollegeC margins, dydx(*) post est store College svy, subpop(if white==1 & college==0): reg redist1 faminc2div incZIPq1div est store NoCollegeC margins, dydx(*) post est store NoCollege svy, subpop(if white==1 & male==1): reg redist1 faminc2div incZIPq1div est store MenC margins, dydx(*) post est store Men svy, subpop(if white==1 & male==0): reg redist1 faminc2div incZIPq1div est store WomenC margins, dydx(*) post est store Women svy, subpop(if white==1 & south==1): reg redist1 faminc2div incZIPq1div est store SouthC margins, dydx(*) post est store South svy, subpop(if white==1 & south==0): reg redist1 faminc2div incZIPq1div est store NonSouth margins, dydx(*) post est store NoSouth svy, subpop(if white==1 & bornagain==1): reg redist1 faminc2div incZIPq1div est store BornAgainC margins, dydx(*) post est store BornAgain svy, subpop(if white==1 & bornagain==0): reg redist1 faminc2div incZIPq1div est store NoBornAgainM margins, dydx(*) post est store NoBornAgain svy, subpop(if white==1 & gini2015<.4292): reg redist1 faminc2div incZIPq1div est store LowInequality margins, dydx(*) post est store LowIneq svy, subpop(if white==1 & gini2015>.4292 & gini2015<=.78): reg redist1 faminc2div incZIPq1div est store HighInequality margins, dydx(*) post est store HiIneq svy, subpop(if white==1 & poorst==1): reg redist1 faminc2div incZIPq1div est store PoorStateC margins, dydx(*) post est store PoorState svy, subpop(if white==1 & richst==1): reg redist1 faminc2div incZIPq1div est store RichStateC margins, dydx(*) post est store RichState svy, subpop(if white==1 & lpopdens2015<6.8): reg redist1 faminc2div incZIPq1div est store LowPopDensity margins, dydx(*) post est store LowPopDens svy, subpop(if white==1 & lpopdens2015>=6.8 & lpopdens2015<12): reg redist1 faminc2div incZIPq1div est store HighPopDensity margins, dydx(*) post est store HiPopDens svy, subpop(if white==1 & BlackContext05==1) : reg redist1 faminc2div incZIPq1div est store HiBlackContext margins, dydx(*) post est store HiBlackCont svy, subpop(if white==1 & BlackContext05==0) : reg redist1 faminc2div incZIPq1div est store LoBlackContext margins, dydx(*) post est store LowBlackCont svy, subpop(if white==1 & medinchh2015>53373): reg redist1 faminc2div incZIPq1div margins, dydx(*) post est store RichZIP svy, subpop(if white==1 & medinchh2015<53373): reg redist1 faminc2div incZIPq1div margins, dydx(*) post est store PoorZIP label variable faminc2div "National" label variable incZIPq1div "Local" coefplot College NoCollege Men Women South NoSouth LowIneq HiIneq RichState PoorState LowPopDens HiPopDens HiBlackCont LowBlackCont RichZIP PoorZIP, drop (_cons) scheme(tufte) title("Marginal Effects of Income on Redistributive Preferences") xline(0) name(One, replace) legend(r(4)) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/RedistSubsetPlot.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/RedistSubsetPlot.eps", replace ****Table of Estimates for subset analysis estwide AllRespondents College NoCollege Men Women HighInequality /// LowInequality South NonSouth /// RichState PoorState LowPopDensity HighPopDensity HiBlackCont LowBlackCont RichZIP PoorZIP /// using "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/SubsetEstimates.tex", /// drop(_cons) cells("b(fmt(a2) star)" se(par fmt(2))) label replace mtitles /// title(Subpopulation Regression Estimates from Figure 7) **Local distribution based on NH whites only nhw set more off svyset [pweight=commonweight_post] svy, subpop(if white==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store AllRespsNHW svy, subpop(if white==1 & college==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store CollegeNHW svy, subpop(if white==1 & college==0): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store NoCollegeNHW svy, subpop(if white==1 & male==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store MenNHW svy, subpop(if white==1 & male==0): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store WomenNHW svy, subpop(if white==1 & south==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store SouthNHW svy, subpop(if white==1 & south==0): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store NoSouthNHW svy, subpop(if white==1 & BlackContext05==0): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store LowBlackNHW svy, subpop(if white==1 & BlackContext05==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store HighBlackNHW svy, subpop(if white==1 & gini2015<.4262): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store LowIneqNHW svy, subpop(if white==1 & gini2015>.4262 & gini2015<=.78): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store HiIneqNHW svy, subpop(if white==1 & poorst==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store PoorStateNHW svy, subpop(if white==1 & richst==1): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store RichStateNHW svy, subpop(if white==1 & lpopdens2015<6.92): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store LowPopDensNHW svy, subpop(if white==1 & lpopdens2015>=6.92 & lpopdens2015<12): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store BigPopDensNHW svy, subpop(if white==1 & medinchh2015>53373): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store RichZIPNHW svy, subpop(if white==1 & medinchh2015<53373): reg redist1 faminc2div incnhwZIPq1 margins, dydx(*) post est store PoorZIPNHW label variable faminc2div "National" label variable incnhwZIPq1 "Local" coefplot CollegeNHW NoCollegeNHW MenNHW WomenNHW SouthNHW NoSouthNHW LowBlackNHW HighBlackNHW LittleIneqNHW BigIneqNHW RichStateNHW PoorStateNHW LowPopDensNHW BigPopDensNHW RichZIPNHW PoorZIPNHW, drop (_cons) title("Marginal Effects of Income on Pr(Vote Trump)") xline(0) name(SubsetsNHW, replace) legend(pos(3)) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/RedistSubsetsNHW.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/RedistSubsetsNHW.eps", replace *Appendix Standard approach - bivariate, 16 category *n = 30,937 svyset [pweight=commonweight_post] svy, subpop(if white==1): reg redist1 i.faminc2real margins, at(faminc2real=(1(1)16)) marginsplot, title("National Income") name(BivarFaminc16DJT, replace) /// yscale(titlegap(2) r(.2 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.2 ".2" .3 ".3" .4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc16.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc16.eps", replace **appendix \ref{AppOneBigModel}: One big model svy, subpop(if white==1): reg redist1 faminc2div incZIPq1div college male south gini2015 richst richZIP lpopdens2015 afamp2015 svy: reg redist1 faminc2div incZIPq1div college male south gini2015 richst richZIP lpopdens2015 afamp2015 label variable male "Men" label variable afamp2015 "ZIP \% African American" label variable lpopdens2015 "(Ln) Pop. Density" label variable djtvote2 "DJT Vote (2-party)" label variable richZIP "High-income ZIP Code" estimates store OneBigModel esttab OneBigModel /// using "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/OneBigModel.tex", /// drop( _cons) cells("b(fmt(a2) star) se(par fmt(2))") label replace *Appendix \ref{RegTrivarTable}. table for both measures at once svyset [pweight=commonweight_post] svy, subpop(if white==1): reg redist1 i.faminc4cat i.incZIPq14cat label variable djtvote2 "DJT Vote" label variable faminc4cat "National Income Quartile" reg redist1 i.faminc4cat i.incZIPq14cat if white==1 [pw=commonweight_post] estimates store Trivar esttab Trivar /// using Trivar.tex, /// drop(_cons 1.faminc4cat 1.incZIPq14cat) cells("b(fmt(a2) star)" se(par fmt(2))) pr2 wide label replace *Appendix. Bivariate, Vote-validated only *n = 30,937 svy, subpop(if white==1 & VV==1): reg redist1 i.faminc4cat margins, at(faminc4cat=(1(1)4)) marginsplot, title("National Income and Trump Vote") name(BivarFaminc4DJTVV, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc4VV.png", replace graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/BivarFaminc4VV.eps", replace **Appendix: Same as Figure \ref{TriVar}, but 16-cat set more off svy, subpop(if white==1):reg redist1 i.faminc2real i.incZIPq116catb margins, at(faminc2real=(1(1)16) incZIPq116catb==7) marginsplot, title("National Income") name(MultRegFaminc16DJT, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegFaminc16DJT.png", replace * effect of local income holding national income constant set more off svy, subpop(if white==1): reg redist1 i.faminc2real i.incZIPq116catb margins, at(incZIPq116catb=(1(1)16) faminc2real==7) marginsplot, title("Local Income") name(MultRegLocalInc16DJT, replace) /// yscale(titlegap(2) r(.4 .7)) ytitle("Pr(Trump Vote)") /// ylabel(.4 ".4" .5 ".5" .6 ".6" .7, nogrid) graph export "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/MultRegLocalInc16DJT.png", replace graph combine MultRegFaminc16DJT MultRegLocalInc16DJT, title("Predicted Probability of Voting" "for Trump at Quantiles (16-category) of" "National (Left) and Local Income (Right)") name(CombinedTrivar16, replace) **Appendix tables: Alternate DVs? Alternate IVs? VV? **Alternate DVs: djt16, gop7 set more off use LRNPdata, clear label variable djtvote2 "2-Party" label variable djt16 "All Cands" label variable faminc2 "Nat. 16-cat" label variable natincq1 "Nat. pctile" label variable incdiffZIP "Diff. from ZIP median" label variable incdiffPL "Diff. from Place median" label variable commincq16 "Metro-area percentile" label variable incAreaqN "Nearest-neighbors percentile" svyset [pweight=commonweight] foreach DV in djtvote2 djt16 { foreach absolutemeasure in faminc2 natincq1{ foreach localmeasure in incdiffZIP incdiffPL commincq16 incAreaqN { forvalues vv=0/1{ svy, subpop(if white==1 & VV==1): logit `DV' `absolutemeasure' `localmeasure' est store AllRespondents svy, subpop(if white==1 & college==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store College svy, subpop(if white==1 & college==0 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store NoCollege svy, subpop(if white==1 & male==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store Men svy, subpop(if white==1 & male==0 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store Women svy, subpop(if white==1 & south==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store South svy, subpop(if white==1 & south==0 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store NonSouth svy, subpop(if white==1 & gini2015<.4292 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store LowInequality svy, subpop(if white==1 & gini2015>.4292 & gini2015<=.78 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store HighInequality svy, subpop(if white==1 & poorst==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store PoorState svy, subpop(if white==1 & richst==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store RichState svy, subpop(if white==1 & lpopdens2015<6.8 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store LowPopDensity svy, subpop(if white==1 & lpopdens2015>=6.8 & lpopdens2015<12 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store HighPopDensity svy, subpop(if white==1 & BlackContext05==1 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store HiBlackContext svy, subpop(if white==1 & BlackContext05==0 & VV==`vv'): logit `DV' `absolutemeasure' `localmeasure' est store LowBlackContext **Big table for Latex with Regression coefficients and SEs from subsets local DVlabel: variable label `DV' local absolutemeasurelabel: variable label `absolutemeasure' local localmeasurelabel: variable label `localmeasure' estwide AllRespondents College NoCollege Men Women HighInequality /// LowInequality South NonSouth /// RichState PoorState LowPopDensity HighPopDensity HiBlackContext LowBlackContext /// using "/Users/tko782/Desktop/Northwestern/WorkingFamiliesGlobalCities/BigSurveyAnalyses/LRNP/`DV'X`absolutemeasure'X`localmeasure'XVV`vv'.tex", /// drop(_cons) cells("b(fmt(a2) star)" se(par fmt(2))) label replace mtitles /// title(Subpopulation Regressions, DV=`DVlabel', IVs=`absolutemeasurelabel' and `localmeasurelabel', Vote Validation=`vv') estimates drop AllRespondents College NoCollege Men Women HighInequality /// LowInequality South NonSouth /// RichState PoorState LowPopDensity HighPopDensity HiBlackContext LowBlackContext local drop DVlabel local drop absolutemeasurelabel local drop localmeasurelabel } } } }