Data & Code

R Modules

fastconley: extremely fast and exact Conley standard errors for large panels and very large cross-sections

  • An R package for Conley (1999) spatial HAC standard errors for lfe::felm() and fixest::feols() models, on cross-sections and panels.
  • Unlike fixest’s built-in vcov_conley(), it implements the full spatial-temporal correction for panels (Conley 1999, as popularized by Hsiang 2010): spatial dependence within periods and serial correlation within units enter a single covariance matrix, so you don’t have to choose between Conley and Newey-West/Driscoll-Kraay.
  • It is extremely fast and exact at scales where existing implementations give up or approximate: no dense distance matrices – a 3D cell-grid neighbor search and C++/RcppParallel score accumulation handle millions of observations in seconds, and a dedicated FFT-based engine computes the meat on regular rasters (e.g. gridded nightlights or climate data) at a cost independent of the number of neighbor pairs.
  • Exact great-circle distances throughout (fixest’s spherical distance is approximate), results bit-identical across core counts, and weighted (WLS) fits, small-sample corrections, and defaults that match fixest out of the box.
  • Claude code helped with the ultra fast C++ implementation.
  • Supersedes my older conley package, which is no longer maintained.
  • GitHub · install using devtools in R: remotes::install_github(“rbluhm/fastconley”)

Wild bootstrap for bias corrected inference in RD designs with optimal bandwidth selection

  • Parallelized R code for calculating wild bootstrap bias-corrected confidence intervals in sharp RD designs. For example uses see my Econometrics Journal article with Maxim Pinkovskiy and the replication kit below.
  • It’s a fork from Otávio Bartalloti’s, Gray Calhoun’s and Yang He’s excellent R code.  I have added support for cluster sampling, covariates, different distributions for the wild weights, different bandwidths on the left and right,  bandwidth selection using the new version of rdbwselect, and parallel computation.

Conley standard errors for massive data sets (on Github but still undocumented)

  • Superseded by fastconley package (does all this and more)

Stata Modules

fhetprob: A fast QMLE Stata routine for fractional probit models with multiplicative heteroskedasticity

  • To install the software type the following at Stata’s dot prompt:
  • net install fhetprob, from(https://www.richard-bluhm.com/stata/)
  • To get the example data and pdf documentation (installs in current directory):
  • net get fhetprob, from(https://www.richard-bluhm.com/stata/)
  • Then type help fhetprob or read fhetprob.pdf for usage instructions.

Replication Data for (older) Papers

Top lights: Bright cities and their contribution to economic development

  • GeoTiff Images of the Corrected Lights here
  • Code (plz ask if needed)

The spread of COVID-19 and the BCG vaccine: A natural experiment in reunified Germany

  • Full replication set on Github

Fueling conflict? (De)Escalation and bilateral aid

  • Stata code for estimating dynamic ordered probit models with endogeneity and quasi fixed-effects/CRE is available in the JAE replication archive.

Poverty accounting

  • Poverty data in levels (dta, csv, xls)
  • Full replication set (zip), see Stata modules for fhetprob estimator.