Over the past few years, I have written three articles reviewing recent developments in causal panel analysis. I recommend interested readers review these before applying the methods discussed below.
With coauthors and collaborators, I develop statistical routines for panel data visualization and analyses and for other causal inference and social data description purposes. Below are the different user-cases for the various panel methods:
panelView
: panel data visualization.gsynth
: panel causal inference with binary treatments following staggered adoption. Require a large number of pretreatment periods for each treated unit.fect
: panel causal inference with binary treatments of general patterns (switching on-and-off allowed). Require a large number of untreated observations for each treated unit.bpCausal
: Bayesian panel causal inference with binary treatments following staggered adoption. Require a large number of pretreatment observations for each treated unit. Suitable when the number of treated units is small.tjbal
: panel causal inference with binary treatments following staggered adoption. Suitable when the numbers of pretreatment periods are small (e.g. short panels).Note that gsynth
, fect
, and bpCausal
all rely on the strict exogeneity assumption (of some form), which corresponds to baseline randomization, while tjbal
relies on sequential ignorability, which corresponds to sequential randomization. Below I summarize their differences in a table.
Please don’t hesitate to email me if you have any questions regarding usage and bugs.
panelView
along with your questions. These will help us diagnose potential problems more quickly. Emails are preferred to issue-reporting on Github.bpCausal
implements dynamic multilevel linear factor models (DM-LFMs), which is a Bayesian alternative to the synthetic control method for comparative case studies. It provides interpretable uncertainty estimates based on the Bayesian posterior distributions of the counterfactuals.
fect
implements a group of counterfactual estimators for causal inference using panel data with binary treatments, including interactive fixed effects and matrix completion methods. It also offers several diagnostic tests, such as a placebo test (for no pre-trends).
gsynth
implements the generalized synthetic control method, an imputation-based causal inference method for panel data with binary treatments following staggered adoption. gsynth
is a special case of fect
, which allows the treatment to switch back and forth.
panelView
has three main functions: (1) it visualizes the treatment and missing-value statuses of each observation in a panel dataset; (2) it plots an outcome variable (or any variable) in a time-series fashion; (3) it visualizes the bivariate relationship between two variables by unit or in aggregate.
ivDiag
provides estimation and diagnostic tools for instrumental variables designs, including bootstrapped confidence intervals, effective F-statistics, Anderson-Rubin test, F-dependent valid t-ratio test, and local-to-zero tests.
hbal
implements hierarchically regularized entropy balancing, which hierarchically regularizes higher-order moment constraints of observed covariates. It improves both the feasibility and efficiency of entropy balancing and requires much less computational resources than kernel balancing.
interflex
estimates and visualizes conditional marginal effects and performs diagnostics. It is the winner of the Best Statistical Software Award from the Society of Political Methodology for 2023.