Convert an estimate into crimes prevented per thousand searches
Source:R/est-costbenefit.R
lamp_crimes_prevented.RdTakes an elasticity or a treatment effect and expresses it as the number of crimes prevented per thousand searches at the sample mean, which is the form in which the question is usually asked. The conversion is arithmetic, not evidence: it inherits every assumption of the estimate it is given, and adds more of its own. The assumption chain is returned with the number and printed with it.
Usage
lamp_crimes_prevented(
estimate,
panel,
per_stops = 1000,
stops_added = NULL,
outcome_column = NULL,
n_boot = 2000,
seed = NULL
)Arguments
- estimate
A
lamp_estimatefromlamp_elasticity(),lamp_twfe(),lamp_did_staggered()orlamp_event_study().- panel
The panel the estimate was built from, for the sample means.
- per_stops
Searches to express the result per, default 1000.
- stops_added
For a treatment effect: the searches the intervention added per area-month. Required unless the estimate is an elasticity.
- outcome_column
The crime column to take the mean of; defaults to the estimate's outcome.
- n_boot
Retained for compatibility. Intervals now transform the coefficient interval directly and require no simulation.
- seed
Retained for compatibility; the conversion is deterministic.
Value
A list of class lamp_crimes_prevented with crimes_prevented,
conf_low, conf_high, the inputs used, and assumptions, a character
vector naming every step from the estimate to the number.
Details
For an elasticity e, a proportional change in searches dS/S changes
crime by e * dS/S, so at mean monthly crime C and mean searches S the
crimes prevented by an extra per_stops searches are
-e * C * per_stops / S. The elasticity estimators use log(1 + stops),
so their derivative has denominator S + 1. The count-mean model uses
C in the numerator; the legacy log-one-plus outcome approximation uses
C + 1. For a treatment effect in log points b, the
effect on crime is C * (exp(b) - 1), and it is divided by the searches
the intervention actually added, which you must supply as stops_added
because a binary treatment does not say how much searching it involved.
What this number does not include
It counts recorded crime only, so crimes not reported to the police are invisible to it, and any change in recording practice is counted as a change in crime. It assumes the effect is linear in searches over the range considered, and that the average effect applies at the margin, which is the opposite of what diminishing returns implies. It says nothing about the costs of searching, which fall on the people searched.
Examples
sim <- lamp_simulate(n_areas = 30, n_months = 30, design = "continuous", seed = 1)
el <- lamp_elasticity(sim, "crime_total", lags = 0:1)
lamp_crimes_prevented(el, sim)
#>
#> ── Crimes prevented per 1000 searches
#> 90.2 [-0.615, 181] on crime_total
#>
#> ── Assumption chain
#> 1. The log-one-plus stops slope is -0.0982, summed over lags 0, 1.
#> 2. The denominator is mean stops plus one; legacy OLS also uses mean crime plus
#> one.
#> 3. The effect is proportional, so it scales with the mean level of crime.
#> 4. At the sample mean of 7.12 crimes and 6.76 searches per area-month.
#> 5. 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().
#> 6. Recorded crime only: unreported crime and recording changes are not
#> separated.
#> 7. The average effect is applied at the margin, which ignores diminishing
#> returns.