Skip to content

Fixed Effects Counterfactual Estimators

1packages dependsuggested by 1
25.8Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

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

CRAN checks
13OK
Slowest check: 9.2 min · r-oldrel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 2.4.5
README· In the repository, left out of the releaseVignettes· In the repository, left out of the releaseNEWS· In the repository, left out of the releaseCitation fileNoWebsiteYes
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

25.8K
CRAN downloads in the past year
Rank #2,440 · ~71/day · ~2.1K/mo
Daily download trend is not available in this view yet.
2K30 days
6.6K90 days
25.8K1 year
Compare downloads with other packages →
Also on749 r2u3 autocran742 conda_forge

Repository

85Stars
30Forks
0Open issues
2Open PRs
5Releases
510Commits
12Commit identities
510 commits · Last activity 2026-05-30 · +2.4% stars, 30d
Responsiveness
How these are sampled
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

2025-10-13 · 732026-09-28 · 85
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows

Docs source (1)
README.Rmd
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-03-12
    Named in .gitignore: .claude
    Pull request it wrote: opened by a project member
    Commits: 48 by its own account · at least 84 crediting it in the message
Models named in its commits
  • Claude Opus 4.651 commits · Mar 2026
  • Claude Opus 4.725 commits · Apr 2026
  • Claude Sonnet 4.68 commits · Apr 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
27 external dependencies (excludes base and recommended)

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.

Depends (1)
R >= 4.1.0
LinkingTo (2)
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (7)
Author, Maintainer since 2.0.5 (2025)
Author · added in 2.0.5
Author · added in 2.0.5
Author
Author · added in 2.0.5
Author

Previously maintained by Ziyi Liu (1.0.0).

Releases (6)

Pick two releases to compare their code metrics.

  • 2.4.5Latest
    record
    2026-05-30 · current release · diff ↗
  • 2.4.1
    record
    2026-04-30 · diff ↗ ·
    added 3 exports
    r.cv.rolling, imputed_outcomes, estimand
  • R
    R 4.6.0 released · 2026-04-24
  • 2.2.0
    record
    2026-03-27 · diff ↗ ·
    added 3 exports
    fect_mspe, fect_iden, att.cumu
  • 2.1.0
    record
    2026-01-17 · diff ↗
  • 2.0.5
    record
    2025-08-25 · diff ↗ ·
    added 5 exports
    esplot, effect, plot.fect, did_wrapper, fect_sens
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 1.0.0
    record
    2022-10-14
  • R
    R 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")
Xu, Y., Hu, S., Lipkovitz, R., Liu, L., Liu, Z., Qin, T., & Wang, Y. (2026). fect: Fixed Effects Counterfactual Estimators (Version 2.4.5) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for fect version 2.4.5 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy