clear all
cd "../data/anes"
use "anes_timeseries_cdf_stata_20220916.dta"
keep if inlist(VCF0004,1994,1996,1998,2000)
svyset VCF0006a [pweight=VCF0009z], vce(linearized)
recode VCF0302 (5=1 "Dem") (2 3 4 8 9=2 "Indep") (1=3 "Rep") (else=.), generate(party)
label variable party "Party ID"
/*
table VCF0302 party, missing
*/
recode VCF0702 (0 1=0 "Non") (2=1 "Voter") (else=.), generate(voter)
recode VCF0717 (0 1=0 "Non") (2=1 "Influencer") (else=.), generate(influencer)
recode VCF0720 (0 1=0 "Non") (2=1 "Influencer") (else=.), generate(displayer)
recode VCF0718 (0 1=0 "Non") (2=1 "Influencer") (else=.), generate(attender)
recode VCF0719 (0 1=0 "Non") (2=1 "Influencer") (else=.), generate(worker)
recode VCF0721 (0 1=0 "Non") (2=1 "Influencer") (else=.), generate(donor)
label variable voter "Voter?"
label variable influencer "(Try to) Influence others?"
label variable displayer "Display buttons/stickers?"
label variable attender "Attend rally/meeting?"
label variable worker "Work on campaign?"
label variable donor "Donate to campaign?"
/*
table VCF0702 voter, missing
table VCF0717 influencer, missing
table VCF0720 displayer, missing
table VCF0718 attender, missing
table VCF0719 worker, missing
table VCF0721 donor, missing
*/
egen activity = rowtotal(voter influencer displayer attender worker donor)
recode activity (0=0) (1=1) (2=2) (3 4 5 6=3 "3+"), generate(r_activity)
label variable activity "Count of activities"
label variable r_activity "Levels of activities"
/*
tab activity r_activity, missing
*/
generate partisan = voter & (influencer | displayer | attender | worker | donor)
label variable partisan "Partisan: voter and engaged in an activity"
/*
tab voter activity, missing
tab partisan voter, missing
tab partisan activity, missing
*/
// Activity - Voting
mean voter, over(party)
// Activity - Persuading others
mean influencer, over(party)
// Activity - Displaying button/stickers
mean displayer, over(party)
// Activity - Attending rally/meeting
mean attender, over(party)
// Activity - Working for party/candidate
mean worker, over(party)
// Activity - Contributing money
mean donor, over(party)
// Overall Activity Score
tab r_activity party, nofreq col
// Republican/3+ is off - 13.6 displayed as 13 instead of 14; probably to force percentages totaling to 100
// Active partisans
mean partisan, over(party)
// Independent is off - 21.0 displayed as 22 instead of 21
// Valid N
tab party