Replication Files
Chapter-by-chapter code and results for Parts III and IV of Electoral System Incentives for Interparty and Intraparty Politics
Chapter-by-chapter code and results for Parts III and IV of Electoral System Incentives for Interparty and Intraparty Politics
Each chapter of Parts III and IV — chapters 5 through 14 — has a page of its own. A chapter page reproduces every table and figure in that chapter, shows the code that produced it, and explains what the code is doing. The explanations assume no prior knowledge of R: they are written for readers who want to follow the reasoning, not only inspect the output.
Code is hidden or shown with the Code button at the top right of each page, so a chapter can be read either as an account of the analysis or as a working script.
In preparing these materials we re-examined the code behind every table and figure, and found two mistakes that survived into print. Both are described here and again on the chapter pages themselves. In each case the published result is reproduced as published, with the correction presented alongside it rather than quietly in its place, so readers can see exactly what changed.
When simulating expected values, five model runs should each have used an imposed value of the Total Duvergerian Effect. Because a set of columns was selected by position rather than by name, one of the five runs used the observed values instead.
In Model 3 of Table 12.1, a term intended to express committees per legislator was placed outside the model formula. In that position R read it not as an offset but as a set of observation weights, so the published model weights each legislature by the size of its chamber instead of modelling a rate.
The predicted scores for the Total Duvergerian Effect and Average Personalism were revised during the project, and the later version covers slightly more elections. Chapters 6 through 11 use the later scores. Chapter 12 uses the earlier ones, because that is what the published Table 12.1 was computed from, and because that chapter uses the scores directly as explanatory variables. Chapter 12 also re-runs its first half on the later scores, so readers can see that its conclusions do not depend on the choice.
Some steps of the analysis draw random numbers without fixing a starting point, so they give slightly different results each time they run. This affects the appearance of three figures in chapter 6, where overlapping points are nudged apart to keep them visible, and the confidence bands of Figure 9.5. Everything else reproduces exactly, and no substantive quantity is affected.
The analysis, the outline and a large part of the commentary are the authors' own. After the book was in print we also used Anthropic's Claude (model Opus 5) to check the integrity of the code, to annotate it so that readers can follow the reasoning, and to help prepare these pages. The two corrections described above came out of that review.
The R Markdown source behind these pages, together with the datasets needed to run it, is available at github.com/i3dataset/i3-replication. Each chapter page here corresponds to one file in that repository.
Every chapter page ends with a record of the software used to produce it — the version of R and of each package — so that a reader who obtains a different result can tell that apart from using different software.