pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack โ pandas + numpy + scipy +โฆ
Panel data, IV/GMM, system regression. PanelOLS (FE/RE), BetweenOLS, Fama-MacBeth, IV2SLS/LIML/GMM, SUR, 3SLS, Driscoll-Kraay SEs. Use for RE/between, system estimation, or GMM. Complements pyfixest (FE + DiD) and statsmodels (GLM + time series).
Claude Code
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels --agent claude-code
Codex
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a codex -y
Cursor
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a cursor -y
Gemini CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a gemini-cli -y
GitHub Copilot
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a github-copilot -y
OpenCode
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a opencode -y
Windsurf
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill linearmodels -a windsurf -y
name: linearmodels description: >- Panel data, IV/GMM, system regression. PanelOLS (FE/RE), BetweenOLS, Fama-MacBeth, IV2SLS/LIML/GMM, SUR, 3SLS, Driscoll-Kraay SEs. Use for RE/between, system estimation, or GMM. Complements pyfixest (FE + DiD) and statsmodels (GLM + time series). metadata: audience: research-coders domain: python-library library-version: "7.0" skill-last-updated: "2026-03-27"
linearmodels: panel data, IV/GMM, system regression, and asset pricing models in Python. Covers PanelOLS (FE/RE), BetweenOLS, FirstDifferenceOLS, Fama-MacBeth, IV2SLS/LIML/GMM, SUR, IV3SLS, and Driscoll-Kraay SEs. Use for random effects estimation, between or first-difference panel models, system estimation (SUR, 3SLS), LIML/GMM instrumental variables, Fama-MacBeth regressions, or Driscoll-Kraay standard errors. Complements pyfixest (high-dimensional FE + DiD) and statsmodels (GLM + time series).
Comprehensive skill for panel data estimation, instrumental variables, system regression, and asset pricing with linearmodels (Kevin Sheppard). Use decision trees below to find the right guidance, then load detailed references.
linearmodels extends statsmodels with specialized model classes for structured data:
| File | Purpose | When to Read | |------|---------|--------------| | `quickstart.md` | Installation, MultiIndex setup, formula vs array API, first model | Starting with linearmodels | | `panel-models.md` | PanelOLS, RandomEffects, BetweenOLS, FD, Pooled, FamaMacBeth | Panel data estimation | | `iv-models.md` | IV2SLS, IVLIML, IVGMM, IVGMMCUE, AbsorbingLS | IV / GMM estimation | | `system-models.md` | SUR, IV3SLS, IVSystemGMM, cross-equation constraints | System estimation | | `asset-pricing.md` | LinearFactorModel, TradedFactorModel, GMM estimation | Asset pricing tests | | `covariance-inference.md` | All SE types, Driscoll-Kraay, clustering, GMM weights | Choosing standard errors | | `gotchas.md` | MultiIndex requirement, pyfixest/statsmodels boundary, limits | Debugging issues |
1. **New to linearmodels?** Start with `quickstart.md` then `panel-models.md` 2. **Need IV/GMM?** Read `quickstart.md` then `iv-models.md` 3. **System estimation (SUR/3SLS)?** Read `quickstart.md` then `system-models.md` 4. **Asset pricing?** Read `quickstart.md` then `asset-pricing.md` 5. **Choosing SEs?** Read `covariance-inference.md` 6. **Coming from pyfixest?** Read `quickstart.md` then `gotchas.md`
| Skill | Relationship | |-------|-------------| | `pyfixest` | Preferred for high-dimensional FE, FE + IV, DiD, fast demeaning, publication tables. Use linearmodels when pyfixest cannot do what you need (RE, system models, LIML/GMM, Fama-MacBeth) | | `statsmodels` | Foundation library. Use statsmodels for GLM, time series, diagnostics. linearmodels extends statsmodels for panel/IV/system models | | `svy` | Survey-weighted regression with complex survey designs. linearmodels supports `weights` for population/precision weighting in panel models, but this is NOT equivalent to design-based survey inference โ it does not handle stratification, clustering as a design feature, or replicate weights. If your data comes from a complex probability survey, use `svy` | | `data-scientist` | Methodology guidance โ load for "why and when" behind model choices | | `polars` | Data preparation before estimation; convert to pandas with `.to_pandas()` before passing to linearmodels |
What panel estimation method?
โโ Fixed effects (within estimator)
โ โโ 1-2 way FE, no IV โ linearmodels PanelOLS or pyfixest feols
โ โโ 3+ way FE โ pyfixest (linearmodels max 2-way in PanelOLS)
โ โโ FE + IV combined โ pyfixest (linearmodels has no Panel IV)
โ โโ FE + DiD โ pyfixest (linearmodels has no DiD)
โโ Random effects (GLS) โ linearmodels RandomEffects
โ โโ โ ./references/panel-models.md
โโ FE vs RE comparison โ linearmodels (run both, compare)
โ โโ โ ./references/panel-models.md
โโ Between estimator โ linearmodels BetweenOLS
โ โโ โ ./references/panel-models.md
โโ First difference โ linearmodels FirstDifferenceOLS
โ โโ โ ./references/panel-models.md
โโ Pooled OLS (panel-aware SEs) โ linearmodels PooledOLS
โ โโ โ ./references/panel-models.md
โโ Fama-MacBeth โ linearmodels FamaMacBeth
โโ โ ./references/panel-models.mdWhat IV method?
โโ 2SLS (standard IV)
โ โโ With fixed effects โ pyfixest (linearmodels has no Panel IV)
โ โโ Without FE โ linearmodels IV2SLS or pyfixest
โ โโ โ ./references/iv-models.md
โโ LIML / k-class (better finite-sample) โ linearmodels IVLIML
โ โโ โ ./references/iv-models.md
โโ GMM-IV (efficient, overidentified) โ linearmodels IVGMM
โ โโ โ ./references/iv-models.md
โโ Continuously updating GMM โ linearmodels IVGMMCUE
โ โโ โ ./references/iv-models.md
โโ High-dimensional absorbed FE (OLS) โ linearmodels AbsorbingLS
โโ โ ./references/iv-models.mdSystem of equations? โโ Multiple equations, correlated errors โ SUR โ โโ โ ./references/system-models.md โโ Multiple equations + endogenous variables โ IV3SLS โ โโ โ ./references/system-models.md โโ System GMM โ IVSystemGMM โ โโ โ ./references/system-models.md โโ Cross-equation paramet
## ๐ฅ ๅ่ ยท 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โฆ