Stata Integration
mintd provides seamless integration with Stata 16+ through native Python commands.
Cross-Platform Stata Detection
mintd automatically detects Stata executables on Windows, macOS, and Linux:
- macOS/Linux: Searches PATH for
stata-mporstatausingshutil.which() - Windows: Uses
where.exeto find Stata installations, including common Program Files paths - Fallback: Allows manual override in
~/.mintd/config.yaml
Automatic Detection Examples:
# macOS/Linux - detects stata-mp
$ mintd create data --name analysis --lang stata
✅ Stata detected: stata-mp
# Windows - detects Stata installation
> mintd create data --name analysis --lang stata
✅ Stata detected: C:\Program Files\Stata18\StataMP-64.exe
Manual Configuration:
# ~/.mintd/config.yaml
tools:
stata:
executable: "/custom/path/to/stata" # Override auto-detection
detected_path: "stata-mp" # Last successful detection
Platform-Aware Script Execution
Scripts run from the code/ directory with platform-appropriate commands:
macOS/Linux:
Windows:
This ensures consistent path handling regardless of platform, with Stata scripts using relative paths (../data/ for data directories).
Installation for Stata Users
Option 1: Automated Installation (Recommended)
// Automated installation (installs Stata package + Python package)
mintd_installer
// Verify installation
help mintd
Option 2: Via Stata's net install
// Install Stata package from GitHub (may not work if repository is private)
net install mintd, from("https://github.com/health-care-affordability-lab/mintd/raw/main/stata/")
// If net install fails, use the automated installer instead:
mintd_installer, github
// Install Python package
python: import subprocess; subprocess.run(["pip", "install", "git+https://github.com/health-care-affordability-lab/mintd.git"])
// Verify installation
help mintd
Option 3: Manual Installation
-
Install mintd in Stata's Python environment:
-
Install Stata files: Copy
stata/mintd.adoandstata/mintd.sthlpto your Stata ado directory. -
Usage in Stata:
Stata Command Reference
mintd, type(string) name(string) [path(string) nogit nodvc bucket(string)]
Options:
type(string) - Project type: data, project
name(string) - Project name
path(string) - Output directory (default: current)
nogit - Skip Git initialization
nodvc - Skip DVC initialization
bucket(string) - Custom DVC bucket name