pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Complex survey analysis: strata/PSU/weights, variance estimation (Taylor, BRR, jackknife, bootstrap), survey GLM, domain analysis, calibration. Polars-native. Use for NHANES, CPS, ACS PUMS, BRFSS, DHS. Non-survey regression: statsmodels/pyfixest.
Claude Code
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy --agent claude-code
Codex
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a codex -y
Cursor
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a cursor -y
Gemini CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a gemini-cli -y
GitHub Copilot
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a github-copilot -y
OpenCode
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a opencode -y
Windsurf
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill svy -a windsurf -y
name: svy description: >- Complex survey analysis: strata/PSU/weights, variance estimation (Taylor, BRR, jackknife, bootstrap), survey GLM, domain analysis, calibration. Polars-native. Use for NHANES, CPS, ACS PUMS, BRFSS, DHS. Non-survey regression: statsmodels/pyfixest. metadata: audience: research-coders domain: python-library library-version: "0.13.0" skill-last-updated: "2026-03-28"
svy: design-based analysis of complex survey data in Python. Covers survey design specification (strata, PSU, weights, FPC), variance estimation (Taylor linearization, BRR, jackknife, bootstrap), descriptive estimation (means, totals, proportions, ratios, medians), survey-weighted GLM regression (gaussian, binomial, Poisson), domain/subpopulation analysis, calibration, and survey data I/O (SAS, SPSS, Stata). Uses Polars DataFrames natively. Use when analyzing data from complex sample surveys (NHANES, CPS, ACS PUMS, MEPS, ECLS-K, BRFSS, DHS). For non-survey regression, use statsmodels; for fixed effects, use pyfixest; for panel/IV models, use linearmodels.
Comprehensive skill for complex survey data analysis with svy. Use decision trees below to find the right guidance, then load detailed references.
svy is the Python package for **design-based analysis of complex survey data**:
This skill targets **svy 0.13.0** (released 2026-03-25). svy supersedes **samplics** (archived 2026-03-10), an earlier library by the same author (Mamadou S. Diallo, Ph.D.). Key differences from samplics:
| File | Purpose | When to Read | |------|---------|--------------| | `estimation.md` | Means, totals, proportions, ratios, medians, domain estimation, cross-tabs, hypothesis tests | Descriptive survey statistics | | `regression.md` | Survey-weighted OLS, logistic, Poisson regression; extracting results; diagnostics | Survey regression models | | `design-weights.md` | Design specification, replicate weights, weight manipulation, variance setup, survey data I/O, federal survey patterns | Setting up the survey design object |
1. **New to svy?** Start with `design-weights.md` then `estimation.md` 2. **Need survey-weighted regression?** Read `design-weights.md` then `regression.md` 3. **Have replicate weights already?** Read `design-weights.md` (replicate design section) then `estimation.md` or `regression.md` 4. **Setting up a federal survey (NHANES, CPS, etc.)?** Read `design-weights.md` (federal survey patterns table) 5. **Coming from samplics?** Read `design-weights.md` for the new API; the `Sample` object replaces `TaylorEstimator`/`ReplicateEstimator`
| Skill | Relationship | |-------|-------------| | `data-scientist` | Provides methodology guidance (especially `survey-analysis.md`); svy provides implementation. Load data-scientist for "when and why" to use survey methods | | `statsmodels` | Complement for non-survey regression (OLS, GLM, time series, diagnostics). **WLS in statsmodels is NOT survey-weighted regression** — it does not account for stratification or clustering | | `pyfixest` | Complement for fixed effects models and DiD. pyfixest does not handle complex survey designs; use svy for survey-weighted estimation, pyfixest for FE/DiD | | `linearmodels` | Complement for panel models (RE, FD, Fama-MacBeth) and IV/GMM. Does not handle survey designs | | `polars` | svy uses Polars DataFrames natively. Load polars skill for data preparation before passing to svy |
What task?
├─ Descriptive statistics (mean, total, proportion)
│ └─ ./references/estimation.md
├─ Regression model
│ ├─ Linear (continuous outcome) → ./references/regression.md
│ ├─ Logistic (binary outcome) → ./references/regression.md
│ └─ Poisson (count outcome) → ./references/regression.md
├─ Set up the survey design object
│ └─ ./references/design-weights.md
├─ Read survey data from SAS/SPSS/Stata
│ └─ ./references/design-weights.md
├─ Subpopulation / domain analysis
│ └─ ./references/estimation.md
└─ Cross-tabulation
└─ ./references/estimation.mdWhat model?
├─ Linear regression (continuous Y)
│ └─ family="gaussian" → ./references/regression.md
├─ Logistic regression (binary Y)
│ └─ family="binomial" → ./references/regression.md
├─ Poisson regression (count Y)
│ └─ family="poisson" → ./references/regression.md
├─ Ordinal logistic / Cox survival / IV
│ └─ Not in svy — use rpy2 + R survey package (see rpy2 bridge below)
└─ Fixed effects + survey weights
└─ Not directly supported — see Boundaries belowWhat do you have? ├─ Design variables (strata, PSU, weights) │ └─ Taylor linearization → ./references/desig
## 🔥 力荐 · 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…