← Back to all sparks
F

fect

ANALYTICS
Velocity0.0

R package fect by xuyiqing — release notes from GitHub.

A counterfactual estimator turning itself into a platform for multiple estimands

r-packagecausal-inferencepanel-dataapi-redesignreproducibility
Current state
fect implements counterfactual estimators for panel data with treatment effects — imputation-based fixed effects, interactive fixed effects, matrix completion. The 2026 releases move fast and bundle heavily: 2.1.0 rewrote complex fixed effect handling, 2.2.0 unified cross-validation under a single cv.method parameter and replaced method='gsynth' with an explicit time.component.from switch, 2.4.1 introduced a post-hoc estimand API, and 2.4.5 added group.fe for coarsened fixed effects plus a $sample slot exposing which cells entered estimation.
Where it's heading
The direction is separation of estimation from interpretation. Where the package once returned one effect from one fit, estimand() now dispatches typed estimands — ATT, cumulative ATT, APTT, log ATT — from any imputation fit, with effect() and att.cumu() soft-deprecated but byte-identical pending 3.0.0. Alongside that runs a transparency thread: the $sample matrix, out-of-sample comparison via fect_mspe(), and named component sources instead of opaque method aliases. The release notes are unusually precise about which results change and which do not.
Prediction
The soft-deprecation notice names 3.0.0 as the removal point for effect() and att.cumu(), so a major release consolidating on the estimand() dispatcher is the clearly signposted next step.

Recent moves

  1. 2mo ago

    Adds group.fe for coarsened fixed effects and a $sample slot

    Bundles four releases: group.fe absorbs additive fixed effects at a coarser level than the unit identifier with clustered SEs defaulting to match, and fect() now returns a $sample matrix marking every cell used in estimation. Both continue the package's push toward making its own internals inspectable rather than implicit.

    View source ↗
  2. 3mo ago

    Post-hoc estimand API decouples estimands from the fit

    ⚡ SPARK

    Introduces estimand() as a typed dispatcher returning alternative estimands from any imputation fit, and soft-deprecates effect() and att.cumu() against a 3.0.0 removal. This is the structural turn the trajectory has been building toward — the fit becomes a substrate, and what you ask of it becomes a separate decision.

    View source ↗
  3. 4mo ago

    Unified cross-validation and explicit control of time components

    Replaces method='gsynth' with an explicit time.component.from switch, collapses cv.treat and mask.method into a single cv.method parameter, adds k-fold CV for never-treated estimation, and adds fect_mspe() for out-of-sample model comparison. Retiring a method alias in favor of naming the actual modeling choice is the same clarity impulse that later produces estimand().

    View source ↗
  4. 7mo ago

    Rewrites complex fixed effect handling and fixes speed

    A terse release rewriting complex fixed effect handling alongside a speed fix. The fixed-effects machinery reworked here is what group.fe later builds on in 2.4.5.

    View source ↗
  5. 11mo ago

    Adds heterogeneous treatment effect plots and caps default cores

    Adds a type='hte' plot for heterogeneous treatment effects and caps default parallel cores, plus dependency-driven fixes. Modest next to the 2.x releases, and the last entry before the package's pace picks up sharply.

    View source ↗