Package: streetlamp 0.2.0

Mustapha Wasseja

streetlamp: Panel Econometrics for the Effect of Police Stop and Search on Recorded Crime

Builds an area-by-month panel of recorded crime in England and Wales from the data.police.uk bulk archive <https://data.police.uk/data/archive/>, attaches stop and search intensity as a treatment variable, and provides a panel-econometrics toolkit for evaluating policing interventions: two-way fixed effects, event studies, difference-in-differences with staggered adoption, synthetic control, spatial spillover and displacement models, and stop-crime elasticities by offence type. Area boundaries are read from the Office for National Statistics Open Geography Portal <https://geoportal.statistics.gov.uk/>, Census 2021 population from the 'Nomis' API <https://www.nomisweb.co.uk/api/v01/help>, and notes of re-supplied and missing force data from the data.police.uk change log <https://data.police.uk/changelog/>. Every panel carries a contract recording provenance, coverage, geography vintage and treatment definition; every estimator names its identifying assumption and ships with a placebo or pre-trend diagnostic.

Authors:Mustapha Wasseja [aut, cre], Souci Frissa [aut], Sarah Hamed [aut], Black Thrive Global [cph, fnd]

streetlamp_0.2.0.tar.gz
streetlamp_0.2.0.zip(r-4.7-any)streetlamp_0.2.0.zip(r-4.6-any)
streetlamp_0.2.0.tar.gz(r-4.7-any)streetlamp_0.2.0.tar.gz(r-4.6-any)
streetlamp_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
streetlamp/json (API)

# Install 'streetlamp' in R:
install.packages('streetlamp', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/blackthrive/streetlamp/issues

Pkgdown/docs site:https://blackthrive.github.io

On CRAN:

Conda:

3.48 score 60 exports 74 dependencies

Last updated from:261ecb5f0b. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK213
source / vignettesOK222
linux-releaseOK208
windows-develOK191
windows-releaseOK143
wasm-releaseOK141

Exports:lamp_adjacencylamp_adjacency_from_nblamp_allocationlamp_archive_downloadlamp_archive_indexlamp_archive_registerlamp_archive_snapshotlamp_area_lookuplamp_bank_holidayslamp_boundarieslamp_cache_clearlamp_cache_dirlamp_changeloglamp_colourslamp_contractlamp_coveragelamp_coverage_comparelamp_crime_typeslamp_crimes_preventedlamp_deprivationlamp_design_auditlamp_detect_surgeslamp_did_staggeredlamp_displacement_quotientlamp_effect_summarylamp_elasticitylamp_elasticity_robustnesslamp_event_studylamp_forceslamp_list_versionslamp_lsoa_codeslamp_lsoa_lookuplamp_lsoa_vintagelamp_maplamp_outcome_typeslamp_panellamp_placebolamp_populationlamp_pretrendslamp_read_crimelamp_read_outcomeslamp_read_stop_countslamp_reportlamp_revintagelamp_s60_legislationlamp_sample_boundarieslamp_sample_panellamp_select_versionlamp_shockslamp_simulatelamp_simulation_truthlamp_spilloverlamp_synthlamp_tablelamp_themelamp_treatmentlamp_trend_sensitivitylamp_twfelamp_version_difftidy

Dependencies:askpassBHbigmemorybigmemory.sriBMiscbootclassclassIntclicpp11curldata.tableDBIdeldirdiddigestdplyrDRDIDdreamerre1071farverfastglmfixestFormulagenericsggplot2gluegtablehttr2isobandKernSmoothlabelinglatticelifecyclemagrittrMatrixnlmenumDerivopensslpbapplypillarpkgconfigproxypurrrR6RColorBrewerRcppRcppArmadilloRcppEigenrlangs2S7sandwichscalessfspspDataspdepstringistringmagicstringrsystibbletidyrtidyselecttrustunitsutf8uuidvctrsviridisLitewithrwkzoo

Displacement and spillovers
A panel where displacement is real | What ignoring the spillover does | Estimating both effects together | The weighted displacement quotient | Spatial correlation in the residuals

Last update: 2026-11-06
Started: 2026-11-06

Evaluating a stop and search surge
A panel with a known answer | Defining the treatment | Two-way fixed effects | The event study | What the pre-trend test is worth | Placebo tests | Converting to crimes prevented | When adoption is staggered

Last update: 2026-11-06
Started: 2026-11-06

From archive to audited crime panel
The archive is a stack of snapshots, not a database | Reading | Building the panel | The coverage audit | The contract | The bundled sample

Last update: 2026-11-06
Started: 2026-11-06

Research validation: estimands, heterogeneity and empirical credibility
A matching target is part of a valid coverage study | Effects can vary by cohort and exposure duration | Summaries and sensitivity retain uncertainty | Empirical evidence needs a design, not just a coefficient | Reproduce the research evidence

Last update: 2026-11-06
Started: 2026-11-06

Simulation evidence: what each estimator recovers and when it fails
The generator | Each estimator against its own design | Failure one: the wrong estimator for staggered adoption | Failure two: ignoring a spillover | Failure three: treating an allocation response as an effect | Missing force-months are not zeros | Do the intervals mean what they say? | Which estimator when

Last update: 2026-11-06
Started: 2026-11-06

Stop-crime slopes and cross-sectional dependence
Estimate the count mean on an explicit scale | Common correlated effects have a different response scale | Reverse allocation remains an identification question | Converting the estimate requires further assumptions

Last update: 2026-11-06
Started: 2026-11-06

Readme and manuals

Help Manual

Help pageTopics
Spatial adjacency for a set of areaslamp_adjacency
Build an adjacency object from a neighbour listlamp_adjacency_from_nb
How stop and search activity follows recorded crimelamp_allocation
Download force-month files from the data.police.uk archivelamp_archive_download
Index of the data.police.uk archivelamp_archive_index
Register a locally downloaded archive ziplamp_archive_register
Snapshot of the archive files held locallylamp_archive_snapshot
Area hierarchy for 2021 LSOAslamp_area_lookup
Bank holidays in England and Waleslamp_bank_holidays
ONS digital boundaries as an sf layerlamp_boundaries
Location of the streetlamp cachelamp_cache_clear lamp_cache_dir
The data.police.uk changelog as a table of refresh and gap noteslamp_changelog
The colours streetlamp draws withlamp_colours
The panel contractlamp_contract
Coverage audit: which force-months exist, and can be comparedlamp_coverage lamp_coverage_compare
Crime type classification used by data.police.uklamp_crime_types
Convert an estimate into crimes prevented per thousand searcheslamp_crimes_prevented
Small-area deprivation indices for England and Waleslamp_deprivation
Audit the support and assumptions of an intervention designlamp_design_audit
Detect surges in stop and search activitylamp_detect_surges
Difference-in-differences with staggered adoptionlamp_did_staggered
Weighted displacement quotientlamp_displacement_quotient
Summarise effects using their joint covariancelamp_effect_summary
Elasticity of crime with respect to stop and searchlamp_elasticity
Evaluate an explicit elasticity specification gridlamp_elasticity_robustness
Event study around a dated interventionlamp_event_study
Police forces in the data.police.uk archivelamp_forces
List the archive versions of every force-month filelamp_list_versions
ONS LSOA code lists and the 2011 to 2021 lookuplamp_lsoa_codes lamp_lsoa_lookup
Detect whether LSOA codes are 2011 or 2021 vintagelamp_lsoa_vintage
Map a panel column, an area-level estimate or a synthetic control's donorslamp_map lamp_map.lamp_elasticity lamp_map.lamp_estimate lamp_map.lamp_panel lamp_map.lamp_synth
Outcome classification used by data.police.uklamp_outcome_types
Build an area-by-month panel of crime and stopslamp_panel
Placebo tests for a streetlamp estimatelamp_placebo
Census 2021 usual resident population by arealamp_population
Test and interpret pre-trendslamp_pretrends
Read street-level crime records from the archivelamp_read_crime
Read outcome records from the archivelamp_read_outcomes
Count stops by area and monthlamp_read_stop_counts
Build a report on a panel and the estimates made from itlamp_report
Re-vintage LSOA codes between 2011 and 2021lamp_revintage
Legislation label for Section 60 searcheslamp_s60_legislation
The bundled sample panel and boundarieslamp_sample_boundaries lamp_sample_panel
Select one archive version per force-month filelamp_select_version
National policy shocks affecting stop and search or recorded crimelamp_shocks
Simulate a panel with a known treatment effectlamp_simulate
Recover exact expected outcomes from a simulated panellamp_simulation_truth
Own-area and neighbour effects estimated togetherlamp_spillover
Synthetic control for a single treated area or forcelamp_synth
A presentation-ready table from a streetlamp objectlamp_table lamp_table.lamp_coverage lamp_table.lamp_did_staggered lamp_table.lamp_estimate lamp_table.lamp_event_study lamp_table.lamp_pretrends lamp_table.lamp_synth
The ggplot2 theme streetlamp plots uselamp_theme
Define the treatmentlamp_treatment
Sensitivity to a specified differential linear trendlamp_trend_sensitivity
Two-way fixed effects estimate of the effect of stops on crimelamp_twfe
Compare the archive versions of one force-month filelamp_version_diff
Tidy a streetlamp estimatetidy.lamp_estimate