statalisted
Install: claude install-skill kennethkhoocy/applied-micro-skills
# 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