*! version 2.2.1 01Feb2026

Title

rddid -- Difference-in-Discontinuities Estimation based on rdrobust

Syntax

rddid depvar runvar [if] [in] , group(varname) [options]

group(varname) Variable indicating treatment (1) vs control (0) group; required.

c(#) RD cutoff for the running variable (default 0).

bw(string) Bandwidth selection method: common (default) or independent.

bwselect(string) Bandwidth selector: mserd (default), msetwo, cerrd, etc.

h(numlist) Manually specify bandwidths. Accepts 1, 2, or 4 numbers to control symmetric or asymmetric bandwidths per group.

est(string) Estimation type: robust (default), conventional, or biascorrected.

bootstrap Request bootstrapped standard errors (default is analytic).

reps(int) Number of bootstrap replications (default 50).

seed(int) Set random-number seed before bootstrap.

rdrobust_options Any other options (e.g., vce(hc1), kernel(...)) are passed directly to rdrobust.

Description

rddid performs a Difference-in-Discontinuities estimation. It estimates the discontinuity in depvar at the cutoff of runvar for a Treated group and subtracts the discontinuity found in a Control group.

It relies on rdrobust for underlying estimation and bandwidth selection.

Without the bootstrap option, analytic standard errors are computed assuming independence between groups.
This assumption is appropriate when groups correspond to distinct units (e.g., different countries or boundaries).
When groups share the same units (e.g., panel pre/post), use bootstrap to obtain valid standard errors.

Options

group(varname) specifies the binary variable defining the groups. 1 must indicate the Treated/Post group, and 0 must indicate the Control/Pre group.

c(#) specifies the RD cutoff for the running variable. The default is 0.

bw(string) specifies how bandwidths are calculated if h() is not used. common calculates the optimal bandwidth for the Treated group and applies it to the Control group. independent calculates separate optimal bandwidths for each group.

bwselect(string) specifies the bandwidth selector used by rdbwselect. The default is mserd (MSE-optimal, common). Other options include msetwo (MSE-optimal, two different), cerrd (CER-optimal, common), and certwo (CER-optimal, two different). Only relevant when h() is not specified.

h(numlist) allows manual specification of bandwidths. If specified, this overrides bw(). It accepts three formats:

* 1 number (e.g., h(5)): Sets a symmetric bandwidth of 5.0 for both Treated and Control groups.

* 2 numbers (e.g., h(5 10)): Sets a symmetric bandwidth of 5.0 for the Treated group and 10.0 for the Control group.

* 4 numbers (e.g., h(1 2 3 4)): Sets fully asymmetric bandwidths. Treated group uses 1 (Left) and 2 (Right). Control group uses 3 (Left) and 4 (Right).

est(string) selects the estimation type. The default is robust, which uses bias-corrected point estimates with robust standard errors following Calonico, Cattaneo, and Titiunik (2014). conventional uses conventional point estimates and standard errors. biascorrected uses bias-corrected point estimates with conventional standard errors. Can be abbreviated as est().

bootstrap calculates standard errors using a bootstrap procedure. If this is not specified, the command calculates analytic standard errors assuming independence between the two groups. When combined with vce(cluster varname), the bootstrap resamples whole clusters rather than individual observations (cluster bootstrap). In the analytic path, vce() is passed directly to rdrobust.

reps(int) specifies the number of bootstrap replications. The default is 50. This option is only relevant when bootstrap is specified.

seed(int) sets the random-number seed before the bootstrap loop, ensuring reproducible results. This option is only relevant when bootstrap is specified.

rdrobust_options allow you to customize the underlying estimation. For example, you can pass vce(cluster id) to cluster standard errors within each group's RD estimation, or covs(varlist) to include covariates.

Examples

1. Standard estimation (Common bandwidth, analytic SEs)

. rddid outcome score, group(treated)

2. Non-zero cutoff

. rddid outcome score, group(treated) c(50)

3. Independent bandwidths for Treated and Control groups

. rddid outcome score, group(treated) bw(independent)

4. Manual asymmetric bandwidths (Treated: 5 Left/10 Right; Control: 5 Left/5 Right)

. rddid outcome score, group(treated) h(5 10 5 5)

5. Bootstrapped standard errors (200 reps, reproducible)

. rddid outcome score, group(treated) bootstrap reps(200) seed(12345)

6. Bootstrapped standard errors with cluster resampling

. rddid outcome score, group(treated) bootstrap reps(200) vce(cluster id)

7. Conventional estimation (non-bias-corrected)

. rddid outcome score, group(treated) est(conventional)

8. CER-optimal bandwidth selector

. rddid outcome score, group(treated) bwselect(cerrd)

Saved Results

rddid stores the following in e():

Scalars

e(N) total sample size

e(N_t) sample size for Treated group

e(N_c) sample size for Control group

e(tau_t) RD estimate for Treated group

e(se_t) standard error for Treated group (analytic only)

e(tau_c) RD estimate for Control group

e(se_c) standard error for Control group (analytic only)

e(h_t_l) bandwidth for Treated group (left of cutoff)

e(h_t_r) bandwidth for Treated group (right of cutoff)

e(h_c_l) bandwidth for Control group (left of cutoff)

e(h_c_r) bandwidth for Control group (right of cutoff)

e(cutoff) RD cutoff value

e(bs_reps) number of bootstrap replications requested (bootstrap only)

e(bs_good) number of successful bootstrap replications (bootstrap only)

Macros

e(cmd) rddid

e(bw_type) bandwidth selection method (common or independent)

e(estimation) estimation type (robust, conventional, or biascorrected)

e(vce) bootstrap or analytic

e(depvar) name of dependent variable

e(runvar) name of running variable

e(group) name of group variable

Matrices

e(b) the Difference-in-Discontinuities estimate

e(V) variance matrix of the estimate

e(bs_dist) vector of bootstrap replicate estimates (bootstrap only)

Also see

rddidplot — postestimation command for side-by-side RD plots

Author

Jonathan Dries

LUISS Guido Carli University

Email: jvdries@luiss.it