Skip to contents

Data and specifications

sdid_panel()
Declare a long panel for sdidlab
prop99_panel()
California's Proposition 99 as an sdid_panel
sdid_spec()
Build a specification
spec_hash()
A specification's stable identifier
write_spec_yaml() read_spec_yaml() read_specs() write_specs_yaml()
Read and write specifications as YAML
build_setup()
Build the estimator inputs for a specification
resolve_pool()
Resolve a specification's donor pool
register_outcome() register_pool() registered_outcomes() registered_pools()
Register derived outcomes and named donor pools

Fitting

fit_spec()
Fit one specification end to end
run_specs()
Fit a list of specifications
seed_for()
A specification's own seed
save_run() load_run() refresh_runs_index() prune_runs()
Save, load and index fitted runs
write_spec_script()
Write a runnable R script for a set of specifications

Estimators and inference

fit_sdid()
Fit one synthetic-DiD specification and return its full result set
placebo_se_trimmed()
Placebo standard error with poorly-fitting placebos trimmed
adjusted_outcome()
The outcome a synthdid estimate was actually fitted on
project_out_covariates()
Residualise the outcome on covariates using untreated cells only
fit_scm()
Fit a bias-corrected synthetic control
sc_weights_simplex()
Simplex weights minimising a V-weighted predictor discrepancy
scm_placebo_permutation()
Permute treatment in space across every donor
rmspe_pvalue()
Ranked-RMSPE permutation p-value for a synthetic control

Results and plots

sdid_results_table()
Summarise fitted runs as a table
donor_weight_table()
Donor weights, largest first
donor_influence()
What each donor contributes to the estimate and to the standard error
low_weight_units()
Donors carrying almost no weight
plot_sdid_trajectory() plot_gap_path() plot_event_study() plot_donor_weights() plot_lambda_weights() plot_sdid_units() plot_placebo_distribution() plot_placebo_trim() plot_donor_influence() plot_scm_gaps()
Plot a fitted run
plot_att_forest()
Forest plot of several estimates
theme_sdid()
The sdidlab ggplot2 theme

Demo

run_demo()
Launch the interactive demo

Internals

spec_defaults()
Default specification
van_der_corput()
A deterministic low-discrepancy point in [0, 1)
sdidlab sdidlab-package
sdidlab: Specify, Run, Store and Plot Synthetic Difference-in-Differences Models