Skip to content
Switch branches/tags

Code for interference regression adjustments

This repository contains code for producing the simulations and figures found in


The directories cai-data and data serve as placeholder folders for the data.

  • .mat files from the Facebook100 (FB100) dataset should be placed in the data folder. The Facebook100 (FB100) dataset is publicly available from the Internet Archive at and other public repositories.
  • cai-data should contain data from the paper ``Social networks and the decision to insure'' (2015). The data is available for download from the publication website.

Reproducing results and figures

  1. The functions folder contains useful helpers and utilities described as follows:

    • covariate_functions.R contains a few sample functions for generating possible interference features. These are the X(W) functions described in the paper.
    • response_functions.R generates sample outcome models.
    • data_generators.R builds data frames containing realized samples of the data.
    • existing_estimators.R contains common baseline estimators, such as difference-in-means.
    • proposed_estimators.R constructs the adjustment estimators described in the paper.
    • variance_estimators.R builds variance estimators for existing and proposed estimators.
    • precompute_matrices.R contains functionality for precomputing certain covariance matrices which are the same for each simulation run.
  2. The figures directory contains all figures from the paper.

  3. The results directory is a placeholder location for the simulation output stored as csv files.

  4. All remaining top-level files are used to generate the figures:

    • schematic_networks.R generates Figure 1.
    • counterfactual_plots.R generates Figure 2.
    • sim_basic.R generates Table 2.
    • plot_weights.R generates Figure 3.
    • Figures 4 and 5 are generated by sim_lim_analyze.R, which uses the output from sim_lim.R and sim_lim_truth.R.
    • plot_nonlinear_response.R generates Figure 6.
    • sim_nonlinear.R generates Table 3.
    • cai_analyse.R generates Figure 7 and Table 5.


No description, website, or topics provided.







No releases published


No packages published