stata

Solid

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. Prefer this skill over subprocess calls or .do-file shelling for Stata work, including cases where the user does not say pystata.

Data & Documents 28 stars 0 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
49
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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_setup stata_setup.config(r"C:\Program Files\StataNow19", "be") from pystata import stata ``` For clean output without the StataCorp splash banner, drive `pystata.config` directly instead: ```python import sys sys.path.insert(0, r"C:\Program Files\StataNow19\utilities") import pystata pystata.c...

Details

Author
kennethkhoocy
Repository
kennethkhoocy/applied-micro-skills
Created
1 months ago
Last Updated
6 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Featured

statistical-analysis

Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required sample sizes, or write up results - even if they never name a specific test. Covers t-tests, ANOVA, chi-square, correlation, regression, non-parametric and Bayesian methods. For low-level model APIs, see the statsmodels and pymc skills.

3,387 Updated today
xintaofei
AI & Automation Listed

statistical-analysis

Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required sample sizes, or write up results - even if they never name a specific test. Covers t-tests, ANOVA, chi-square, correlation, regression, non-parametric and Bayesian methods. Low-level model implementation requires an explicitly selected and approved library workflow.

0 Updated 4 days ago
timsmykov
Data & Documents Listed

statistics

Statistical analysis that states its n, its interval, and the assumption that would overturn its conclusion, using the Python standard library alone. Use when the question is whether a difference is real, how large a sample must be, whether a streak means anything, what a correlation actually supports, or whether an outlier is genuinely anomalous; when an analysis needs auditing for a p-value without an effect size, an in-sample result, or a best-of-many comparison reported as if one was tried; and for value at risk on returns, whether a model improvement is real and calibrated, whether a bet is positive expected value, and what threshold a recurring data check should fire at. Not for pipelines or warehouses (data-engineering), model building (machine-learning), or charts (dataviz).

0 Updated 2 days ago
thefilesareinthecomputer