0% found this document useful (0 votes)
18 views

Cheat Sheet: Model Inquiry Data Strategy Answer Strategy

This document provides a cheat sheet for using DeclareDesign, a software tool for designing and evaluating research studies. It outlines DeclareDesign's model-inquiry-data-answer framework and shows how to declare a study's population, potential outcomes, estimands of interest, sampling method, treatment assignment, estimator, and diagnostics. Key functions are demonstrated for declaring each element and putting them together into a full design declaration that can then be diagnosed to evaluate its properties.

Uploaded by

Gerald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Cheat Sheet: Model Inquiry Data Strategy Answer Strategy

This document provides a cheat sheet for using DeclareDesign, a software tool for designing and evaluating research studies. It outlines DeclareDesign's model-inquiry-data-answer framework and shows how to declare a study's population, potential outcomes, estimands of interest, sampling method, treatment assignment, estimator, and diagnostics. Key functions are demonstrated for declaring each element and putting them together into a full design declaration that can then be diagnosed to evaluate its properties.

Uploaded by

Gerald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DeclareDesign: : CHEAT SHEET

Model Inquiry Data Strategy Answer Strategy


What is your model of the world, including how What is the research question you want to answer? How will you generate data to answer your inquiry? How will you generate an answer to your inquiry?
outcomes respond to interventions in the world?
Sampling OLS with robust standard errors
Population Causal inquiries
declare_estimand(
declare_estimator(
declare_sampling(n = 100) Y ~ Z, model = lm_robust)
Define the size of the population, hierarchical ATE = mean(Y_Z_1 - Y_Z_0))
structure (if any), and background variables.
declare_sampling(
Simple dataset with no background variables strata_n = 20, 2SLS instrumental variables regression with
Descriptive inquiries strata = urban_area) robust SEs
pop <- declare_population(N = 100) declare_estimand( declare_estimator(
pop() Y_median = median(Y)) Treatment assignment Y ~ D | Z, model = iv_robust)

Simple dataset with background variables Conditional estimands declare_assignment(m = 100) Difference-in-means
declare_population(N = 100,
declare_estimand( declare_assignment( declare_estimator(
X = rnorm(N))
LATE = mean(Y_Z_1 - Y_Z_0), clusters = villages, Y ~ Z,
subset = complier == TRUE) m = 10) model = difference_in_means)
Two-level dataset

declare_population( DeclareDesign is a software implementation of the MIDA framework, according to which research designs have a Model
schools = of the world, an Inquiry about that model, a Data strategy that generates information about the world, and an Answer
add_level(N = 10,
funding = rnorm(N)), strategy that uses data to make a guess about the Inquiry. Declared designs can be “diagnosed” to calculate the
students = properties of the design such as power and bias using Monte Carlo simulation.
add_level(N = 100,
scores = rnorm(N))
) All declare_* functions return functions. Most functions take a data.frame and return a data.frame.

Outcomes Design Declaration Design Diagnosis


Put together all the steps into a declared design using the + operator Diagnose the properties of your design
Outcomes that depend on a treatment (Z)
Using a formula design <- diagnosis <- diagnose_design(
declare_population(N = 200, X = rnorm(N)) + design, sims = 100, bootstrap_sims = 100)
declare_potential_outcomes( declare_potential_outcomes(Y ~ .5 * Z + X) +
Y ~ .5 * Z + rnorm(N)) declare_estimand(ATE = mean(Y_Z_1 - Y_Z_0)) +
declare_sampling(n = 100) + summary(diagnosis)
As separate variables declare_assignment(m = 50) + get_diagnosands(diagnosis)
declare_estimator(Y ~ Z, model = lm_robust) get_simulations(diagnosis)
declare_potential_outcomes(
Y_Z_0 = rnorm(N), Custom diagnosands
Y_Z_1 = Y_Z_0 + .5) draw_data(design)
draw_estimates(design)
get_estimates(design, data = real_data) diagnose_design(
Outcomes that do not depend on treatment draw_estimands(design) design,
run_design(design) diagnosands = declare_diagnosands(
declare_potential_outcomes( summary(design) sig_pos = mean(p.value < .05 & estimate > 0)))
Y = rnorm(N)) compare_designs(design_1, design_2)

CC BY SA Graeme Blair, Jasper Cooper, Alexander Coppock, Macartan Humphreys and Neal Fultz • declaredesign.org • Learn more at declaredesign.org/r/DeclareDesign • package version 0.18.0 • Updated: 2019-04

You might also like