This repository contains replication materials for "Political Appointments and Outcomes in Federal District Courts" by Ryan Hübert and Ryan Copus, which is forthcoming in the Journal of Politics.
Copies of these replication files, as well as the associated datasets, are available at:
- the Journal of Politics Dataverse at https://doi.org/10.7910/DVN/HUYOHI, and
- a GitHub repository maintained by the corresponding author at https://github.com/ryanhubert/political-appointments-hubert-copus
Download a pre-print version of the manuscript and online appendix at the website of the corresponding author listed at the bottom of this README file.
The analysis for this article was conducted on a macOS machine (version 11.1,
Big Sur) in both python
(version 3.7.3) and R
(version 4.0.3). The file
requirements.txt
indicates which python
modules you must install
to replicate the analysis. You must also have several libraries available in
R
, including tidyverse
, estimatr
and several libraries used to make plots
(as well as any required dependencies).
Note that the h2o
package used in the analysis may require additional
installation steps, see:
https://docs.h2o.ai/h2o/latest-stable/h2o-docs/downloading.html#install-in-python
Please refer to the article and the online appendix for detailed information about the data collection and cleaning.
In the article, we analyze two datasets:
-
USDC-DATASET-JOP.csv
contains civil rights cases filed in seven U.S. District Courts between 1995 and 2016. (Note: for one district we only have data from 1996 to 2015.) -
USDC-APPEALS-JOP.csv
contains all civil rights appeals filed in the U.S. Court of Appeals for the Ninth Circuit between 1996 and 2012.
We provide codebooks for the variables in each dataset: see
codebook-main.txt
and codebook-appeals.txt
.
The archived version of the original dataset compiled for use on this project is available in the Journal of Politics Dataverse at https://doi.org/10.7910/DVN/HUYOHI.
To replicate the analysis, you should start by creating a working directory on your local machine, downloading the replication files from this GitHub repository (or from the copy available in the Harvard Dataverse at the link listed above) and moving the replication files into your working directory.
Then, you should open each python
and R
script and insert the full path to
your working directory as a character string that defines the variable root
.
Then, you can execute the following scripts in this order:
-
01_Preprocess.R
: ThisR
script does some minimal cleaning the dataset consistent with the description in the article and online appendix. It also defines a function that implements a procedure used to run the regression model described in the article (see equation (1) in the main text). -
02_Predictions.py
: Thispython
script implements the machine learning balance test described in the article for both our main analysis of the district courts, as well as our auxiliary analysis of the Ninth Circuit. (See the Special Note below.) -
03_Analysis_Appeals.py
: Thispython
script conducts the auxiliary analysis on the Ninth Circuit dataset that is discussed in article. (See the Special Note below.) -
04_Analysis_Main.R
: ThisR
script conducts the statistical analyses from the article and the online appendix, and generates the corresponding figures in the paper and online appendix. -
05_Outputs.R
: ThisR
script imports the results generated from the previous scripts and generates tables and figures for the article and online appendix.
Each script contains detailed comments describing the various steps in the analysis and should be straight-forward to execute.
Special Note: In this repository, we have included copies of the csv
files
that are generated by the replication files 02_Predictions.py
and
03_Analysis_Appeals.py
. They can be found in the directory named Analysis
.
While any user can reproduce these csv
files by executing these two scripts,
the process takes some time. We include copies of these csv
files in our
replication directory in the event that a user wishes to skip steps 2 and 3
of the replication process.
If you have any comments or questions about these replication files, please contact Ryan Hübert (the corresponding author) using the contact information on his website: https://ryanhubert.com/.