Fixed Effects Counterfactual Estimators
Overview
Provides tools for estimating causal effects in panel data using counterfactual methods, as well as other modern DID estimators. It is designed for causal panel analysis with binary treatments under the parallel trends assumption. The package supports scenarios where treatments can switch on and off and allows for limited carryover effects. It includes several imputation estimators, such as Gsynth (Xu 2017), linear factor models, and the matrix completion method. Detailed methodology is described in Liu, Wang, and Xu (2024) doi:10.48550/arXiv.2107.00856 and Chiu et al. (2025) doi:10.48550/arXiv.2309.15983. Optionally integrates with the "HonestDiDFEct" package for sensitivity analyses compatible with imputation estimators. "HonestDiDFEct" is not on CRAN but can be obtained from https://github.com/lzy318/HonestDiDFEct.
Install
Health
- OK13 OK2026-09-09
- ERROR12 OK, 1 ERROR2026-09-04
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
Show 5 earlier changesHide 5 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-04-22
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 28includes a package overview page
- Examples that run
- 46%6 run in a plain check · 7 never run
- Exported functions with examples
- 79%
- Documented parameters
- 99%
- Return-value docs
- 93%
- Help pages citing references
- 50%
Downloads
Repository
- PRs merged (all time)
- 87%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/xuyiqing/fect on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-03-12Named in .gitignore: .claudePull request it wrote: opened by a project memberCommits: 48 by its own account · at least 84 crediting it in the message
- Claude Opus 4.651 commits · Mar 2026
- Claude Opus 4.725 commits · Apr 2026
- Claude Sonnet 4.68 commits · Apr 2026
Dependencies
Installing fect adds 63 packages (25 with compiled code, 52 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, fixest 4.8 MB.
Code & Tests
Datasets
People & History
Previously maintained by Ziyi Liu (1.0.0).
Pick two releases to compare their code metrics.
- 2.4.5Latest
- 2.4.1
- RR 4.6.0 released · 2026-04-24
- 2.2.0
- 2.1.02026-01-17 · diff ↗
- 2.0.5
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 1.0.02022-10-14
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2022-10-14
- Total releases
- 6 / 4 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 1.1 MB / 10 files
- Download size
- 2.6 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("fect")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.