Skip to content

fixes

0.12.0Package record

Staggered DiD Tools: Event Studies and ATT Aggregation

0packages depend
3.8Kdownloads / year
0.0%test coverage
13/13flavors OK

Overview

About

Provides tools for difference-in-differences (DiD) estimation and visualization with staggered adoption. Includes run_es() for event-study curves (dynamic effects by relative time) and calc_att() for aggregated ATT estimation (overall, by cohort, by calendar time). Supports multiple modern estimators: Callaway-Sant'Anna (2021), Sun-Abraham (2021), Borusyak-Jaravel-Spiess (2024), Wooldridge TWM, and Deb et al. FLEX.

Changes in 0.12.0

Bug fixes

  • **run_did() reported nrow(data) instead of the estimation sample size.** attr(., "N") and N_treated (and the printed "N = … obs") counted all rows of data, including those fixest::feols() drops for missing values, disagreeing with nobs(model), broom::glance(), and run_es() (which already report the fitted sample). N, N_units, and N_treated now describe the estimation sample, recovered from the model's obs_selection. On data without missing values the numbers are unchanged.

New features

  • **calc_att() results can now be tabulated.** att_result gains broom::tidy() and broom::glance() methods, so aggregated ATTs (overall, by-cohort, or by-time; CS or BJS) can be passed to modelsummary::modelsummary() and rendered with tinytable. Several estimators — e.g. run_did() TWFE, CS, and BJS — can be stacked side by side in one table. The term column is derived from the aggregation type ("ATT", "Cohort <g>", "Time <t>") so rows align across estimators.
Show all changes in 0.12.0Hide the rest of the changes in 0.12.0
  • **run_es(..., rel_time = <col>)**: pass a pre-built event-time column (time relative to treatment) — e.g. the Time_to_Treatment from paneltools/fect's get.cohort() — and run_es() uses it verbatim as the event-study factor (i(rel_time, treatment, ref = baseline)) instead of computing relative time from time/timing. This normalises the previous time = event_time, timing = 0 idiom and, unlike that idiom, keeps never-treated controls (NA rel_time) in the estimation sample. Requires estimator = "twfe" and method = "classic"; the default calendar-difference behaviour is unchanged. See the new **Details** section of ?run_es for the three relative-time conventions (calendar difference, within-unit rank, pre-built) and when they diverge in sparse/unbalanced panels.

Diagnostics

  • **CS** now names cohorts that are silently dropped because their base period g-1 is not observed (a real hazard in sparse panels, where a cohort can vanish from the by-cohort and event-study aggregates), and exposes them as attr(result, "dropped_cohorts") on both run_es() and calc_att().
  • **SA** warns when the saturated design is degenerate (a large share of cohort×period interactions dropped as collinear, or implausibly large CATT standard errors), which is easy to miss with sparse/irregular time.
  • **BJS** now reports attr(result, "n_unimputed") (and n_treated_obs): the number of treated observations whose counterfactual could not be imputed and were excluded from aggregation, on both run_es() and calc_att().

Internals — reduced fixest dependency

The long-term plan of trimming the fixest dependency (see CLAUDE.md)

begins in this release. Two internal engines now replace fixest::feols()

in most estimators; **all user-facing APIs, output columns, and numerics are

unchanged** — every change here is verified against the previous

fixest-based results to numerical agreement (tolerance = 1e-6, typically

much closer).

  • **BJS Step 1** (fixed-effects nuisance regression) is now estimated by an internal alternating-projections solver (src/fe_solver.cpp) instead of fixest::feols(y ~ 0 | unit + time) + fixest::fixef(). It reproduces fixest's estimation sample exactly, including the iterative removal of singleton fixed-effect levels (dropping one singleton can create another).
  • **SA, TWM, FLEX, and compute_contamination_weights()** now run their saturated cohort × period regressions through a new internal FE-OLS engine (R/fe_ols.R, src/demean_kway.cpp, src/fe_ols_kernels.cpp): k-way fixed-effects demeaning, keep-first collinearity dropping, and iid / heteroskedasticity-robust (HC1) / one-way cluster-robust standard errors that reproduce fixest's default small-sample corrections exactly (ssc(adj = TRUE, cluster.adj = TRUE), nested-fixed-effect accounting). Requests the internal engine cannot reproduce exactly — multi-way clustering, custom vcov_args, or fixed-effect specifications that are not plain columns — are transparently delegated to fixest, so every code path keeps returning identical results.
  • The regressions are parallelised with OpenMP (falls back to sequential execution where OpenMP is unavailable) and are within a few percent of fixest's multi-threaded speed on saturated designs with hundreds of cohort × period columns. Thread count defaults to half the detected physical cores and can be set with options(fixes.nthreads = <n>).
  • fixest remains the estimation engine for classic TWFE / method = "sunab" in run_es(), for run_did(), and as the fallback described above; it is still a required (Imports) dependency. parallel (base R) is now also imported, for core-count detection only.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.0 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.12.0
READMEYes · 1,513 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.12.0Citation fileNoWebsiteYes · pkgdown
Help pages
15
Examples that run
0%8 never run · 2 hold no code
Exported functions with examples
50%
Documented parameters
91%
Return-value docs
100%
Help pages citing references
13%

Downloads

3.8K
CRAN downloads in the past year
Rank #10,827 · ~10/day · ~313/mo
Daily download trend is not available in this view yet.
41330 days
96090 days
3.8K1 year
Compare downloads with other packages →
Also on186 r2u6 autocran

Repository

0Stars
0Forks
0Open issues
0Open PRs
0Releases
causal-inferencedifference-in-differenceseconometricspanel-datarr-package
Last activity 2026-10-21 · Default branch at 1.0.0, ahead of CRAN 0.12.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
83%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
not measured
PracticesBeta

7 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/yo5uke/fixes on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

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

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-21 · The repository has a site deploy workflow

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 2025-10-31
    Seen in the repository: .claude, CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude
    Pull request it wrote: opened by a project member
    Commits: 1 by its own account · at least 55 crediting it in the message
  • GitHub Copilotfirst seen 2026-07-04
    Pull request: opened by its own account
    Commits: 4 by its own account
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: .agents
Models named in its commits
  • Claude Fable 522 commits · Jun to Jul 2026
  • Claude Sonnet 4.621 commits · May 2026
  • Claude Opus 4.88 commits · May to Jun 2026
  • Claude Sonnet 51 commit · Jul 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
25 external dependencies (excludes base and recommended)

Installing fixes adds 40 packages (21 with compiled code, 43 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
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2025)
Releases (10)

Pick two releases to compare their code metrics.

  • 0.12.0Latest
    record
    2026-07-04 · current release · diff ↗
  • 0.11.2
    record
    2026-06-11 · diff ↗ ·
    added 6 exports
    calc_att, compute_contamination_weights, honest_sensitivity, plot_contamination_weights, plot_honest, run_did
  • 0.8.1
    record
    2026-05-10 · diff ↗ ·
    added 1 export
    plot_att_gt
  • 0.7.2
    record
    2026-05-02 · diff ↗ ·
    added 1 export
    plot_es_interactive
  • R
    R 4.6.0 released · 2026-04-24
  • 0.5.0
    record
    2025-07-07 · diff ↗
  • 0.4.1
    record
    2025-06-30 · diff ↗
  • 0.4.0
    record
    2025-05-25 · diff ↗
  • 0.2.1
    record
    2025-05-10 · diff ↗
  • 0.2.0
    record
    2025-04-23 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.0
    record
    2025-03-18
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2025-03-18
Total releases
10 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Download size
866 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("fixes")
Abe, Y. (2026). fixes: Staggered DiD Tools: Event Studies and ATT Aggregation (Version 0.12.0) [Computer software]. https://doi.org/10.32614/CRAN.package.fixes

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 fixes version 0.12.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, 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