stata-python-translation
Stata-to-Python translation for data analysis. Maps Stata commands (reghdfe, xtreg, ivregress, margins, esttab, svy:) to Python (polars, pyfixest, statsmodels, svy). Use when user has Stata background or requests Stata-equivalent code comments.
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill stata-python-translation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Translates Stata commands and workflows to Python equivalents within the DAAF ecosystem, covering data management, regression modeling, causal inference, surveys, visualization, and workflow tooling. It also provides an annotation protocol for agents to add inline Stata-equivalent comments to Python code, and identifies where Stata concepts diverge from Python.
How it works
The skill maps Stata commands and idioms to Python packages (e.g., polars, pyfixest, statsmodels, linearmodels, marginaleffects, svy, plotnine) across topics like data management, regression modeling, and visualization. It offers reference files in ./references/ that explain paradigm differences, command-by-command translations, and edge cases. It includes a Quick Decision Trees section guiding users on translating specific Stata commands to Python equivalents, and a comprehensive Command Mapping Overview detailing fidelity and differences. It also lists library versions and notes about which packages are unpinned.
How to use
- For auditing DAAF Python code from a Stata perspective, read paradigm-differences.md and the relevant domain file (e.g., data-management.md, regression-modeling.md).
- For annotating code with Stata-equivalent comments, follow the Agent Code Annotation Protocol and use the relevant domain file as guidance.
- For translating a Do-file, consult the reference structure and the Quick Decision Trees to locate the appropriate mapping.
When to use it
Use when a user has a Stata background, requests Stata-equivalent code comments, needs to audit Python code from a Stata perspective, or wants to translate Stata concepts to Python.
What it can touch
The skill references Python packages and workflows including polars, pyfixest, statsmodels, linearmodels, marginaleffects, svy, plotnine, plotly, and the svy package. It presents a mapping table showing which Stata commands map to which Python packages and functions, and notes fidelity levels.
Caveats
The skill is a routing hub with reference files rather than a single executable translation. It notes paradigm differences, and indicates where direct equivalents are absent or differ in API. It references specific Python and Stata packages and versions as of March 2026.
# Stata-to-Python Translation Skill Stata-to-Python translation reference for quantitative social science data analysis. Maps Stata commands and packages (reghdfe, xtreg, ivregress, margins, esttab, svy:, graph twoway) to DAAF Python equivalents (polars, pyfixest, statsmodels, linearmodels, marginaleffects, svy, plotnine). Use when user mentions Stata background, requests Stata-equivalent code com
What does the stata-python-translation skill do?
Stata-to-Python translation for data analysis. Maps Stata commands (reghdfe, xtreg, ivregress, margins, esttab, svy:) to Python (polars, pyfixest, statsmodels, svy). Use when user has Stata background or requests Stata-equivalent code comments.
How do I install it?
Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill stata-python-translation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.