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 in R: feols/fepois/feglm/fenegbin with multi-way FE; IV estimation; DiD (TWFE, Sun-Abraham via sunab); clustered/ heteroskedasticity-robust SEs; etable/coefplot/iplot for reporting. Use when execution language is R. Python equivalent: pyfixest. For panel RE/between use plm; for GLM without FE use r-stats.
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
fixest: the canonical R package for fast high-dimensional fixed effects estimation. Covers OLS (feols), Poisson (fepois), GLM (feglm, including logit/probit with FE), negative binomial (fenegbin), and nonlinear models (feNmlm) with multi-way absorbed fixed effects. Supports instrumental variables via three-part formula; difference-in- differences via TWFE and Sun-Abraham (sunab); standard errors including clustered, heteroskedasticity-robust, Newey-West, Driscoll-Kraay, and Conley spatial; and publication output via etable, coefplot, and iplot. Use when execution language is R and the analysis involves fixed effects regression, IV, DiD, or publication-quality regression tables. Python equivalent: pyfixest (which is a port of this package). For panel random/between effects, use plm. For GLM/time series without fixed effects, use base R stats or dedicated packages.
Comprehensive skill for fixed effects regression, instrumental variables, and difference-in-differences estimation with the fixest R package. Use decision trees below to find the right guidance, then load detailed references.
fixest (Berge, 2018) is the most widely-used R package for fast fixed effects estimation in applied economics and quantitative social science:
|, IV after second |,
multi-estimation via sw()/csw()/csw0()sunab() formula function for staggered DiDvcov = ~group)etable() for regression tables, coefplot() and
iplot() for coefficient and event study visualizationThis skill targets fixest 0.14.0 (R 4.5.3). fixest 0.13 introduced the breaking changes that pyfixest adopted in 0.40.0 (default SE changed to IID, singleton removal by default, ssc argument renames); DAAF now ships pyfixest 0.60.0, which keeps those fixest-0.13-aligned defaults. fixest 0.14.0 is a stable release building on those defaults.
Key defaults in 0.14.0:
"iid" (not cluster-by-first-FE as in pre-0.13)fixef.rm = "perfect_fit")ssc() arguments (canonical 0.14 names): K.adj, K.fixef, K.exact,
G.adj, G.df, t.df — the pre-0.13 names (adj, fixef.K,
cluster.adj, cluster.df) still work as deprecated back-compat aliasesEach topic in ./references/ contains focused documentation:
| File | Purpose | When to Read |
|---|---|---|
quickstart.md | feols() basics, formula syntax, multi-estimation (csw, sw, sw0), data requirements | Starting with fixest |
fixed-effects.md | Multi-way FE syntax, FE interactions (^), varying slopes, FE recovery via fixef() | FE models and specification |
standard-errors.md | Clustered SEs (vcov), HC robust, Conley spatial, Driscoll-Kraay, Newey-West, two-way clustering | Inference choices |
iv.md | IV three-part formula, first-stage diagnostics, weak instrument tests | IV/2SLS estimation |
did.md | TWFE with feols, sunab() for staggered DiD, event study plots via iplot() | DiD designs |
reporting.md | etable() for regression tables (LaTeX, data.frame), coefplot(), iplot(), fixef() for FE extraction | Presenting results |
models.md | fepois (Poisson), feglm (GLM with FE), fenegbin (negative binomial), feNmlm (nonlinear), model families | Non-OLS models |
gotchas.md | Singleton observations, separation in Poisson, formula parsing pitfalls, SE defaults, panel vs cross-section | Debugging issues |
quickstart.md then fixed-effects.mdquickstart.md, then did.mdquickstart.md, then iv.mdreporting.mdmodels.mdquickstart.md then gotchas.mdThe reference-file routing in this skill applies to advisory and brainstorming
turns as much as implementation. Recommending an SE choice, reviewing a DiD
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 (e.g., exact
fitstat type names, ssc() defaults) that this overview and general
knowledge lack.
| Skill | Relationship |
|---|---|
pyfixest | Python port of this package — near-identical formula syntax; residual gaps are GLM families beyond logit/probit/gaussian and fenegbin. Load when execution language is Python. |
data-scientist | Methodology guidance — load for "why and when" behind methods |
r-python-translation | Cross-language mappings for R fixest vs Python pyfixest and statsmodels |
plm | Random effects, between estimator, Hausman test — complements fixest when FE-only is insufficient |
r-stats | Base R glm(), lm() without FE — use when FE absorption is not needed |
gt | Publication-quality tables — use gt/modelsummary for formatted regression output (alternative to etable) |
What kind of regression?
├─ OLS with fixed effects → ./references/quickstart.md
├─ OLS without fixed effects → ./references/quickstart.md
├─ IV / 2SLS with FE → ./references/iv.md
├─ Poisson (count data) with FE → ./references/models.md
├─ Logit / Probit with FE → ./references/models.md (feglm)
├─ Negative binomial with FE → ./references/models.md (fenegbin)
├─ Multiple models at once → ./references/quickstart.md (sw/csw)
└─ Nonlinear custom model → ./references/models.md (feNmlm)
DiD design?
├─ Simple 2×2 DiD (one treatment date) → ./references/did.md
├─ Staggered treatment timing → ./references/did.md
│ ├─ Sun-Abraham saturated (sunab) → ./references/did.md
│ └─ TWFE (caution with heterogeneity) → ./references/did.md
├─ Event study plot → ./references/did.md + ./references/reporting.md
└─ Parallel trends assessment → ./references/did.md
What inference?
├─ Heteroskedasticity-robust (HC1) → ./references/standard-errors.md
├─ Clustered (one-way / two-way) → ./references/standard-errors.md
├─ Newey-West (HAC) → ./references/standard-errors.md
├─ Driscoll-Kraay (panel with cross-sect dependence) → ./references/standard-errors.md
├─ Conley spatial → ./references/standard-errors.md
└─ Small sample corrections (ssc) → ./references/standard-errors.md
Presenting results?
├─ Regression table (multiple models) → ./references/reporting.md
├─ Coefficient plot → ./references/reporting.md
├─ Event study plot → ./references/reporting.md
├─ LaTeX table output → ./references/reporting.md
└─ Extract fixed effects → ./references/reporting.md
Having issues?
├─ Different results from old code → ./references/gotchas.md
├─ Singleton warnings → ./references/gotchas.md
├─ Poisson separation/convergence → ./references/gotchas.md
├─ Formula parsing errors → ./references/gotchas.md
├─ pyfixest vs fixest differences → ./references/gotchas.md
└─ Collinearity with FE → ./references/gotchas.md
Important: In DAAF research pipelines, fixest regressions are executed through script files, not interactively. This ensures auditability and reproducibility.
The pattern:
scripts/stage8_analysis/{step}_{task-name}.RClosely 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 fixest syntax. In research workflows, wrap them in scripts following the file-first pattern.
library(fixest)
library(arrow) # For parquet I/O (DAAF convention)
| Function | Purpose |
|---|---|
feols(y ~ x | fe, data) | OLS with fixed effects |
fepois(y ~ x | fe, data) | Poisson with fixed effects |
feglm(y ~ x | fe, data, family) | GLM (logit, probit, etc.) with fixed effects |
fenegbin(y ~ x | fe, data) | Negative binomial with fixed effects |
feNmlm(fml, data, family) | Nonlinear models with fixed effects |
| Pattern | Meaning | Example |
|---|---|---|
y ~ x1 + x2 | No FE | y ~ educ + exper |
y ~ x | fe1 + fe2 | With FE | y ~ educ | state + year |
y ~ x | fe | x_endo ~ z | FE + IV | y ~ exper | state | educ ~ college_prox |
i(factor, ref = val) | Categorical with ref | y ~ i(year, ref = 2000) | state |
sunab(cohort, period) | Sun-Abraham DiD | y ~ sunab(cohort, period) | id + period |
sw(x1, x2) | Stepwise alternatives | y ~ sw(educ, exper) | state |
csw0(x1, x2) | Cumulative stepwise | y ~ csw0(educ, exper) | state |
c(y1, y2) ~ x | Multiple outcomes | c(wage, hours) ~ educ | state |
fit <- feols(y ~ x1 + x2 | fe, data = df)
summary(fit) # Print results
summary(fit, vcov = "hetero") # Re-estimate with robust SEs
summary(fit, vcov = ~state) # Clustered SEs
coef(fit) # Named vector of coefficients
se(fit) # Standard errors
confint(fit) # Confidence intervals
predict(fit) # Fitted values
resid(fit) # Residuals
fixef(fit) # List of FE estimates
r2(fit, type = "r2") # R-squared
r2(fit, type = "wr2") # Within R-squared
fitstat(fit, type = "ivf") # First-stage F (IV only)
etable(fit1, fit2, fit3) # Console regression table
etable(fit1, fit2, tex = TRUE) # LaTeX output
coefplot(fit1, fit2) # Coefficient plot
iplot(fit) # Event study / interaction plot
| Topic | Reference File |
|---|---|
| First regression | ./references/quickstart.md |
| Formula syntax | ./references/quickstart.md |
| Multi-estimation (sw, csw, csw0) | ./references/quickstart.md |
| Multiple outcomes (c(y1,y2)) | ./references/quickstart.md |
| Data requirements | ./references/quickstart.md |
| Multi-way fixed effects | ./references/fixed-effects.md |
| FE interactions (^) | ./references/fixed-effects.md |
| Varying slopes | ./references/fixed-effects.md |
| FE recovery (fixef) | ./references/fixed-effects.md |
| Singleton removal | ./references/fixed-effects.md |
| Clustered SEs | ./references/standard-errors.md |
| HC robust SEs | ./references/standard-errors.md |
| Two-way clustering | ./references/standard-errors.md |
| Newey-West (NW) | ./references/standard-errors.md |
| Driscoll-Kraay (DK) | ./references/standard-errors.md |
| Conley spatial | ./references/standard-errors.md |
| Small sample corrections (ssc) | ./references/standard-errors.md |
| IV formula syntax | ./references/iv.md |
| First-stage diagnostics | ./references/iv.md |
| Weak instrument tests | ./references/iv.md |
| TWFE DiD | ./references/did.md |
| Sun-Abraham (sunab) | ./references/did.md |
| Event study plots | ./references/did.md |
| Parallel trends | ./references/did.md |
| etable | ./references/reporting.md |
| coefplot | ./references/reporting.md |
| iplot | ./references/reporting.md |
| LaTeX output | ./references/reporting.md |
| Poisson (fepois) | ./references/models.md |
| GLM with FE (feglm) | ./references/models.md |
| Negative binomial (fenegbin) | ./references/models.md |
| Nonlinear (feNmlm) | ./references/models.md |
| Singleton observations | ./references/gotchas.md |
| Poisson separation | ./references/gotchas.md |
| Formula parsing pitfalls | ./references/gotchas.md |
| SE default changes | ./references/gotchas.md |
| pyfixest vs 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. (2018). "Efficient estimation of maximum likelihood models with multiple fixed-effects: the R package FENmlm." CREA Discussion Paper 2018-13. Updated as: Berge, L. (2026). fixest: Fast Fixed-Effects Estimations [Computer software]. https://CRAN.R-project.org/package=fixest
Cite when: fixest is used for regression estimation (OLS, Poisson, GLM, IV) or difference-in-differences analysis. Do not cite when: Only loaded but no estimation performed.
For the arXiv methods paper:
Berge, L., Butts, K., & McDermott, G. (2026). "Fast and User-Friendly Econometrics Estimations: The R Package fixest." arXiv:2601.21749.
For method-specific citations (e.g., Sun-Abraham, individual DiD estimators),
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.
中文简介正在准备中。当前显示原文说明。