Ring DiD with Geocoded Microdata — Interactive Lab

A pedagogical companion to Difference-in-Differences with Geocoded Microdata: When Distance Defines Treatment ↗ Back to the post

When the "treatment" is a point in space

What happens to home prices when a registered sex offender moves into a neighborhood — and how do we know we measured it right? Linden and Rockoff (2008) compared homes inside one tenth of a mile to homes a little farther away and found a roughly 7.5 % drop. The catch: the answer depends on where you draw the ring. Change the cutoff and the number changes.

This lab lets you turn the dial yourself. In four tabs you will: slide the inner-ring cutoff and watch the headline ATT wobble; run a simulated DGP where the truth is known and watch the parametric estimator bias itself; and compare the parametric headline to the data-driven nonparametric treatment-effect curve.

Three answers, same dataset

On the same 9,092 Linden-Rockoff home sales, three estimators answer slightly different questions:

The orange bar (parametric, 0.1 mi cutoff) is the textbook headline. The teal bar (sample-weighted nonparametric ATT inside 0.1 mi) lets the curve flex and recovers ≈ 2.1× the magnitude. The steel bar (closest bin, ~300 ft) shows where the effect concentrates.

Tab 2

Ring-Choice Lab

Slide the inner-ring cutoff on the real Linden-Rockoff data. Watch the ATT move from −6.4 % to −4.2 % — a 52 % relative spread driven by a single researcher choice.

Tab 3

Simulator

Build a known DGP with a smooth exponential τ(d). Set the true decay and the true treated radius, then watch the parametric ring DiD bias itself when the cutoff is wrong.

Tab 4

Forest Plot

Six estimates from the post, side by side with 95 % CIs: three parametric cutoffs, two leftmost nonparametric bins, and the sample-weighted ATT.

Glossary (open a card if a term is unfamiliar)

Ring DiD
A difference-in-differences design where treated and control are defined by distance to a treatment point, not by policy assignment. Inner ring = treated; outer donut = control.
Parametric ring estimator
A one-line regression of the first-differenced outcome on a "treated ring" indicator. Returns one ATT for the chosen inner ring. One number, lots of ring-choice sensitivity.
Nonparametric ring (binsreg)
Partitions distance into quantile-spaced bins and reports a separate τ̂ in each. Output is a step function over distance — the shape of the effect, not just its average.
Ring choice as estimand
The parameter is the ATT conditional on d ≤ d̄. Change d̄ and you change the question, not just precision. That's why the headline wobbles.
Local parallel trends
Identifying assumption: absent treatment, the average change in inner-ring outcomes would have matched the average change in outer-ring outcomes.
ATT
Average treatment effect on the treated — E[τ(d) | d ≤ d̄]. Depends on d̄, both because of which units are "treated" and which counterfactual trend they're being compared to.
Sample-weighted ATT
When summarising a step function into a scalar, weight by number of observations in each bin. The headline −12.4 % is sample-weighted; bin-equal weight would give −11.4 %.
dt (treated radius)
The maximum distance at which treatment effects are felt. In the simulator we set it; in the real world we don't know it — and pretending we do is the source of the parametric estimator's fragility.

Ring-Choice Lab — slide the cutoff on real data

These numbers come from the Linden-Rockoff sample (9,092 home sales within 1/3 mile of an offender's address). The y-axis is the average price change in log points; we report it as an ATT % on the right. Slide the inner-ring cutoff between 0.05 and 0.15 mile and watch the headline wobble.

Move left for a narrower treated ring (smaller treated sample, more local effect); right for a wider ring.
ATT (log points)
at current cutoff
ATT (% change)
back-transformed
95 % CI
cluster-robust SE
Sample N
7,534
transactions (outer ring fixed)

What to look for

  • The headline moves by 52 %. At cutoff 0.05 the ATT is −6.4 %; at 0.15 it is −4.2 %. Same data, different estimate, no sampling noise involved.
  • The sign is robust. All three cutoffs return a negative coefficient that is (borderline) significant. What changes is the magnitude a reader would walk away with.
  • The standard error shrinks as the cutoff widens. More units in the inner ring → more precision, but you are now averaging over an effect that is concentrated in the closest few hundred feet.

As Butts (2023) puts it: "the choice of 0.1 miles is an untestable assumption." Tab 4 shows what the nonparametric estimator does about it.

Simulator — build a known DGP, then bias the estimator

To judge the estimator fairly, we need a world where the truth is known. Below you build a smooth exponential treatment-effect curve τ(d) = A · exp(−k · d) · 𝟙{d ≤ dt} and then run a parametric ring DiD at a chosen inner-ring cutoff. The closer your cutoff is to the true treated radius dt, the closer the estimate sits to the truth.

How big is the effect right at the offender's address?
Higher k = effect fades faster with distance.
Beyond dt, τ(d) is exactly zero. This is what you would love to know in real life.
Your guess for dt. When d̄ = dt, the parametric estimator is unbiased.
More data = tighter SEs but does not fix the cutoff bias.
Per-unit sampling noise on the first-differenced outcome.
True average τ in [0, dt]
benchmark for the inner ring
τ̂ (your chosen cutoff)
parametric ring DiD
SE(τ̂)
conventional, IID
Bias (τ̂ − truth)
positive = too narrow; negative = too wide

Bias-variance over 100 simulations

Single draws are noisy. Run 100 fresh samples at the current settings to see whether the cutoff bias is systematic.

What to look for

  • Set d̄ = dt. The estimator should land on the true average τ inside the affected region (bias ≈ 0).
  • Push d̄ below dt. The estimate gets bigger (in magnitude) — you are averaging only the steepest part of the τ(d) curve.
  • Push d̄ above dt. The estimate attenuates toward zero — you are absorbing units with zero treatment effect into the "treated" group.
  • Run 100 sims: the histogram should center on a biased number, not on the truth, whenever d̄ ≠ dt. That bias is what the nonparametric estimator (Tab 4) is built to avoid.

Forest plot — the six estimates side by side

These numbers come straight from the post's tables (table_lr_parametric.csv, table_lr_ringchoice.csv, table_lr_nonparametric.csv). Three parametric estimates at different cutoffs, two of the nonparametric bins, and the sample-weighted nonparametric ATT inside 0.1 mile. Hover any point for SE and CI.

Methods

The whole nonparametric curve

All 23 quantile-spaced bins from binsreg on the Linden-Rockoff data, with 95 % CIs. The orange vertical line marks the canonical 0.1-mile cutoff; the curve crosses zero at ≈ 0.094 mile, validating Linden & Rockoff's eyeballed choice as an output of the analysis.

What to look for

  • Parametric estimates are tightly bunched at −4 to −6 %. The headline number "wobbles" but stays in the same neighborhood — all three CIs overlap heavily.
  • Nonparametric bin 1 (−20.6 %) sits 3× below the parametric headline. The post's central methodological point made visible: the parametric estimator averages a steep close-in effect with a near-zero outer-ring effect.
  • The sample-weighted ATT (−12.4 %) sits in between — the most honest summary, because it averages bin estimates by how many transactions live in each bin.
  • In the lower curve, watch where the line crosses zero. It happens between bin 3 and bin 4, around d ≈ 0.094 mi — strikingly close to the 0.1 mi cutoff researchers historically picked by inspection.

Why does the parametric estimator under-state the magnitude?

The parametric ring DiD forces a single coefficient across the entire inner ring (0, 0.1] mile. That single coefficient is the sample-weighted average of all the bin-level effects inside the ring — and the bin-level effects span −20.6 % right at the offender to +0.6 % at the ring's outer edge. Averaging that range pulls the headline closer to zero. The nonparametric estimator avoids the averaging and exposes the concentration of the effect in the closest few hundred feet.