~dricottone/replications

0fa72074f87ccdc995d9c72096db1d10ffb5ef29 — Dominic Ricottone 2 days ago da6b747
Replication of AS08

Replication of Abramowitz, Saunders (2008)

Based on experience with AS04, allowing a small margin of error for
changes to panel data files since 2004.
3 files changed, 541 insertions(+), 0 deletions(-)

A AS08/Figure 3.do
A AS08/Table 1.do
A AS08/explore AS08 timeseries polarization measure.do
A AS08/Figure 3.do => AS08/Figure 3.do +54 -0
@@ 0,0 1,54 @@
clear all
cd "../data/anes"

*do "anes 2004 cumulative infile.do"
*svyset VCF0006A [pweight=VCF0009A], vce(linearized)

use "anes_timeseries_cdf_stata_20220916.dta"
svyset VCF0006a [pweight=VCF0009z], vce(linearized)

capture rename VCF0006a VCF0006A

recode VCF0301 (0=.), generate(party)
recode VCF0803 (0 9=.), generate(libcons)

/*
// Computing directly
forvalues y=1972(2)2004 {
	quietly corr party libcons if VCF0004==`y'
	di "`y' " r(C)[1,2]
}

// Compare Pearson and Spearman correlations
forvalues y=1972(2)2004 {
	quietly spearman party libcons if VCF0004==`y'
	local s=r(rho)
	quietly corr party libcons if VCF0004==`y'
	local p=r(rho)
	di "`y' `p' `s'"
}
forvalues y=2008(4)2020 {
	quietly spearman party libcons if VCF0004==`y'
	local s=r(rho)
	quietly corr party libcons if VCF0004==`y'
	local p=r(rho)
	di "`y' `p' `s'"
}
*/

// Replication
rangestat (corr) party libcons, interval(VCF0004 0 0)
graph twoway line corr_x VCF0004 if 1972<=VCF0004 & VCF0004<=2004, connect(direct) xlabel(1972(4)2004) xmtick(1972(2)2004)

// Replication with a better scale
graph twoway line corr_x VCF0004 if 1972<=VCF0004 & VCF0004<=2004, connect(direct) xlabel(1972(4)2004) xmtick(1972(2)2004) ylabel(0(.5)1) ymtick(0(.1)1)

/*
// Check against direct computations
contract VCF0004 corr_x
browse
*/

// Extension
graph twoway line corr_x VCF0004 if 1972<=VCF0004, connect(direct) xlabel(1972(4)2020) xmtick(1972(2)2020) ylabel(0(.5)1) ymtick(0(.1)1)


A AS08/Table 1.do => AS08/Table 1.do +111 -0
@@ 0,0 1,111 @@
clear all
cd "../data/anes"

*do "anes 2004 cumulative infile.do"
*svyset VCF0006A [pweight=VCF0009A], vce(linearized)

use "anes_timeseries_cdf_stata_20220916.dta"
svyset VCF0006a [pweight=VCF0009z], vce(linearized)

recode VCF0803 (1 2 3=1 "Liberal")   (4 9=2 "Moderate") (5 6 7=3 "Conservative") (else=.), generate(conserv)
recode VCF0830 (1 2 3=1 "Aid")       (4 9=2 "Moderate") (5 6 7=3 "Help self")    (else=.), generate(blackaid)
recode VCF0843 (1 2 3=1 "Decrease")  (4 9=2 "Moderate") (5 6 7=3 "Increase")     (else=.), generate(defspend)
recode VCF0809 (1 2 3=1 "Guarantee") (4 9=2 "Moderate") (5 6 7=3 "Help self")    (else=.), generate(entitlement)
recode VCF0806 (1 2 3=1 "Public")    (4 9=2 "Moderate") (5 6 7=3 "Private")      (else=.), generate(healthins)
recode VCF0839 (1 2 3=3 "Decrease")  (4 9=2 "Moderate") (5 6 7=1 "Increase")     (else=.), generate(govtspend) //NOTE: 'liberal' position is high instead of low
recode VCF0838 (1 2=3 "Illegal")     (3 9=2 "Moderate") (4=1 "Legal")            (else=.), generate(abortlegal) //NOTE: 'liberal' position is high instead of low

label variable conserv "Liberal-conservative identification"
label variable blackaid "Should improve socioeconomic position of blacks?"
label variable defspend "Should increase defense spending?"
label variable entitlement "Should guarantee jobs and std. of living?"
label variable healthins "Should provide health insurance?"
label variable govtspend "Should increase gov't services spending?"
label variable abortlegal "Should abortion be legal?"

egen miss = rowmiss(conserv blackaid defspend entitlement healthins govtspend abortlegal)

label variable miss "Missing count"

recode VCF0004 (1982 1984 1986 1988 1990=1 "80s") (1992 1994 1996 1998 2000=2 "90s") (2002 2004=3 "00s") (else=.), generate(decades_repl)
recode VCF0004 (1982 1984 1986 1988 1990=1 "80s") (1992 1994 1996 1998 2000=2 "90s") (2002 2004 2008=3 "00s") (2012 2016 2020=4 "10s") (else=.), generate(decades) //NOTE: no 2006/2010/2014/2018 studies

label variable decades_repl "Decade bins (replication)"
label variable decades "Decade bins"

/*
tab VCF0004 decades_repl
tab VCF0004 decades
*/

egen libpos = anycount(conserv blackaid defspend entitlement healthins govtspend abortlegal), values(1)
egen conspos = anycount(conserv blackaid defspend entitlement healthins govtspend abortlegal), values(3)
generate polar = abs(libpos - conspos)

label variable libpos "Liberal positions count"
label variable conspos "Conservative positions count"
label variable polar "Polarization scale"

recode polar (0 1=1 "Low") (2 3=2 "Moderate") (4 5 6 7=3 "High"), generate(r_polar)
recode r_polar (1 2=0 "Low to Moderate") (3=1 "High"), generate(hipolar)

label variable r_polar "Polarization bins"
label variable hipolar "High polarization"

recode VCF0702 (1=0 "Non") (2=1 "Voter") (else=.), generate(voter)
capture rename VCF0140a VCF0140A //for 2020 cumulative file
recode VCF0140A (1 2 3 4=1 "No college") (5=2 "Some college") (6 7=3 "College") (else=.), generate(educ)

label variable voter "Voter?"
label variable educ "Educational attainment"

generate elig = miss==0

// Replication
//All Respondents
mean hipolar if elig, over(decades_repl)

//Nonvoters
mean hipolar if elig & voter==0, over(decades_repl)
//Voters
mean hipolar if elig & voter==1, over(decades_repl)

//No College
mean hipolar if elig & educ==1, over(decades_repl)
//Some College
mean hipolar if elig & educ==2, over(decades_repl)
//College Grads
mean hipolar if elig & educ==3, over(decades_repl)

// Extension
//All Respondents
mean hipolar if elig, over(decades)

//Nonvoters
mean hipolar if elig & voter==0, over(decades)
//Voters
mean hipolar if elig & voter==1, over(decades)

//No College
mean hipolar if elig & educ==1, over(decades)
//Some College
mean hipolar if elig & educ==2, over(decades)
//College Grads
mean hipolar if elig & educ==3, over(decades)

// Expansion
//All Respondents
mean hipolar if elig, over(VCF0004)

//Nonvoters
mean hipolar if elig & voter==0, over(VCF0004)
//Voters
mean hipolar if elig & voter==1, over(VCF0004)

//No College
mean hipolar if elig & educ==1, over(VCF0004)
//Some College
mean hipolar if elig & educ==2, over(VCF0004)
//College Grads
mean hipolar if elig & educ==3, over(VCF0004)


A AS08/explore AS08 timeseries polarization measure.do => AS08/explore AS08 timeseries polarization measure.do +376 -0
@@ 0,0 1,376 @@
clear all
cd "../data/anes"

do "anes 2004 cumulative infile.do"
svyset VCF0006A [pweight=VCF0009A], vce(linearized)

*use "08475-0001-Data.dta"
*svyset VCF0006A [pweight=VCF0009Z], vce(linearized)

*use "anes_timeseries_cdf_stata_20220916.dta"
*svyset VCF0006a [pweight=VCF0009z], vce(linearized)

/*
// Conservativism
recode VCF0803 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0803)
recode VCF0824 (1 3 5 9=1 "Yes") (else=0 "No"), generate(has_VCF0824)
egen has_VCF0803_VCF0824 = group(has_VCF0803 has_VCF0824), label(has_VCF0803_VCF0824)
tab VCF0004 has_VCF0803_VCF0824
//VCF0803 available 1972-now; VCF0824 available 1984-now
*/

/*
// Aid to blacks
recode VCF0830 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0830)
tab VCF0004 has_VCF0830
//VCF0830 available 1970-now EXCEPT 2002
*/

/*
// Defense spending
recode VCF0843 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0843)
recode VCF0828 (1 2 9=1 "Yes") (else=0 "No"), generate(has_VCF0828)
egen has_VCF0843_VCF0828 = group(has_VCF0843 has_VCF0828), label(has_VCF0843_VCF0828)
tab VCF0004 has_VCF0843_VCF0828
//VCF0843 available 1980-now EXCEPT 1998,2002,2012; VCF0828 available 1972,1976
*/

/*
// Entitlements
recode VCF0809 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0809)
recode VCF0808 (1 2 9=1 "Yes") (else=0 "No"), generate(has_VCF0808)
egen has_VCF0809_VCF0808 = group(has_VCF0809 has_VCF0808), label(has_VCF0809_VCF0808)
tab VCF0004 has_VCF0809_VCF0808
// VCF0809 available 1972-now EXCEPT 2002; VCF0808 available 1956-1960,1964,1968,2002
*/

/*
// Health insurance
recode VCF0806 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0806)
recode VCF0805 (1 2 9=1 "Yes") (else=0 "No"), generate(has_VCF0805)
egen has_VCF0806_VCF0805 = group(has_VCF0806 has_VCF0805), label(has_VCF0806_VCF0805)
tab VCF0004 has_VCF0806_VCF0805
//VCF0806 available 1970-1972,1976-1978,1984,1988,1992-1996,2000,2004-now; VCF0805 available 1956,1960-1964,1968
*/

/*
// Gov't services spending
recode VCF0839 (1 2 3 4 5 6 7 9=1 "Yes") (else=0 "No"), generate(has_VCF0839)
tab VCF0004 has_VCF0839
//VCF0839 available 1982-now EXCEPT 2002
*/

/*
// Abortion
recode VCF0838 (1 2 3 4 9=1 "Yes") (else=0 "No"), generate(has_VCF0838)
recode VCF0837 (1 2 3 4 9=1 "Yes") (else=0 "No"), generate(has_VCF0837)
egen has_VCF0838_VCF0837 = group(has_VCF0838 has_VCF0837), label(has_VCF0838_VCF0837)
tab VCF0004 has_VCF0838_VCF0837
//VCF0838 available 1980-now EXCEPT 2002; VCF0837 available 1972,1976-1980
*/

recode VCF0803 (1 2 3=1 "Liberal")   (4 9=2 "Moderate") (5 6 7=3 "Conservative") (else=.), generate(conserv)
recode VCF0830 (1 2 3=1 "Aid")       (4 9=2 "Moderate") (5 6 7=3 "Help self")    (else=.), generate(blackaid)
recode VCF0843 (1 2 3=1 "Decrease")  (4 9=2 "Moderate") (5 6 7=3 "Increase")     (else=.), generate(defspend)
recode VCF0809 (1 2 3=1 "Guarantee") (4 9=2 "Moderate") (5 6 7=3 "Help self")    (else=.), generate(entitlement)
recode VCF0806 (1 2 3=1 "Public")    (4 9=2 "Moderate") (5 6 7=3 "Private")      (else=.), generate(healthins)
recode VCF0839 (1 2 3=3 "Decrease")  (4 9=2 "Moderate") (5 6 7=1 "Increase")     (else=.), generate(govtspend) //NOTE: 'liberal' position is high instead of low
recode VCF0838 (1 2=3 "Illegal")     (3 9=2 "Moderate") (4=1 "Legal")            (else=.), generate(abortlegal) //NOTE: 'liberal' position is high instead of low

label variable conserv "Liberal-conservative identification"
label variable blackaid "Should improve socioeconomic position of blacks?"
label variable defspend "Should increase defense spending?"
label variable entitlement "Should guarantee jobs and std. of living?"
label variable healthins "Should provide health insurance?"
label variable govtspend "Should increase gov't services spending?"
label variable abortlegal "Should abortion be legal?"

/*
table VCF0803 conserv, missing
table VCF0830 blackaid, missing
table VCF0843 defspend, missing
table VCF0809 entitlement, missing
table VCF0806 healthins, missing
table VCF0839 govtspend, missing
table VCF0838 abortlegal, missing
*/

generate coll = 7
replace coll = 6 if VCF0004==1982 | VCF0004==1986 | VCF0004==1990 | VCF0004==2012
replace coll = 5 if VCF0004==1980 | VCF0004==1998
replace coll = 4 if VCF0004==1972 | VCF0004==1976 | VCF0004==1978
replace coll = 3 if VCF0004==1974
replace coll = 2 if VCF0004==1970
replace coll = 1 if VCF0004==2002
replace coll = 0 if VCF0004<1970

label variable coll "Collected count"

/*
tab VCF0004 coll
*/

egen miss = rowmiss(conserv blackaid defspend entitlement healthins govtspend abortlegal)
egen dk = anycount(VCF0803 VCF0830 VCF0843 VCF0809 VCF0806 VCF0839 VCF0838), values(9)

label variable miss "Missing count"
label variable dk "Don't know count"

/*
tab VCF0004 miss
tab VCF0004 dk
table VCF0803 dk, missing
table VCF0830 dk, missing
table VCF0843 dk, missing
table VCF0809 dk, missing
table VCF0806 dk, missing
table VCF0839 dk, missing
table VCF0838 dk, missing
*/

recode VCF0004 (1982 1984 1986 1988 1990=1 "80s") (1992 1994 1996 1998 2000=2 "90s") (2002 2004=3 "00s") (else=.), generate(decades)

label variable decades "Decade bins"

/*
tab VCF0004 decades
*/

egen libpos = anycount(conserv blackaid defspend entitlement healthins govtspend abortlegal), values(1)
egen conspos = anycount(conserv blackaid defspend entitlement healthins govtspend abortlegal), values(3)
generate polar = abs(libpos - conspos)

label variable libpos "Liberal positions count"
label variable conspos "Conservative positions count"
label variable polar "Polarization scale"

/*
tab libpos conspos
tab polar if miss<6
//At minimum, need two data points for there to be 'distance' or 'variance'
*/

recode polar (0 1=1 "Low") (2 3=2 "Moderate") (4 5 6 7=3 "High"), generate(r_polar)
recode r_polar (1 2=0 "Low to Moderate") (3=1 "High"), generate(hipolar)

label variable r_polar "Polarization bins"
label variable hipolar "High polarization"

/*
tab libpos hipolar
tab conspos hipolar
tab hipolar
tab hipolar if miss<6
tab hipolar if miss<4
//At minimum, need 4 data points for there to be 'high polarization' by this definition
*/

recode VCF0702 (1 0 .=0 "Non") (2=1 "Voter") (else=.), generate(voter) //0 in 2020 cumulative file, missing in 2004 cumulative file
capture rename VCF0140a VCF0140A //for 2020 cumulative file
recode VCF0140A (1 2 3 4=1 "No college") (5=2 "Some college") (6 7=3 "College") (else=.), generate(educ)

label variable voter "Voter?"
label variable educ "Educational attainment"

/*
table VCF0702 voter, missing
table VCF0140A educ, missing
//VCF0140 is a 6-level measure, but there is an undocumented 7th level in the 2004 cumulative file for 2004 data. For levels 1-5, counts match between this and later cumulative files. Seems fair to assume that the 7th level should have been collapsed into the 6th level. So: use the 7-level measure (VCF0140A) instead.
*/

generate elig = miss==0

/*
tab VCF0004 elig
//This is an effective removal of all data from 1982, 1986, 1990, 1998, and 2002
*/

//All Respondents
mean hipolar if elig, over(decades)

//Nonvoters
mean hipolar if elig & voter==0, over(decades)
//Voters
mean hipolar if elig & voter==1, over(decades)

//No College
mean hipolar if elig & educ==1, over(decades)
//Some College
mean hipolar if elig & educ==2, over(decades)
//College Grads
mean hipolar if elig & educ==3, over(decades)

/* With 2004 cumulative file
. mean hipolar if elig, over(decades)

Mean estimation                              Number of obs = 10,345

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2443163   .0079164      .2287985     .259834
             90s  |    .290683   .0056969       .279516    .3018501
             00s  |   .3323755   .0145861      .3037839     .360967
-------------------------------------------------------------------

. 
. //Nonvoters
. mean hipolar if elig & voter==0, over(decades)

Mean estimation                               Number of obs = 3,432

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .1761252   .0119214      .1527514    .1994991
             90s  |   .1965186   .0085067      .1798398    .2131973
             00s  |   .1982379   .0265193      .1462427    .2502331
-------------------------------------------------------------------

. //Voters
. mean hipolar if elig & voter==1, over(decades)

Mean estimation                               Number of obs = 6,913

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2805195   .0102421      .2604418    .3005971
             90s  |   .3399664   .0073356      .3255865    .3543464
             00s  |    .369645   .0168982      .3365194    .4027707
-------------------------------------------------------------------

. 
. //No College
. mean hipolar if elig & educ==1, over(decades)

Mean estimation                               Number of obs = 5,212

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .1863501   .0094888      .1677481    .2049522
             90s  |   .2044728   .0072101       .190338    .2186077
             00s  |   .2141058   .0206134       .173695    .2545166
-------------------------------------------------------------------

. //Some College
. mean hipolar if elig & educ==2, over(decades)

Mean estimation                               Number of obs = 2,517

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2914201   .0174905      .2571229    .3257174
             90s  |   .3187831   .0119883      .2952751     .342291
             00s  |    .331307   .0259891      .2803447    .3822693
-------------------------------------------------------------------

. //College Grads
. mean hipolar if elig & educ==3, over(decades)

Mean estimation                               Number of obs = 2,473

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |    .369287   .0206539      .3287863    .4097877
             90s  |   .4421642    .012389      .4178702    .4664581
             00s  |   .4811321   .0280628      .4261031    .5361611
-------------------------------------------------------------------
*/
/* With 2020 cumulative file
. //All Respondents
. mean hipolar if elig, over(decades)

Mean estimation                              Number of obs = 10,345

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2443163   .0079164      .2287985     .259834
             90s  |    .290683   .0056969       .279516    .3018501
             00s  |   .3256705   .0145105      .2972271    .3541139
-------------------------------------------------------------------

. 
. //Nonvoters
. mean hipolar if elig & voter==0, over(decades)

Mean estimation                               Number of obs = 3,432

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .1761252   .0119214      .1527514    .1994991
             90s  |   .1965186   .0085067      .1798398    .2131973
             00s  |   .1894273   .0260653      .1383222    .2405324
-------------------------------------------------------------------

. //Voters
. mean hipolar if elig & voter==1, over(decades)

Mean estimation                               Number of obs = 6,913

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2805195   .0102421      .2604418    .3005971
             90s  |   .3399664   .0073356      .3255865    .3543464
             00s  |   .3635251   .0168389      .3305157    .3965344
-------------------------------------------------------------------

. 
. //No College
. mean hipolar if elig & educ==1, over(decades)

Mean estimation                               Number of obs = 5,116

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .1863501   .0094888       .167748    .2049523
             90s  |   .1990115   .0072484      .1848015    .2132216
             00s  |    .209596   .0204794      .1694475    .2497444
-------------------------------------------------------------------

. //Some College
. mean hipolar if elig & educ==2, over(decades)

Mean estimation                               Number of obs = 2,613

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |   .2914201   .0174905      .2571235    .3257168
             90s  |   .3223398   .0116625      .2994712    .3452084
             00s  |   .3151515   .0256129      .2649279    .3653752
-------------------------------------------------------------------

. //College Grads
. mean hipolar if elig & educ==3, over(decades)

Mean estimation                               Number of obs = 2,473

-------------------------------------------------------------------
                  |       Mean   Std. err.     [95% conf. interval]
------------------+------------------------------------------------
c.hipolar@decades |
             80s  |    .369287   .0206539      .3287863    .4097877
             90s  |   .4421642    .012389      .4178702    .4664581
             00s  |   .4811321   .0280628      .4261031    .5361611
-------------------------------------------------------------------
*/