This repository contains replication files for "Network Cluster-Robust Inference."
Coded for Python 3.9.7. Packages used: numpy (v1.20.3), pandas (v1.3.4), scipy (v1.7.1), networkx (v2.6.3), sklearn (v0.24.2), matplotlib (v3.4.3), seaborn (v0.11.2).
The following can be done in any order.
-
Run
spectrum.py
withmake_plot=True
to produce Figure 4 and images for Figure 1. Rerun withmake_plot=False
to produce Table 1. -
Run
design1_size.py
to produce Table 2. Rundesign1_power.py
and thenplot_power_design1.py
to produce Figure 5. -
Download the Paluck et al. (2016) data from ICPSR, extract the contents, and then place the data file
37070-0001-Data.tsv
into this directory. Rundesign2.py
three times, one for each ofnetwork_model = 'RGG'
,'RCM'
,'config'
. Then runtables_design2.py
to produce Table 3.On the server I used, for
RGG
andRCM
,design2.py
completes in less than 24 hours with 32 cores (change theprocesses
argument in the file to set number of cores). Forconfig
, I separated into two runs withnum_schools=[1,2]
and thennum_schools=[4]
, with each completing in less than 24 hours. -
Download the Zacchia (2020) data from the publisher's website. Extract contents into a folder in this directory called 'zacchia'. Run
application.py
to produce Figure 2 and 3.