Code to reproduce analyses in "Issue Alignment and Partisanship in the American Public: Revisiting the 'Partisans without Constraint' Thesis." Scripts should be run in following order.
(1) makeBaldGelData.R Makes main data set of inter-item correlations by year including item-domain indicators
(2) mixedFXsmoothsplines.R Mixed effects smoothing spline model for aggregate trend and graphs results
(3) gamm_by_domain.R Generalized additive mixed effects models for trends by issue domain and graphs results
(4) subgroupData.R Calculates inter-item correlations by demographic subgroup
(5) subgroupGAMM.R Runs GAMMs by issue domain for each subgroup and graphs results
(6) media_boxes16.R Box plots of polarization measures by media engagement and consumption
All published results were produced using R version 3.6.1. Versions of libaries used in model fitting: sme (v1.0.2); gamm4 (v0.2-6); mgcv (v1.8-28); lme4 (v1.1-23).
The scripts reference a top-level (i.e. this level) folder data/, which should store both the raw ANES election file input and the SQLite database created/modified in makeBaldGelData.R and subgroupData.R.
The analyses rely on the American National Election Studies Cumulative Data File (1948-2016) as of December 6, 2018. (ANES_CDF_VERSION:2018-Dec-06)