Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
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. R equivalent: fixest (use when execution language is R).
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
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):
|, IV after second |, multiple estimation via sw()/csw()etable() for regression tables, coefplot() and iplot() for coefficient visualizationThis skill targets pyfixest 0.60.0 (pre-installed in the DAAF container). Only three release lines sit between the previous target and this one — 0.40.0/0.40.1, 0.50.0/0.50.1, and 0.60.0 (there are no 0.41–0.49 releases). The cumulative changes that matter for existing code, oldest first:
0.40.0 (aligned with R fixest 0.13) — silent result changes:
"iid" — old code silently produces different SEsssc() arguments renamed: adj → k_adj, fixef_k → k_fixef, cluster_adj → G_adj, cluster_df → G_df; the old names still work but raise a DeprecationWarning (verified live). The option value "nested" was renamed to "nonnested" — passing "nested" now errorsfixef_rm default changed from "none" to "singleton" — singletons now dropped by defaultdecompose() reworked to return a GelbachDecomposition object (arg param → decomp_var)0.50.0 — table backend + FE-GLMs:
etable()/dtable() moved to the maketables backend (the great_tables dependency was replaced). The public etable() API is unchanged and, in this install, the default and type="gt" still return a great_tables.gt.GT object rendered via maketables (verified live)feglm() now supports fixed effects (logit/probit/gaussian) — the pre-0.50 "feglm does not support FE" limitation is gone (verified live: pf.feglm("ybin ~ X1 | f1", family="logit") fits)0.60.0 — Rust demeaner default, numba optional, typed backend API:
pyfixest[numba]). numba is still used for MapDemeaner(backend="numba") and fast randomization inference (ritest(..., choose_algorithm="fast")). DAAF's image ships numba transitively (via umap-learn/wildboottest), so the numba paths remain available heredemeaner_backend, fixef_tol, and fixef_maxiter kwargs are deprecated in favor of a typed demeaner=MapDemeaner(...) / LsmrDemeaner(...) object; the old kwargs still work but raise a DeprecationWarning (verified live)etable(type="typst") added; fepois(offset=...) exposure terms addedSee gotchas.md for the full cumulative breaking-change detail and migration notes.
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, 0.40→0.60 cumulative breaking changes, fixest vs pyfixest | Debugging issues |
quickstart.md then fixed-effects.mdquickstart.md, then difference-in-differences.mdquickstart.md, then instrumental-variables.mdtables-and-plots.mdquickstart.md then gotchas.mdThe reference-file routing in this skill applies to advisory and brainstorming turns as much as implementation. Recommending an approach, reviewing a plan, or answering a question that touches a routed topic calls for reading the routed reference file just as much as writing code does — the reference files carry curated caveats and environment-specific constraints that this overview and general knowledge lack.
| 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
│ └─ Wild cluster bootstrap → ./references/advanced-inference.md
├─ HAC / Newey-West → ./references/fixed-effects.md
├─ Randomization inference → ./references/advanced-inference.md
├─ Multiple hypothesis testing → ./references/advanced-inference.md
└─ Causal cluster variance (CCV) → ./references/advanced-inference.md
Presenting results?
├─ Regression table (multiple models) → ./references/tables-and-plots.md
├─ Coefficient plot → ./references/tables-and-plots.md
├─ Event study plot → ./references/tables-and-plots.md
├─ Descriptive statistics table → ./references/tables-and-plots.md
└─ LaTeX output → ./references/tables-and-plots.md
Having issues?
├─ Different results from old code → ./references/gotchas.md
├─ feglm / GLM with fixed effects → ./references/gotchas.md
├─ numba / demeaner backend questions → ./references/gotchas.md
├─ CRV3 memory issues → ./references/gotchas.md
├─ Poisson convergence → ./references/gotchas.md
├─ Formula parsing errors → ./references/gotchas.md
├─ R fixest vs pyfixest differences → ./references/gotchas.md
└─ Singleton warnings → ./references/gotchas.md
Important: In data research pipelines (see CLAUDE.md), pyfixest regressions are executed through script files, not interactively. This ensures auditability and reproducibility.
The pattern:
scripts/stage8_analysis/{step}_{task-name}.pyClosely read agent_reference/SCRIPT_EXECUTION_REFERENCE.md for the mandatory file-first execution protocol covering complete code file writing, output capture, and file versioning rules. All regression scripts must follow the Inline Audit Trail (IAT) standard — see agent_reference/INLINE_AUDIT_TRAIL.md. For regression code, document model specification choices (why this estimator, why this clustering level, what identifying assumptions) with # INTENT:, # REASONING:, and # ASSUMES: comments.
See:
agent_reference/WORKFLOW_PHASE4_ANALYSIS.md — Stage 8 (Analysis & Visualization)agent_reference/INLINE_AUDIT_TRAIL.md — IAT documentation standardThe examples below show pyfixest syntax. In research workflows, wrap them in scripts following the file-first pattern.
import pyfixest as pf
| Function | Purpose |
|---|---|
pf.feols("Y ~ X | fe", data=df) | OLS with fixed effects |
pf.fepois("Y ~ X | fe", data=df) | Poisson with fixed effects |
pf.feglm("Y ~ X | fe", data=df, family="logit") | GLM (logit/probit/gaussian) with fixed effects (since 0.50) |
pf.feols("Y ~ X2 | fe | X1 ~ Z1", data=df) | IV / 2SLS |
pf.did2s(data, yname, first_stage, second_stage, treatment, cluster) | Gardner (2022) DiD |
pf.event_study(data, yname, idname, tname, gname, estimator) | Unified event study |
pf.lpdid(data, yname, idname, tname, gname) | Local projections DiD |
| Pattern | Meaning | Example |
|---|---|---|
Y ~ X1 + X2 | No FE | "wage ~ educ + exper" |
Y ~ X | fe1 + fe2 | With FE | "wage ~ educ | state + year" |
Y ~ X | fe | endog ~ inst | FE + IV | "wage ~ exper | state | educ ~ college_prox" |
i(factor, ref=val) | Categorical with ref | "Y ~ i(year, ref=2000) | state" |
sw(X1, X2) | Stepwise alternatives | "Y ~ sw(educ, exper) | state" |
csw0(X1, X2) | Cumulative stepwise | "Y ~ csw0(educ, exper) | state" |
Y1 + Y2 ~ X | Multiple outcomes | "wage + hours ~ educ | state" |
fit = pf.feols("Y ~ X1 + X2 | fe", data=df)
fit.summary() # Print results
fit.tidy() # DataFrame of coefficients
fit.vcov("hetero") # Re-estimate with robust SEs (requires arg)
fit.vcov({"CRV1": "state"}) # Re-estimate with clustered SEs
fit.coef() # Coefficient values
fit.se() # Standard errors
fit.confint() # Confidence intervals
fit.predict() # Fitted values
fit.resid() # Residuals
fit.fixef() # Dict of FE name → numpy array (not a DataFrame)
pf.etable([fit1, fit2, fit3]) # Regression table
pf.coefplot([fit1, fit2]) # Coefficient plot
pf.iplot(fit) # Event study / interaction plot
pf.panelview(data, unit, time, treat) # Treatment pattern visualization
| Topic | Reference File |
|---|---|
| Installation | ./references/quickstart.md |
| First regression | ./references/quickstart.md |
| Formula syntax | ./references/quickstart.md |
| SE comparison table | ./references/quickstart.md |
| Multi-way fixed effects | ./references/fixed-effects.md |
| Standard error types | ./references/fixed-effects.md |
| Clustered SEs | ./references/fixed-effects.md |
| HAC / Newey-West | ./references/fixed-effects.md |
| Backend options | ./references/fixed-effects.md |
| IV formula syntax | ./references/instrumental-variables.md |
| First-stage diagnostics | ./references/instrumental-variables.md |
| Weak instrument tests | ./references/instrumental-variables.md |
| TWFE | ./references/difference-in-differences.md |
| did2s | ./references/difference-in-differences.md |
| Local projections DiD | ./references/difference-in-differences.md |
| Sun-Abraham | ./references/difference-in-differences.md |
| Event study plots | ./references/difference-in-differences.md |
| Parallel trends | ./references/difference-in-differences.md |
| panelview | ./references/difference-in-differences.md |
| etable | ./references/tables-and-plots.md |
| coefplot | ./references/tables-and-plots.md |
| iplot | ./references/tables-and-plots.md |
| dtable | ./references/tables-and-plots.md |
| Wild cluster bootstrap | ./references/advanced-inference.md |
| Randomization inference | ./references/advanced-inference.md |
| Multiple testing corrections | ./references/advanced-inference.md |
| Gelbach decomposition | ./references/advanced-inference.md |
| CCV | ./references/advanced-inference.md |
| Multiple estimation | ./references/integration.md |
| Poisson regression | ./references/integration.md |
| GLM (logit/probit) | ./references/integration.md |
| Quantile regression | ./references/integration.md |
| marginaleffects | ./references/integration.md |
| Online learning | ./references/integration.md |
| Performance tuning | ./references/integration.md |
| Polars DataFrame input | ./references/gotchas.md |
| Polars-to-pandas conversion | ./references/quickstart.md |
| DiD clustering level | ./references/difference-in-differences.md |
| 0.40→0.60 breaking changes | ./references/gotchas.md |
| feglm with fixed effects | ./references/gotchas.md |
| numba / Rust demeaner backend | ./references/gotchas.md |
| Formula parsing | ./references/gotchas.md |
| R fixest differences | ./references/gotchas.md |
When this library is used as a primary analytical tool, include in the report's Software & Tools references:
Berge, L., Butts, K., & McDermott, G. (2026). pyfixest: Fast high-dimensional fixed effects estimation [Computer software]. Based on fixest (R).
Cite when: pyfixest is used for regression estimation (OLS, Poisson, IV) or difference-in-differences analysis. Do not cite when: Only imported but no estimation performed.
For method-specific citations (e.g., individual DiD estimators or inference techniques),
consult the reference files in this skill and agent_reference/CITATION_REFERENCE.md.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
Researcher-facing analytic triangulation ("creative verification") for stress-testing provisional findings and designing pre-specified challenges before an analysis runs. Turns a researcher's concern or focal claim into competing explanations, bounded discriminating tests, audited diagnostic artifacts, and evidence-calibrated interpretations in a hypothesis/evidence ledger — behavioral, output-level verification replacing line-by-line code review. Covers 12 challenge families organized by Shadish-Cook-Campbell validity type, named sensitivity statistics, pre-committed interpretation rules, anti-fishing guardrails, and interactive diagnostic-artifact QA. Use in Ad Hoc Collaboration to verify, challenge, or stress-test a result, or to design discriminating tests before an analysis runs. Not code-change verification (verify skill / code review) and not final adjudication or re-execution (data-verifier, Reproducibility Verification) — prospective, hypothesis-driven challenge design of analytic claims.
中文简介正在准备中。当前显示原文说明。
In-situ smoke testing that verifies a LIVE DAAF deployment functions end-to-end in whatever provider route it is configured for. Auto-detects the active install route (anthropic-subscription, openrouter, chatgpt-subscription shim, openai-api shim) and runs tiered probes: Tier 0 free preflight (route/env coherence, hooks, statuslines, shim health); Tier 1 one live round-trip (~cents); Tier 2 a six-probe functional battery (dispatch, coding, web, skill loading, isolation-strip, nested-dispatch deny); Tier D a zero-cost deterministic battery (bats, Pester, lint, safety-hook tests). Use after install, after a rebuild or update, after any provider/config change (new API key, model remap, shim change), for pre-release validation, or when asked "is my install working" or to "smoke test the deployment/config." Requires the DAAF_DEV=1 dev image; a contributor tool, not end-user-facing. NOT DAAFBench (model behavioral-adherence evaluation under benchmarks/) and NOT scripts/smoke_tests/ (R/Python library-package smoke tests).
中文简介正在准备中。当前显示原文说明。
Operational framework for the DAAF orchestrator. Defines engagement modes, confirmation protocol, subagent dispatch, context budget, and reference-loading. Loaded exclusively by the orchestrator — not for subagents or user questions.
中文简介正在准备中。当前显示原文说明。
Data science methodology and method-selection routing for quantitative research. Covers EDA, data validation, descriptive analysis, causal inference (IV, DiD, RD, synthetic control), clustering/PCA/UMAP, supervised ML, geospatial analysis, network analysis, and visualization design. Contains the canonical method-to-library routing tree, routed by execution language — Python: statsmodels (OLS/GLM/time series), pyfixest (FE/DiD), linearmodels (RE/GMM/SUR), svy (complex surveys), scikit-learn (clustering/prediction ML), geopandas (spatial), igraph (network analysis); R: r-stats (OLS/GLM/time series), fixest (FE/DiD), plm (panel/RE/IV), survey-r (complex surveys), tidymodels (ML), sf-terra (spatial), igraph-r (network analysis). Load the routed tool-specific skill before giving tool-specific advice or writing code — library skills encode environment constraints and curated caveats absent from general knowledge.
中文简介正在准备中。当前显示原文说明。
Interpretation guidance for Urban Institute Education Data Portal datasets. The Portal is a curation layer over federal data: lowercase variable names, integer-encoded categoricals, standardized missing codes (-1 missing, -2 not applicable, -3 suppressed). Covers year definitions, grade encoding (grade=-1 is Pre-K, not missing), suppression rates, ODC-By licensing, and cross-source join identifiers. Load before analyzing any Portal data. Routes to source-specific deep-dive skills for individual datasets.
中文简介正在准备中。当前显示原文说明。