Estimates how recorded crime responds to the intensity of searching, as a distributed lag of log-one-plus stops with area and month fixed effects. Three methods are offered, differing in how they handle the fact that areas move together.
Arguments
- panel
A
lamp_panelfromlamp_panel().- outcome
The outcome column, for example
"crime_total"or a crime type key fromlamp_crime_types().- stops
The stop intensity column, default
"stops".- lags
Lags of log stops to include, default 0 to 3.
- method
"fe","cce_mg"or"cce_pooled".- cluster
"area"(default) or"force".- min_months
Months an area needs before it enters a mean-group regression.
- family
NULLselects"poisson"forfeand"ols_log"for the CCE methods. Poisson pseudo-likelihood models the conditional count mean, including zeros, with clustered inference. CCE currently supports only"ols_log". Specify"ols_log"to reproduce the former FE scale.
Value
A lamp_estimate of class lamp_elasticity. Coefficients are the
lag-by-lag elasticities; diagnostics$long_run is their sum with a
standard error, diagnostics$cd_test is Pesaran's test, and
diagnostics$area_coefficients holds the per-area slopes for the mean
group estimator. The CD test sums over every pair of areas, so above two
thousand areas it is computed on a random sample of them, drawn with a
fixed seed: cd_test$sampled says whether that happened and
cd_test$n_areas_used how many areas went in.
What an elasticity here is and is not
With family = "poisson", a coefficient describes the log conditional
mean of the count per unit of log(1 + stops). Its elasticity with respect
to stops at intensity S is coefficient * S / (1 + S). With
family = "ols_log", it describes log(1 + observed crime) instead;
this is a different estimand, particularly when counts are small. Neither
is automatically the effect of a decision to search
more. Police send officers where crime is rising, so the association runs
in both directions; lamp_allocation() measures that reverse channel and
should be reported alongside. Read the elasticity as a description of the
joint movement unless the variation in searching has an argued external
source.
Methods
fe: area and month fixed effects only.cce_mg: the common correlated effects mean group estimator. The cross-sectional averages of the outcome and the regressors are added to each area's own time-series regression, and the area coefficients are averaged; the standard error is the spread of those coefficients, which makes no assumption that areas share a slope.cce_pooled: one pooled regression with the same averages added, which is more precise if the slope really is common.
Pesaran's CD test is an auxiliary descriptive diagnostic in every case. It uses OLS residuals of log-one-plus counts with area effects only, including when the primary estimator is Poisson, because month dummies would remove the common factor by construction and make the statistic negative whatever the data looked like. A large statistic flags shared movements; it does not by itself prove that clustered intervals are invalid.
References
Pesaran, M. H. (2006). Estimation and inference in large heterogeneous panels with a multifactor error structure. Econometrica 74(4), 967-1012.
Chudik, A. and Pesaran, M. H. (2015). Common correlated effects estimation of heterogeneous dynamic panel data models with weakly exogenous regressors. Journal of Econometrics 188(2), 393-420.
Examples
sim <- lamp_simulate(n_areas = 30, n_months = 36, design = "continuous", seed = 1)
fit <- lamp_elasticity(sim, "crime_total", lags = 0:1)
fit
#>
#> ── streetlamp estimate: lamp_elasticity
#> Outcome: crime_total; family: Poisson pseudo-likelihood on counts
#> Treatment: continuous; clustered by area
#> Identifying assumption: The association between searching and recorded crime,
#> net of area and month effects. Causal only if the variation in searching has a
#> source outside the crime process; see lamp_allocation().
#> Sample: 1050 area-months in 30 areas; 0 rows dropped for coverage.
#> Term Estimate Std. error 95% CI p
#> ──────────────── ──────── ────────── ──────────────── ──────
#> Log stops, lag 0 −0.17 0.028 [−0.225, −0.115] <0.001
#> Log stops, lag 1 −0.0412 0.0366 [−0.113, 0.0305] 0.260
#> Sum over lags: -0.211 [-0.312, -0.11]
#> Pesaran CD: 2.92 (p = 0.00351), mean pairwise correlation 0.024
fit$diagnostics$cd_test$statistic
#> [1] 2.918753