# Replication Package

**Bringing Social Identity Theory Back In: A New Measure of Issue-Based Affective Polarization**

---

## Contents

```
replication/
├── Paper_APSIT_Replication.R    # single script, reproduces everything
├── data/
│   └── Data_polarization_aufbereitet_2.dta
└── output/                             # created by the script
```

## Requirements

R >= 4.2 (developed and tested under R 4.5.1, macOS). The script installs any
missing packages on first run:

`haven`, `tidyr`, `tibble`, `purrr`, `ggplot2`, `patchwork`, `lavaan`,
`semTools`, `psych`, `sandwich`, `lmtest`, `MASS`, `lme4`, `dplyr`

Versions used for the reported results are written to `output/sessionInfo.txt`.

## How to run

Place the script and the `data/` folder in the same directory, then:

```bash
Rscript Paper_APSIT_Replication.R
```

Runtime is roughly 10–20 minutes; the CFA models and the parallel-analysis
plots account for most of it. All console output is mirrored to
`output/console_log.txt`, so nothing needs to be copied by hand.

## Output map

Every table and figure in the paper corresponds to one file in `output/`.

### Main text

| Manuscript | File |
|---|---|
| Table 1 | `Table1_CFA_fit.csv` |
| Table 2 | `Table2_reliability.csv` |
| Table 3 | `Table3_APSIT_descriptives.csv` |
| Figure 1 | `Figure1_validation_combined.pdf` / `.png` |
| Figure 2 | `Figure2_incremental_validity.pdf` / `.png` |
| Figure 3 | `Figure3_group_effects.pdf` / `.png` |

### Appendix

| Manuscript | File |
|---|---|
| Table B1 | `TableB1_loadings.csv` |
| Table B2 | `TableB2_model_comparison.csv` |
| Table C1 | `TableC1_reliability_extended.csv` |
| Figure D1 | `FigureD1_APSIT_distribution.pdf` / `.png` |
| Figure D2 | `FigureD2_aggregation_robustness_validity.pdf` / `.png` |
| Figure D3 | `FigureD3_aggregation_robustness_incremental.pdf` / `.png` |
| Table G1 | `TableG1_sample_descriptives.csv` |
| Tables H1, H2 | `TableH1_H2_convergent_validity.csv` |
| Table H3 | `TableH3_criterion_validity.csv` |
| Tables I1–I4 | `TablesI1_I4_separate_models.csv` |
| Tables J1–J4 | `TablesJ1_J4_full_models.csv` |
| Table J5 | `TableJ5_slope_differences.csv` |
| Figures K1–K4 | `FigK_parallel_*.png` |

### Supplementary output

Reported in the text but not printed as separate tables:

- `TableD_interactions_BH.csv` — Identity × Comparison interactions across all
  20 issue–outcome combinations, Benjamini-Hochberg corrected
- `TableJ_robustness.csv` — alternative specifications (ordered logit,
  multilevel by language region, excluding neutrals, by language region)
- `TableX_aggregation_robustness.csv`, `TableX_aggregation_index_correlations.csv`
  — additive vs. geometric vs. minimum aggregation
- `TablesJ1_J4_summary_incremental.csv` — ΔR² summary behind the incremental-
  validity paragraph
- `*_campcontrol.csv` — variants with camp membership as an additional control

## Notes on specification

**Feeling thermometer.** The thermometer outcome is the ingroup-minus-outgroup
difference index. Higher values indicate greater relative coldness toward the
outgroup, so APSIT coefficients on this outcome are **positive**. No sign
flipping is applied anywhere in the script.

**Subscale means.** Built from at least three valid items per subscale
(`min_valid = 3`), applied consistently in Parts I, II, and III.

**Missing values.** `-77`, `-88`, `-99` are item non-response. In addition,
`99` is a "don't know" code across all issue batteries, including the 0–10
thermometers and self-placements; these are recoded to `NA` in Section 0.5b
with per-family counts and hard range assertions.

**Camp assignment.** Self-placement 0–4 = supporter, 5 = neutral, 6–10 =
opponent. The scale runs from 0 ("strong supporter") to 10 ("strict
opponent"). Section 5 cross-checks this rule against the pre-coded `opp`
variable; a mismatch count above zero would indicate a coding problem.

**Figure 3.** Plotted from the camp-main-effect specification following
Brambor, Clark, and Golder (2006): each model includes a camp main effect
alongside the camp-specific slopes. The plotted coefficients are the
camp-specific slopes; Table J5 reports the opponent-minus-supporter
differences from the equivalent interaction parametrization, with HC3
standard errors.

**Standard errors.** HC3 heteroskedasticity-consistent throughout, except the
multilevel and ordered-logit robustness models, where model-based standard
errors are used and p-values come from a normal approximation.

