Code and Data

Intermittently updated list of software projects. Largely collates projects from my github.

R

causalTransportR: a package for bridging causal effects to new or general populations

causalTransportR implements a number of estimators to generalize and transport causal effects by reweighting doubly-robust score functions with transformations of selection scores. All nuisance functions are cross-fit using fast supervised learning algorithms.

Reference: Lal, Zheng, Ejdemyr (2022)

remotes::install_github("Netflix-Skunkworks/causalTransportR")

ivDiag: Diagnostics and Uncertainty Quantification for Instrumental Variables Designs

Package to implement recommended diagnostics, weak-IV tests, and bootstrap in Lal, Lockhart, Xu, and Zu

remotes::install_github("apoorvalal/ivDiag")

renyiWeights: Balancing methods using Renyi Divergences

remotes::install_github("apoorvalal/renyiWeights")

CVXSynth: Synthetic Control Solvers in CVXR

Implementations of the original synthetic control (Abadie, Diamond, Hainmueller 2010, 2015) and elastic net synthetic control (Doudchenko and Imbens 2016).

remotes::install_github("apoorvalal/CVXSynth")

Solver

Uses the domain-specific language CVXR with the commercial solver MOSEK to solve for weights. MOSEK is free for academics and can be installed using installation instructions on their website. Else, an alternate solver can be passed as the solv argument for both sc_solve and en_sc_solve functions.

aipwML: ML estimators for treatment effects under unconfoundedness

remotes::install_github("apoorvalal/aipwML")
  • tuning-free implementation with h2o here

sp2DID: Semiparametric 2-period difference in differences estimators

devtools::install_github("apoorvalal/sp2DID")

LalRUtils: Utilities Package

remotes::install_github("apoorvalal/LalRUtils")

Applied statistics

Misc Snippets and Notebooks

Python

Webscrapers (and associated datasets)

Geographic Data

Text / Parsing

Maths

snippets

Stata

Utilities Package

Github Repository

To install, run the following line in the Stata console:

net install lal_utilities, from(https://raw.github.com/apoorvalal/misc_stata_ados/master/)

Or, if you prefer, download ados and move to your personal ado folder / c(sysdir_personal) (where ssc-installed ados live).

Misc

Workflow

I alternate between VSCode, Atom, Sublime, and Jupyter (on my local machine) and Vim (on a remote/headless server) for my programming/word-processing/writing needs. Check out Kieran Healy’s excellent guide to plain text.

I currently use a Framework Laptop running Ubuntu 22.04 as my primary work machine. Some templates for notebooks / tex files / markdown notes can be found here (and can be stored in ~/Templates on Ubuntu for ease of use):