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

Did someone manipulate the cutoff? (rddensity)

01
The method workspace

Follow the analysis.

Select a node to explore the method

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

Take the running variable

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

What happens here

Collect the forcing variable (centered so the cutoff is 0).

Reads fromNot specified Feeds into#2
Key code
# Install:  install.packages("rddensity")   # R  ·  pip install rddensity  (Python)
library(rddensity)
set.seed(42)
x <- rnorm(2000, mean = 0, sd = 1)

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 numeric vector of the running (forcing) variable and the cutoff c.

Show data format & exampleHide example
running var x
-0.42
-0.05
0.18
0.77
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 0
01FigureEstimated density of the running variable on each side of the cutoff — overlapping confidence bands at the cutoff mean no manipulation.

Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.

The estimate

T=\dfrac{\hat f_{+}(c)-\hat f_{-}(c)}{\sqrt{\widehat{\mathrm{Var}}}}\ \xrightarrow{\ H_0\ }\ \mathcal N(0,1)

Context & interpretation

⚠️ Unofficial community showcase of rddensity (docs). Not affiliated with the authors — all credit to Matias D. Cattaneo, Michael Jansson & Xinwei Ma; this summarizes public documentation.

What it does. A regression-discontinuity design is only credible if units couldn't precisely manipulate the running variable. rddensity runs the density-continuity (manipulation) test: is there a discontinuity in the density of the running variable exactly at the cutoff?

How it works. It fits local-polynomial density estimators on each side of the cutoff and tests whether they differ there, using a robust bias-corrected statistic. A large p-value supports no manipulation; a small one warns that sorting may invalidate the design. rdplotdensity() draws the two estimated densities.

Assumptions. Smoothness of the density away from the cutoff; the test targets manipulation, a necessary (not sufficient) check for RD validity.

Implements the no-manipulation diagnostic for the RD designs Imbens co-founded; package by Cattaneo, Jansson & Ma.

What you get — A robust manipulation-test statistic and p-value (large p ⇒ no evidence of sorting at the cutoff).

Example output

Manipulation testing using local polynomial density estimation.

Number of obs =       2000
Model =               unrestricted
BWmethod =            comb
Kernel =              triangular

Method                T          P > |T|
Robust              -0.31         0.7541

Links: package · paper

Peer notes

Discuss the workflow (0)

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

Peer discussion