Package: fetwfe 1.10.1

Gregory Faletto

fetwfe: Fused Extended Two-Way Fixed Effects

Calculates the fused extended two-way fixed effects (FETWFE) estimator for unbiased and efficient estimation of difference-in-differences in panel data with staggered treatment adoption. This estimator eliminates bias inherent in conventional two-way fixed effects estimators, while also employing a novel bridge regression regularization approach to improve efficiency and yield valid standard errors. Also implements extended TWFE (etwfe) and bridge-penalized ETWFE (betwfe). Provides S3 classes for streamlined workflow and supports flexible tuning (ridge and rank-condition guarantees), automatic covariate centering/scaling, and detailed overall and cohort-specific effect estimates with valid standard errors. Includes simulation and formatting utilities, extensive diagnostic tools, vignettes, and examples. See Faletto (2025) (<doi:10.48550/arXiv.2312.05985>).

Authors:Gregory Faletto [aut, cre]

fetwfe_1.10.1.tar.gz
fetwfe_1.10.1.zip(r-4.7-any)fetwfe_1.10.1.zip(r-4.6-any)
fetwfe_1.10.1.tar.gz(r-4.7-any)fetwfe_1.10.1.tar.gz(r-4.6-any)
fetwfe_1.10.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
fetwfe/json (API)

# Install 'fetwfe' in R:
install.packages('fetwfe', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/gregfaletto/fetwfepackage/issues

On CRAN:

Conda:

3.60 score 478 downloads 16 exports 12 dependencies

Last updated from:eeb0d4bec5. Checks:6 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develOK204
source / vignettesOK239
linux-releaseOK220
windows-develOK211
windows-releaseOK162
wasm-releaseOK133

Exports:attgtToFetwfeDfbetwfebetwfeWithSimulatedDataetwfeetwfeToFetwfeDfetwfeWithSimulatedDataeventStudyfetwfefetwfeWithSimulatedDatagenCoefsgenCoefsCoregetTessimulateDatasimulateDataCoretwfeCovstwfeCovsWithSimulatedData

Dependencies:codetoolsforeachgenericsglmnetgrpregiteratorslatticeMatrixRcppRcppEigenshapesurvival

Comparison Estimators: ETWFE and BETWFE
Introduction | Setup: simulating panel data | etwfe(): extended TWFE without penalty | betwfe(): bridge-penalized ETWFE | No-covariate setting | Visualizing event-time effects | When to use which | References

Last update: 2026-05-24
Started: 2026-05-24

Simulation Vignette for FETWFE: From Coefficients to True Treatment Effects
Introduction | Simulation Workflow Using Piping | Step 1: Generate Simulation Coefficients | Step 2: Simulate Panel Data | Step 3: Run the FETWFE Estimator on Simulated Data | Step 4: Extract True Treatment Effects | Combining the Workflow in One Pipeline | Conclusion

Last update: 2026-05-24
Started: 2025-05-15

fetwfe: A Package for Fused Extended Two-Way Fixed Effects
Introduction | Background | Package Usage | Simulated Data Example | A "Real Data" Example | Testing the zero-effect null | Tidy outputs with broom | Conclusion | References

Last update: 2026-05-24
Started: 2025-02-21

Standard errors in fetwfe: Assumption F1 and the experimental cluster-robust option
1. What att_se and catt_ses are under Assumption F1 | 2. When Assumption F1 may be restrictive in applied DiD | 2.1 Within-unit serial correlation beyond the random effect | 2.2 Heteroskedasticity across units | 2.3 Higher-level clustering | 3. Experimental: cluster-robust standard errors via se_type = "cluster" | 3.1 The formula | 3.2 Why we call this experimental | 3.3 Worked example | References

Last update: 2026-05-24
Started: 2026-05-24

Readme and manuals

Help Manual

Help pageTopics
Convert data formatted for 'att_gt()' to a dataframe suitable for 'fetwfe()' / 'etwfe()'attgtToFetwfeDf
Augment user-supplied data with fitted values and residuals from a betwfe fitaugment.betwfe
Augment user-supplied data with fitted values and residuals from an etwfe fitaugment.etwfe
Augment user-supplied data with fitted values and residuals from a fetwfe fitaugment.fetwfe
Bridge-penalized extended two-way fixed effectsbetwfe
Bridge-Penalized Extended Two-Way Fixed Effects Output Classbetwfe-class
Run BETWFE on Simulated DatabetwfeWithSimulatedData
Extended two-way fixed effectsetwfe
Extended Two-Way Fixed Effects Output Classetwfe-class
Convert data prepared for 'etwfe::etwfe()' to the format required by 'fetwfe()' and 'fetwfe::etwfe()'etwfeToFetwfeDf
Run ETWFE on Simulated DataetwfeWithSimulatedData
Compute pooled event-time treatment-effect estimateseventStudy
Fused extended two-way fixed effectsfetwfe
FETWFE Coefficient-Vector ClassFETWFE_coefs-class
Simulated Panel-Data ClassFETWFE_simulated-class
Compute True Treatment Effects Output ClassFETWFE_tes-class
Fused Extended Two-Way Fixed Effects Output Classfetwfe-class
Run FETWFE on Simulated DatafetwfeWithSimulatedData
Generate Coefficient Vector for Data GenerationgenCoefs
Generate Coefficient Vector for Data GenerationgenCoefsCore
Compute True Treatment EffectsgetTes
Glance a 'betwfe' fitted objectglance.betwfe
Glance an 'etwfe' fitted objectglance.etwfe
Glance an 'fetwfe' fitted objectglance.fetwfe
Generate Random Panel Data for FETWFE SimulationssimulateData
Generate Random Panel Data for FETWFE SimulationssimulateDataCore
Tidy a 'betwfe' fitted objecttidy.betwfe
Tidy an 'etwfe' fitted objecttidy.etwfe
Tidy an 'eventStudy' objecttidy.eventStudy
Tidy an 'fetwfe' fitted objecttidy.fetwfe
Tidy a 'FETWFE_tes' simulation truth objecttidy.FETWFE_tes
Two-way fixed effects with covariates and separate treatment effects for each cohorttwfeCovs
TWFE-With-Covariates Output ClasstwfeCovs-class
Run twfeCovs on Simulated DatatwfeCovsWithSimulatedData