Table of Contents
Fetching ...

causalfe: Causal Forests with Fixed Effects in Python

Harry Aytug

TL;DR

The paper addresses estimating heterogeneous treatment effects in panel data with unit and time fixed effects, where standard causal forests can misattribute variation due to fixed effects. It introduces Causal Forests with Fixed Effects (CFFE) implemented in Python, which performs node-level residualization within each tree node, uses $\tau$-heterogeneity splitting, honest estimation, and cluster-aware subsampling to obtain valid, nonparametric estimates of $\tau(x)$. The results from simulations and an empirical example on minimum wage show that CFFE recovers true CATE patterns and provides more reliable inference than standard causal forests, particularly when fixed effects are correlated with covariates. While CI coverage is approximate and computational costs are nontrivial for large panels, the approach offers a practical, accessible tool for policy evaluation and heterogeneity analysis in panel settings, with potential for future improvements in variance estimation and scalability.

Abstract

The causalfe package provides a Python implementation of Causal Forests with Fixed Effects (CFFE) for estimating heterogeneous treatment effects in panel data settings. Standard causal forest methods struggle with panel data because unit and time fixed effects induce spurious heterogeneity in treatment effect estimates. The CFFE approach addresses this by performing node-level residualization during tree construction, removing fixed effects within each candidate split rather than globally. This paper describes the methodology, documents the software interface, and demonstrates the package through simulation studies that validate the estimator's performance under various data generating processes.

causalfe: Causal Forests with Fixed Effects in Python

TL;DR

The paper addresses estimating heterogeneous treatment effects in panel data with unit and time fixed effects, where standard causal forests can misattribute variation due to fixed effects. It introduces Causal Forests with Fixed Effects (CFFE) implemented in Python, which performs node-level residualization within each tree node, uses -heterogeneity splitting, honest estimation, and cluster-aware subsampling to obtain valid, nonparametric estimates of . The results from simulations and an empirical example on minimum wage show that CFFE recovers true CATE patterns and provides more reliable inference than standard causal forests, particularly when fixed effects are correlated with covariates. While CI coverage is approximate and computational costs are nontrivial for large panels, the approach offers a practical, accessible tool for policy evaluation and heterogeneity analysis in panel settings, with potential for future improvements in variance estimation and scalability.

Abstract

The causalfe package provides a Python implementation of Causal Forests with Fixed Effects (CFFE) for estimating heterogeneous treatment effects in panel data settings. Standard causal forest methods struggle with panel data because unit and time fixed effects induce spurious heterogeneity in treatment effect estimates. The CFFE approach addresses this by performing node-level residualization during tree construction, removing fixed effects within each candidate split rather than globally. This paper describes the methodology, documents the software interface, and demonstrates the package through simulation studies that validate the estimator's performance under various data generating processes.
Paper Structure (22 sections, 4 equations, 3 figures, 3 tables)

This paper contains 22 sections, 4 equations, 3 figures, 3 tables.

Figures (3)

  • Figure 1: CFFE estimation results. Panel (a) shows the distribution of estimated CATEs (blue) overlaid with true effects (coral). Panel (b) plots estimated against true CATEs; the dashed line indicates perfect prediction.
  • Figure 2: Estimated versus true CATEs for CFFE (left) and standard causal forest (right) when fixed effects are correlated with covariates. The dashed line indicates perfect prediction. CFFE produces less biased estimates by residualizing fixed effects within each tree node.
  • Figure 3: Minimum wage application results. Left: Event study showing ATT by years relative to treatment. Right: Distribution of estimated CATEs for treated observations.