Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 027
Research workflow/4 steps

Design & diagnose a randomized experiment (DeclareDesign)

Source DeclareDesign — Blair, Cooper, Coppock & Humphreys
01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 4 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 4
01
Data prep

Declare the model & potential outcomes

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Define units and the science: each unit's outcomes under treatment and control.

Formula
Y_i = Z_i\,Y_i(1) + (1-Z_i)\,Y_i(0),\qquad \tau=\mathbb{E}[\,Y_i(1)-Y_i(0)\,]
Reads fromNot specified Feeds intoNot specified
Key code
declare_model(N = 200, potential_outcomes(Y ~ 0.2 * Z + U))

Reference / docs ↗

Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

A planned experiment: sample size, treatment assignment, potential-outcome model, and the estimand you care about.

Show data format & exampleHide example

Format — declare units, potential outcomes, assignment, and the inquiry.

library(DeclareDesign)
des <- declare_model(N=200, potential_outcomes(Y ~ 0.2*Z + U)) +
       declare_inquiry(ATE = mean(Y_Z_1 - Y_Z_0)) +
       declare_assignment(Z = complete_ra(N)) +
       declare_estimator(Y ~ Z, inquiry='ATE')
03
Read the evidence

Results & interpretation

Workflow discussion 0
Context & interpretation

⚠️ Unofficial community showcase of declaredesign. Not affiliated with the authors; all credit to them.

Specify a study as model–inquiry–data–answer, simulate it, and read its diagnosands — bias, power, coverage — before you run it.

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion