/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.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/pyfixest
Context 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.
SKILL.md
pyfixest.SKILL.mdname: 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 Skill
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.
What is pyfixest?
pyfixest is a Python implementation of the R **fixest** package (Berge, Butts, & McDermott, 2026):
- **Fast**: Multi-way FE demeaning via alternating projections with numba/JAX/GPU backends
- **Concise formula syntax**: Fixed effects after `|`, IV after second `|`, multiple estimation via `sw()`/`csw()`
- **Modern DiD**: Built-in did2s, local projections DiD (lpdid), and Sun-Abraham saturated estimator
- **Flexible inference**: Switch SE types post-estimation; wild bootstrap, randomization inference, CCV
- **Publication output**: `etable()` for regression tables, `coefplot()` and `iplot()` for coefficient visualization
Version Notes
This skill targets **pyfixest 0.40.0**, the major release aligning with R fixest 0.13. Breaking changes from earlier versions:
- Default standard errors changed from "cluster by first FE" to `"iid"` — old code silently produces different SEs
- `ssc()` arguments renamed: `adj` → `k_adj`, `fixef_k` → `k_fixef`, `cluster_adj` → `G_adj`, `cluster_df` → `G_df`
- `fixef_rm` default changed from `"none"` to `"singleton"` — singletons now dropped by default
- Multicollinearity tolerance reduced from 1e-10 to 1e-09
How to Use This Skill
Reference File Structure
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 |
Reading Order
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`
Related Skills
| 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 |
Quick Decision Trees
"I need to run a regression"
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
"I need difference-in-differences"
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
"I need to choose standard errors"
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
│
Read more
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 Skill
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.
What is pyfixest?
pyfixest is a Python implementation of the R **fixest** package (Berge, Butts, & McDermott, 2026):
- **Fast**: Multi-way FE demeaning via alternating projections with numba/JAX/GPU backends
- **Concise formula syntax**: Fixed effects after `|`, IV after second `|`, multiple estimation via `sw()`/`csw()`
- **Modern DiD**: Built-in did2s, local projections DiD (lpdid), and Sun-Abraham saturated estimator
- **Flexible inference**: Switch SE types post-estimation; wild bootstrap, randomization inference, CCV
- **Publication output**: `etable()` for regression tables, `coefplot()` and `iplot()` for coefficient visualization
Version Notes
This skill targets **pyfixest 0.40.0**, the major release aligning with R fixest 0.13. Breaking changes from earlier versions:
- Default standard errors changed from "cluster by first FE" to `"iid"` — old code silently produces different SEs
- `ssc()` arguments renamed: `adj` → `k_adj`, `fixef_k` → `k_fixef`, `cluster_adj` → `G_adj`, `cluster_df` → `G_df`
- `fixef_rm` default changed from `"none"` to `"singleton"` — singletons now dropped by default
- Multicollinearity tolerance reduced from 1e-10 to 1e-09
How to Use This Skill
Reference File Structure
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 |
Reading Order
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`
Related Skills
| 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 |
Quick Decision Trees
"I need to run a regression"
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
"I need difference-in-differences"
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
"I need to choose standard errors"
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 |
Other skills on auto-empirical-research-skills.
- /pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest + clubSandwich + AER + ivreg + did + bacondecomp + HonestDiD + eventstudyr + rdrobust + rddensity + Synth + gsynth + synthdid
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill - /00-Full-empirical-analysis-skill_StatsPAI
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 / AEJ) with DID / RD / IV / SCM / DML / matching, written-out estimating equation + identifying assumption, Table 1 /
Open skill - /00.1-Full-empirical-analysis-skill_Python
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /00.2-Full-empirical-analysis-skill_Stata
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill

