Agent skill · Data & Analytics

stata

Use this skill whenever the user asks to run Stata commands, estimate econometric models, work with .dta files, run a .do file, generate Stata output, or do any statistical analysis where Stata is involved. Also trigger when the user mentions Stata variables, Stata syntax, or econometric tasks where Stata is the natural tool, including regressions, IV estimation, diff-in-diff, RDD, panel data, clustering, summary statistics, and margins. Stata runs through pystata on StataNow 19.5 BE; configure once with stata_setup, then drive everything with stata.run() and exchange data directly with pandas

kennethkhoocygithub.com/kennethkhoocyGitHub ↗
claude-codecodexships scriptsMIT
Install
npx skills add kennethkhoocy/applied-micro-skills --skill stata --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 5
SKILL.md size: 9 KB
Bundled scripts: yes
Path: plugins/applied-micro/skills/stata/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 54
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Stata Skill — pystata on StataNow 19.5 BE Run Stata entirely through **pystata**, the official Python integration that ships with Stata. Configure the session once, then issue every command — and run every `.do` file — with `stata.run()`. Data crosses between Python and Stata in memory through pandas, so there is no need to write intermediate `.dta` files or read `.log` files unless the user wants them. ## The one rule that matters most **Always execute Stata through pystata.** Both individual commands and entire `.do` files go through `stata.run(...)`. Never launch `StataBE-64.exe` as a subprocess and never run a do-file in batch mode — pystata keeps a single live Stata session in the Python process, gives direct access to data and stored results, and raises real Python exceptions on errors. Running a do-file is just `stata.run('do "path/to/file.do"')`. ## Setup This machine has **StataNow 19.5 BE** at `C:\Program Files\StataNow19`, and it is already on PATH. `pystata` and `stata_setup` are installed for the system Python (3.14). Basic Edition (BE) is the only licensed edition; `"se"` and `"mp"` cannot be initialized. Configure once per Python process: ```python import stata_set

What's inside
Steps it walks through
  1. The one rule that matters most
  2. Setup
  3. Bundled helper (optional)
  4. Running commands
  5. Capturing output
  6. Error handling
  7. Data exchange with pandas
  8. Reading stored results
  9. Running an existing .do file
  10. BE edition constraints
  11. Stata 19 capabilities (absent in the old Stata 16 setup)
  12. Econometric workflow conventions
  13. Troubleshooting
  14. What this skill does not do
Ships with 4 files
  • README.md
  • evals/evals.json
  • references/pystata-api.md
  • scripts/stata_runner.py
More from applied-micro-skills
All skills →
About this skill
What does the stata skill do?

Use this skill whenever the user asks to run Stata commands, estimate econometric models, work with .dta files, run a .do file, generate Stata output, or do any statistical analysis where Stata is involved. Also trigger when the user mentions Stata variables, Stata syntax, or econometric tasks where Stata is the natural tool, including regressions, IV estimation, diff-in-diff, RDD, panel data, clustering, summary statistics, and margins. Stata runs through pystata on StataNow 19.5 BE; configure once with stata_setup, then drive everything with stata.run() and exchange data directly with pandas

How do I install it?

Run `npx skills add kennethkhoocy/applied-micro-skills --skill stata --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 kennethkhoocy/applied-micro-skills, a repository with 54 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.

Keep going