Skip to content
No description, website, or topics provided.
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cai-data
data
figures
functions
results
.gitignore
.gitignore~
LICENSE
cai_analyze.R
color_palette.R
counterfactual_plots.R
plot_nonlinear_response.R
plot_weights.R
preprocess_fb.R
readme.MD
schematic_networks.R
sim_basic.R
sim_lim.R
sim_lim_analyze.R
sim_lim_truth.R
sim_nonlinear.R

readme.MD

Code for interference regression adjustments

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

Data

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 https://archive.org/details/oxford-2005-facebook-matrix 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.
You can’t perform that action at this time.