pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Fast high-dimensional fixed effects: OLS, Poisson, IV with multi-way FE; DiD (TWFE, did2s, Sun-Abraham); clustered SEs; etable/coefplot/iplot. Use for FE regressions or DiD. For panel RE/between use linearmodels; for GLM without FE use statsmodels.
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pyfixestContext preview
The summary Claude sees to decide when to auto-load this skill.
Fast high-dimensional fixed effects: OLS, Poisson, IV with multi-way FE; DiD (TWFE, did2s, Sun-Abraham); clustered SEs; etable/coefplot/iplot. Use for FE regressions or DiD. For panel RE/between use linearmodels; for GLM without FE use statsmodels.
name: pyfixest description: >- Fast high-dimensional fixed effects: OLS, Poisson, IV with multi-way FE; DiD (TWFE, did2s, Sun-Abraham); clustered SEs; etable/coefplot/iplot. Use for FE regressions or DiD. For panel RE/between use linearmodels; for GLM without FE use statsmodels. metadata: audience: research-coders domain: python-library library-version: "0.40.0" skill-last-updated: "2026-03-27"
pyfixest: fast high-dimensional fixed effects estimation for Python. Covers OLS, Poisson, and IV regression with multi-way fixed effects; difference-in-differences estimators (TWFE, did2s, lpdid, Sun-Abraham); clustered standard errors; wild bootstrap; and publication output (etable regression tables, coefplot, iplot event study plots). Use when running fixed effects regressions, difference-in-differences designs, Poisson count models with FE, or producing publication-ready regression tables. For panel random/between effects, use linearmodels; for GLM/time series without FE, use statsmodels.
Comprehensive skill for fixed effects regression, instrumental variables, and difference-in-differences estimation with pyfixest. Use decision trees below to find the right guidance, then load detailed references.
pyfixest is a Python implementation of the R **fixest** package (Berge, Butts, & McDermott, 2026):
This skill targets **pyfixest 0.40.0**, the major release aligning with R fixest 0.13. Breaking changes from earlier versions:
Each topic in `./references/` contains focused documentation:
| File | Purpose | When to Read | |------|---------|--------------| | `quickstart.md` | Installation, first regression, formula syntax | Starting with pyfixest | | `fixed-effects.md` | Multi-way FE, SE types, clustering, wild bootstrap | FE models and inference | | `instrumental-variables.md` | IV syntax, first stage, weak instruments | IV/2SLS estimation | | `difference-in-differences.md` | TWFE, did2s, lpdid, Sun-Abraham, event studies | DiD designs | | `tables-and-plots.md` | etable, coefplot, iplot, dtable | Reporting results | | `advanced-inference.md` | Wild bootstrap, randomization inference, MHT corrections, Gelbach | Advanced statistical inference | | `integration.md` | Multiple estimation, Poisson, GLM, marginaleffects, online learning | Advanced features | | `gotchas.md` | Common errors, v0.40 breaking changes, fixest vs pyfixest | Debugging issues |
1. **New to pyfixest?** Start with `quickstart.md` then `fixed-effects.md` 2. **Running DiD?** Read `quickstart.md`, then `difference-in-differences.md` 3. **Need IV?** Read `quickstart.md`, then `instrumental-variables.md` 4. **Making tables?** Check `tables-and-plots.md` 5. **Coming from R fixest?** Read `quickstart.md` then `gotchas.md`
| Skill | Relationship | |-------|-------------| | `data-scientist` | Methodology guidance — load for "why and when" behind methods | | `statsmodels` | Complement for non-FE models: GLM, time series, diagnostics | | `linearmodels` | Random effects, GMM, system estimation when pyfixest's FE-only approach is insufficient | | `svy` | Survey-weighted regression with complex survey designs. pyfixest's clustered SEs account for within-group correlation but do NOT handle full survey design features (stratification, unequal probability weights, FPC). If your data comes from a complex probability survey, use `svy` for design-based inference | | `polars` | Data preparation before estimation (convert to pandas before passing to pyfixest) | | `plotnine` | Custom visualization beyond pyfixest's built-in plots |
What kind of regression? ├─ OLS with fixed effects → ./references/quickstart.md ├─ OLS without fixed effects → ./references/quickstart.md ├─ IV / 2SLS → ./references/instrumental-variables.md ├─ Poisson (count data) → ./references/integration.md ├─ Logit / Probit → ./references/integration.md ├─ Quantile regression → ./references/integration.md └─ Multiple models at once → ./references/integration.md
DiD design? ├─ Simple 2x2 DiD (one treatment date) → ./references/difference-in-differences.md ├─ Staggered treatment timing → ./references/difference-in-differences.md │ ├─ did2s (Gardner imputation) → ./references/difference-in-differences.md │ ├─ Local projections DiD → ./references/difference-in-differences.md │ └─ Sun-Abraham saturated → ./references/difference-in-differences.md ├─ Event study plot → ./references/difference-in-differences.md ├─ Visualize treatment patterns → ./references/difference-in-differences.md └─ Parallel trends assessment → ./references/difference-in-differences.md
What inference? ├─ Heteroskedasticity-robust (HC1) → ./references/fixed-effects.md ├─ Clustered (one-way / two-way) → ./references/fixed-effects.md ├─ Few clusters (<20) → ./references/advanced-inference.md │
📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics paper (AER / QJE / JPE / ReStud /…
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation +…
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest +…
Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready manuscript. Use when users want…