Spatial Dynamic Panel Data Modeling in R

Cigarette demand across 46 US states — where space meets habit

99.89%static SDM wins (Bayesian)
−1.23total static price elasticity
τ ≈ 0.86habit persistence dominates

Carlos Mendez

Nagoya University (GSID)

June 11, 2026

The Tension

Act I

When one state raises its cigarette tax, smokers cross the border

A tax hike in one state sends border-county smokers to a cheaper neighbour. So your consumption depends on your neighbours’ — a spatial spillover.

Standard panel methods assume each state stands alone. What do they miss?

A 30-year panel already whispers the answer: states stay where they start

Cigarette sales per capita, 46 US states, 1963–1992. Five states highlighted. Heavy smokers stay heavy; a common downward trend after the late 1970s.

Where we’re going

  • The lab: a 46-state, 30-year panel and a contiguity matrix \(W\)
  • Let the data choose the model — Bayesian comparison across six specifications
  • Static SAR → SDM, with Lee-Yu bias correction
  • Add time: dynamic SDM, habit persistence, and direct/indirect effects
  • The lesson: ignore spillovers or habit, and tobacco-tax conclusions mislead

The Investigation

Act II

The lab: 46 states × 30 years of log-elasticities, neighbours from a \(W\) matrix

  • Outcome\(\log\) cigarette packs per capita (logc), 1,380 balanced observations
  • Treatment-of-interest\(\log\) real price (logp); also \(\log\) real income (logy)
  • Neighbours — the usa46 binary contiguity matrix, row-normalized

Log-log: every coefficient is an elasticity — % change in consumption per % change in price.

Neighbours are sparse: 188 of 2,116 pairs, ~4 neighbours per state

Binary contiguity matrix of 46 US states. Coloured cell = a shared border. Only 8.9% of cells are neighbours.

Six spatial models, one equation — they differ in where space enters

\[y_t = \rho W y_t + X_t \beta + W X_t \theta + u_t, \quad u_t = \lambda W u_t + \epsilon_t\]

  • \(\rho\) — neighbours’ outcomes spill over (SAR)
  • \(\theta\) — neighbours’ covariates spill over (SLX)
  • \(\lambda\) — spatial correlation in the errors (SEM)
  • The SDM keeps \(\rho\) and \(\theta\); OLS sets all three to zero

blmpSDPD() scores every model at once with a log-marginal posterior — no ad-hoc sequence of Wald tests.

Let the data choose: the static SDM wins with 99.89% posterior probability

Posterior model probabilities across three specifications — static individual FE, static two-way FE, dynamic two-way FE.

SDM dominates the static race — but dynamics flatten every model

Specification Top model Prob. Runner-up Prob.
Static, individual FE SDM 99.89% SDEM 0.11%
Static, two-way FE SDM 45.92% SDEM 41.31%
Dynamic, two-way FE SEM 29.84% SAR 25.73%

Once the lagged outcome enters, the spatial signal weakens — the data can no longer tell the spatial models apart.

SAR makes neighbours’ consumption pull your own — ρ = 0.187, highly significant

\[y_t = \rho W y_t + X_t \beta + \mu_i + \gamma_t + \epsilon_t\]

  • Two-way FE: \(\rho = 0.187\), \(t = 6.52\) — a state inherits a fraction of its neighbours’ consumption
  • Price elasticity \(\beta_{\text{logp}} = -0.995\); income \(\beta_{\text{logy}} = 0.464\), both significant
  • With individual FE only, \(\rho\) inflates to 0.298 and price collapses to \(-0.53\) — time trends confound it

Six lines fit a spatial-Durbin panel with Lee-Yu correction in R

data("usa46", package = "SDPDmod")
W <- rownor(usa46)                       # row-normalize the contiguity matrix
mod <- SDPDm(logc ~ logp + logy, data = data1, W = W,
             index = c("state","year"), model = "sdm",
             effect = "twoways", LYtrans = TRUE)   # Lee-Yu bias correction
summary(impactsSDPDm(mod))               # direct / indirect / total

Lee-Yu corrects the small-sample bias, lifting ρ from 0.223 to 0.262

The 46 + 30 = 76 fixed effects create an incidental-parameter bias in spatial ML.

  • Uncorrected SDM: \(\rho = 0.223\) → Lee-Yu: \(\rho = 0.262\) (a 17% upward correction)
  • Slopes barely move (\(\beta_{\text{logp}}\): \(-1.003 \to -1.001\)) — expected with \(T = 30\)

For short panels (\(T < 10\)) the correction would matter far more; here it mainly rescues \(\rho\).

SDM adds neighbours’ covariates — and flips the income spillover negative

Effect logp \(\hat\beta\) logy \(\hat\beta\)
Direct −1.010 0.588
Indirect (spillover) −0.219 −0.197
Total −1.230 0.391

The income spillover is negative (−0.20): richer neighbours pull your consumption down — a channel the SAR cannot see.

Ignore spillovers and you understate the price response by 22%

−1.23

Total static-SDM price elasticity vs a \(-1.01\) direct effect — spillovers add 22%

Cigarettes are habit-forming — so yesterday belongs in the model

\[y_t = \rho W y_t + \tau y_{t-1} + \eta W y_{t-1} + X_t \beta + W X_t \theta + \mu_i + \gamma_t + \epsilon_t\]

  • \(\tau y_{t-1}\) — own past consumption (habit persistence)
  • \(\eta W y_{t-1}\) — neighbours’ past consumption (spatiotemporal diffusion)

A static \(\rho\) must absorb both spatial spillover and serial correlation — so it is biased upward.

Add time and the spatial story shrinks: τ = 0.86 dominates, ρ falls to 0.16

Parameter Static SDM (LY) Dynamic SDM (LY)
\(\tau\) (logc\(_{t-1}\)) 0.864
\(\rho\) (W·logc) 0.262 0.162
\(\beta_{\text{logp}}\) −1.001 −0.271
W·logp 0.091 (n.s.) 0.196 (sig.)

Habit persistence is the dominant force; the static SDM was overstating contemporaneous spatial dependence.

The dynamic SDM uncovers cross-border shopping: W·logp = +0.20, significant

When a neighbour raises its price, your consumption rises — smokers buy more in your now-cheaper state.

  • Static SDM: \(W\cdot\text{logp} = 0.091\), not significant — masked by \(\rho W y\)
  • Dynamic SDM: \(W\cdot\text{logp} = 0.196\), \(t = 4.46\) — the cross-border signal emerges

The spatial lag of consumption hid the effect; only proper dynamics reveal it.

Short-run vs long-run: a 1% price hike cuts demand 0.26% now, 1.93% eventually

Direct, indirect, and total effects of price and income — static SDM vs dynamic SDM short-run and long-run.

The Resolution

Act III

Habit persistence rules: τ ≈ 0.86 dwarfs the spatial coefficient

0.864

Temporal-lag coefficient \(\tau\) in the dynamic SDM (\(t = 67\)) — vs a contemporaneous \(\rho = 0.16\)

Does any of this estimate a causal tax effect? Not without the usual assumptions

Objection. The W·logp coefficient and the impacts read like causal cross-border effects — but the data are observational.

Response. Correct — this is a modeling workflow, not an identified policy experiment.

  • FE strip time-invariant state heterogeneity and common shocks
  • A causal tax elasticity still needs no time-varying confounders
  • And a stable spatial process (\(|\tau + \rho\eta| < 1\))

One dataset, three lessons the workflow makes visible

  • Spillovers are real — total static price elasticity \(-1.23\) is 22% above the direct \(-1.01\)
  • Habit dominates dynamics\(\tau \approx 0.86\); short-run price response is a quarter of the static estimate
  • Cross-border shopping emerges\(W\cdot\text{logp} = +0.20\), only once dynamics are specified

Ignore your neighbours or ignore yesterday, and your tobacco-tax forecast is wrong.