Skip to main content

9.3. Regression Discontinuity, Kink, Bunching and Marginal Effects

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Methodological Part 9.3. Regression Discontinuity, Kink, Bunching and Marginal Effects in 9. Causal Inference and Modern Policy Evaluation provides step-by-step How-To implementation guides for 7 econometric model lessons spanning from Section 9.3.1 to 9.3.7. Full theoretical derivations are available at VietLOD Part 9.3 alongside cloud execution on EcoLab.

Video Tutorial: How-To Guide for Part 9.3: Regression Discontinuity, Kink, Bunching and Marginal Effects in Stata 18, R 4.x, and Python 3.11+

9.3.1. Methodological Overview and Structural Equations​

  • Methodological Focus: Provides consistent estimation and robust inference for Regression Discontinuity, Kink, Bunching and Marginal Effects specifications within Causal Inference and Modern Policy Evaluation.
  • Mandatory Post-Estimation Diagnostics: Kiểm định mật độ liên tục của biến chạy McCrary / Cattaneo–Jansson–Ma để bác bỏ thao túng điểm số, kiểm định tính liên tục của các biến đồng biến tiền điều trị tại ngưỡng cắt và kiểm tra độ nhạy theo băng thông.

Core structural specification for Part 9.3:

τSRD=lim⁡x↓cE[Yi∣Xi=x]−lim⁡x↑cE[Yi∣Xi=x]\tau_{\text{SRD}} = \lim_{x \downarrow c}\text{E}[Y_i \mid X_i = x] - \lim_{x \uparrow c}\text{E}[Y_i \mid X_i = x]

Estimator objective and moment conditions:

τATT=E[Yit(1)−Yit(0)  |  Di=1],EN[ψ(Wi;τ^,η^)]=0\tau_{\text{ATT}} = \text{E}\left[Y_{it}(1) - Y_{it}(0) \;\middle|\; D_i = 1\right], \quad \text{E}_N\left[\psi\left(W_i; \hat{\tau}, \hat{\eta}\right)\right] = 0
Methodological Scope Boundary:When empirical data violate the identification conditions of Part 9.3, researchers should transition to the extended methodological parts in Chapter 9 or apply appropriate instrumental-variable and cluster-robust corrections.

9.3.2. Econometric Model Lessons in Part 9.3​

9.3.1 · sharp_rdd
9.3.1. Sharp Regression Discontinuity Design

Estimates the Sharp Regression Discontinuity Design specification within the Regression Discontinuity, Kink, Bunching and Marginal Effects f...

Explore Guide
9.3.2 · fuzzy_rdd
9.3.2. Fuzzy Regression Discontinuity Design

Estimates the Fuzzy Regression Discontinuity Design specification within the Regression Discontinuity, Kink, Bunching and Marginal Effects f...

Explore Guide
9.3.3 · rdrobust_sharp_fuzzy
9.3.3. Bias-Corrected Robust Local-Polynomial RDD

Selects data-driven MSE-optimal bandwidths, removes higher-order smoothing bias, and adjusts standard errors for bias-estimation uncertainty...

Explore Guide
9.3.4 · regression_kink_rkd
9.3.4. Sharp and Fuzzy Regression Kink Design

Identifies causal marginal effects from discontinuous slope kinks in continuous policy schedules via local-quadratic derivative jump estimat...

Explore Guide
9.3.5 · bunching_estimator
9.3.5. Saez-Kleven Counterfactual Density Bunching Estimator

Fits an integration-constrained counterfactual polynomial histogram excluding the manipulation window around threshold z* to quantify normal...

Explore Guide
9.3.6 · marginal_treatment_effects
9.3.6. Heckman-Vytlacil Marginal Treatment Effects and Local IV

Estimates the full marginal treatment response schedule across unobserved selection resistance u_D in — 0,1 — via Local IV derivatives of E[...

Explore Guide

9.3.3. Comparative Execution Syntax Across Stata 18, R 4.x, and Python 3.11+​

Section & Model TitleEstimator KeyStata 18 MP SyntaxR 4.x SyntaxPython 3.11+ SyntaxSupport
9.3.1 · Sharp Regression Discontinuity Designsharp_rddrdrobust y x_run, c(0)rdrobust::rdrobust(df$y, df$x_run, c = 0)rdrobust(y=df['y'], x=df['x_run'], c=0)Available
9.3.2 · Fuzzy Regression Discontinuity Designfuzzy_rddrdrobust y x_run, c(0) fuzzy(treat)rdrobust::rdrobust(df$y, df$x_run, c = 0, fuzzy = df$treat)rdrobust(y=df['y'], x=df['x_run'], c=0, fuzzy=df['treat'])Available
9.3.3 · Bias-Corrected Robust Local-Polynomial RDDrdrobust_sharp_fuzzyrdrobust y x_run, c(0) p(1) q(2) kernel(triangular)rdrobust::rdrobust(y = df$y, x = df$x_run, c = 0, p = 1, q = 2)rdrobust(y=df['y'], x=df['x_run'], c=0, p=1, q=2)Available
9.3.4 · Sharp and Fuzzy Regression Kink Designregression_kink_rkdrdrobust y x_run, c(0) deriv(1) p(2) q(3)rdrobust::rdrobust(y = df$y, x = df$x_run, c = 0, deriv = 1, p = 2)rdrobust(y=df['y'], x=df['x_run'], c=0, deriv=1, p=2, q=3)Available
9.3.5 · Saez-Kleven Counterfactual Density Bunching Estimatorbunching_estimatorbunchit z_var, zstar(0) binwidth(0.1) poly(5)bunching::bunchit(z_vector = df$z_var, zstar = 0, binwidth = 0.1, bins_l = 20, bins_r = 20, poly = 5)smf.ols('bin_count ~ z_pow1 + z_pow2 + z_pow3 + excl_window', data=hist_df).fit()Available
9.3.6 · Heckman-Vytlacil Marginal Treatment Effects and Local IVmarginal_treatment_effectsmtefe y x1 x2 (d = z1 z2), polyn(2) bootreps(200)ivmte::ivmte(data = df, target = 'ate', m0 = ~ x1 + u, m1 = ~ x1 + u, propensity = d ~ x1 + z1)smf.ols('y ~ x1 + p_hat + p_hat_sq', data=df).fit(cov_type='HC1')Available

| 9.3.7 · Quantile Regression Discontinuity Design Frandsen Frolich Melly | quantile_rdd_frandsen | sqreg y i.above##c.running, q(0.25 0.50 0.75) | quantreg::rq local linear cutoff interaction | Local bandwidth statsmodels.QuantReg threshold jump estimator | Available |

9.3.4. Standard Implementation Workflow for Part 9.3​

Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco

Download the model-specific .csv practice dataset in Part 9.3 or extract custom empirical panels from EcoData and Finco.

Step 2. Select the Optimal Estimator for Your Error and Sample Structure

Compare the estimators from 9.3.1 to 9.3.7 in the syntax matrix above and execute the estimation in Stata 18 MP, R 4.x, or Python 3.11+.

Step 3. Run Mandatory Diagnostics and Export Publication Tables on EcoLab

Verify all required diagnostics including Kiểm định mật độ liên tục của biến chạy McCrary / Cattaneo–Jansson–Ma để bác bỏ thao túng điểm số, kiểm định tính liên tục của các biến đồng biến tiền điều trị tại ngưỡng cắt và kiểm tra độ nhạy theo băng thông and dispatch the specification to EcoLab for automated journal-grade reporting.