Package index
Ingest
Acquire force-month files from the data.police.uk archive without downloading whole snapshots, choose one version per force-month, and read crime, outcome and stop-count tables that carry a panel contract.
-
lamp_archive_download() - Download force-month files from the data.police.uk archive
-
lamp_archive_index() - Index of the data.police.uk archive
-
lamp_archive_register() - Register a locally downloaded archive zip
-
lamp_archive_snapshot() - Snapshot of the archive files held locally
-
lamp_list_versions() - List the archive versions of every force-month file
-
lamp_lsoa_vintage() - Detect whether LSOA codes are 2011 or 2021 vintage
-
lamp_read_crime() - Read street-level crime records from the archive
-
lamp_read_outcomes() - Read outcome records from the archive
-
lamp_read_stop_counts() - Count stops by area and month
-
lamp_s60_legislation() - Legislation label for Section 60 searches
-
lamp_select_version() - Select one archive version per force-month file
-
lamp_version_diff() - Compare the archive versions of one force-month file
-
lamp_adjacency() - Spatial adjacency for a set of areas
-
lamp_adjacency_from_nb() - Build an adjacency object from a neighbour list
-
lamp_boundaries() - ONS digital boundaries as an sf layer
-
lamp_changelog() - The data.police.uk changelog as a table of refresh and gap notes
-
lamp_coverage()lamp_coverage_compare() - Coverage audit: which force-months exist, and can be compared
-
lamp_panel() - Build an area-by-month panel of crime and stops
-
lamp_population() - Census 2021 usual resident population by area
-
lamp_revintage() - Re-vintage LSOA codes between 2011 and 2021
Treatment
Define what is being evaluated: a continuous stop intensity, an intervention in named areas, staggered adoption dates, or a dated shock.
-
lamp_detect_surges() - Detect surges in stop and search activity
-
lamp_treatment() - Define the treatment
Estimators
Panel estimators, each reporting its identifying assumption, clustered standard errors and the force-months it excluded.
-
lamp_allocation() - How stop and search activity follows recorded crime
-
lamp_crimes_prevented() - Convert an estimate into crimes prevented per thousand searches
-
lamp_did_staggered() - Difference-in-differences with staggered adoption
-
lamp_displacement_quotient() - Weighted displacement quotient
-
lamp_elasticity() - Elasticity of crime with respect to stop and search
-
lamp_event_study() - Event study around a dated intervention
-
lamp_spillover() - Own-area and neighbour effects estimated together
-
lamp_synth() - Synthetic control for a single treated area or force
-
lamp_twfe() - Two-way fixed effects estimate of the effect of stops on crime
-
tidy(<lamp_estimate>) - Tidy a streetlamp estimate
Diagnostics
What the estimates are worth: pre-trend testing with power, and placebo tests in time, space and outcome.
-
lamp_design_audit() - Audit the support and assumptions of an intervention design
-
lamp_effect_summary() - Summarise effects using their joint covariance
-
lamp_elasticity_robustness() - Evaluate an explicit elasticity specification grid
-
lamp_placebo() - Placebo tests for a streetlamp estimate
-
lamp_pretrends() - Test and interpret pre-trends
-
lamp_trend_sensitivity() - Sensitivity to a specified differential linear trend
-
lamp_simulate() - Simulate a panel with a known treatment effect
-
lamp_simulation_truth() - Recover exact expected outcomes from a simulated panel
-
lamp_report() - Build a report on a panel and the estimates made from it
Plots and tables
The colours and theme every plot method draws with, and presentation tables with terms in words, intervals in brackets and rounded p values.
-
lamp_colours() - The colours streetlamp draws with
-
lamp_map() - Map a panel column, an area-level estimate or a synthetic control's donors
-
lamp_table() - A presentation-ready table from a streetlamp object
-
lamp_theme() - The ggplot2 theme streetlamp plots use
-
lamp_contract() - The panel contract
Bundled reference tables
Curated tables shipped with the package: crime and outcome classifications, national policy shocks, bank holidays and the ONS LSOA code lists and 2011 to 2021 best-fit lookup.
-
lamp_area_lookup() - Area hierarchy for 2021 LSOAs
-
lamp_bank_holidays() - Bank holidays in England and Wales
-
lamp_crime_types() - Crime type classification used by data.police.uk
-
lamp_deprivation() - Small-area deprivation indices for England and Wales
-
lamp_forces() - Police forces in the data.police.uk archive
-
lamp_lsoa_lookup()lamp_lsoa_codes() - ONS LSOA code lists and the 2011 to 2021 lookup
-
lamp_outcome_types() - Outcome classification used by data.police.uk
-
lamp_sample_panel()lamp_sample_boundaries() - The bundled sample panel and boundaries
-
lamp_shocks() - National policy shocks affecting stop and search or recorded crime
-
lamp_cache_dir()lamp_cache_clear() - Location of the streetlamp cache
-
streetlampstreetlamp-package - streetlamp: Panel Econometrics for the Effect of Police Stop and Search on Recorded Crime