Skip to content

Instantly share code, notes, and snippets.

@macartan
macartan / structural_model_declared
Last active November 18, 2019 09:39
Wilke Humphreys Bargaining Model
# Replication code for Wilke, Humphreys 2020, Field Experiments, Theory, and External Validity
# The analysis was run using
## R version 3.5.3 (2019-03-11)
## DeclareDesign version 0.18.0
## tidyverse version 1.2.1
## bbmle version 1.0.20
## knitr version 1.22
# Install and load packages -----------------------------------------------
library(DesignLibrary)
library(knitr)
# We are interested in a 5 arm trial with clusters. The 5 arm trial admits 5*4/2 comparisons of arms (10!). Plus one might be interested in various estimands that group arms together in different ways.
# To get going lets look at standard code for a 5 arm trial from the multiarm designer:
# get_design_code(multi_arm_designer(m_arms = 5))
# Now lets base a design off that, but add in clusters. Note that there is an individual level shock and a cluster shock: the ICC is determined by the relative size of these.