pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
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.
Claude Code
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest --agent claude-code
Codex
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a codex -y
Cursor
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a cursor -y
Gemini CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a gemini-cli -y
GitHub Copilot
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a github-copilot -y
OpenCode
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a opencode -y
Windsurf
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill pyfixest -a windsurf -y
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 │
## 🔥 力荐 · StatsPAI — Stata 与 R 的 Python 平替,为 AI Agent 而生 🔁 Stata / R 平替:reghdfe、csdid、rdrobust、synth、fixest、did 等常用命令在 Python 中一站式替代,一个 import statspai as sp 搞定 DID / RD / IV / SCM / DML / matching 🤖 面向 Agent 设计:结构化结果对象 + 内置 MCP Server,Claude / Codex
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics…
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid +…
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven +…
Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready…
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…