stata

Provide Stata syntax references and gotcha guidance for writing and debugging .do files.

220|358|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/maxwell2732/codex-stata-for-economists --skill stata-maxwell2732
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stata
Source: https://github.com/maxwell2732/codex-stata-for-economists/tree/main/.claude/skills/stata
Command: npx skills add https://github.com/maxwell2732/codex-stata-for-economists --skill stata-maxwell2732

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid Stata syntax mistakes and silent econometric bugs when writing, debugging, or explaining Stata .do files so your workflow is reproducible and correct.

Core Features & Use Cases

  • Do-file writing and debugging: Covers core Stata patterns for data import, cleaning, regression, and plotting, plus common failure modes.
  • Econometrics and applied workflows: Guides correct use of linear models, limited dependent variable models, panel methods, causal inference workflows, and diagnostics.
  • Package-aware guidance: Includes practical documentation for many widely used community packages (e.g., reghdfe, estout/esttab, csdid, did_multiplegt, rdrobust, coefplot).
  • Safety/quality guardrails: Emphasizes critical gotchas (missing values behavior, macro syntax, bysort requirements, merge diagnostics, factor-variable conventions, etc.) to prevent wrong results.

Quick Start

Tell the AI: "I need you to write and explain Stata code to load my dataset, clean missing values correctly, run an OLS/IV or a DiD model as appropriate, export regression tables and graphs into output files, and include detailed Chinese comments so I can reproduce everything."

Frequently Asked Questions about stata

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid silent econometric bugs when writing Stata do-files for data management and regression?

To avoid silent econometric bugs in Stata do-files, you must document syntax details, validate merge diagnostics, handle missing values behavior, and verify factor-variable conventions to ensure reproducible research workflows.

What is the correct way to handle missing values and merge diagnostics in Stata data cleaning?

Correct Stata data cleaning requires checking missing values behavior and running merge diagnostics before proceeding. Validating these safety guardrails prevents wrong results and ensures your dataset is properly cleaned for regression estimation.

How do I export publication-style regression tables and graphics in Stata using community packages?

Exporting publication-style regression tables and graphics in Stata involves using major community packages like estout/esttab and coefplot. These tools format stored estimation results and generate output files for reproducible research.

Does this Stata guidance support causal inference workflows like difference-in-differences and regression discontinuity?

Yes, this Stata guidance supports causal inference workflows by providing practical documentation for widely used community packages like csdid, did_multiplegt, and rdrobust to correctly implement difference-in-differences and regression discontinuity designs.

Why do my Stata factor-variable rules and macro syntax produce wrong regression estimation results?

Wrong regression estimation results in Stata often stem from incorrect factor-variable rules, macro syntax errors, or ignored bysort requirements. Documenting these gotchas ensures correct implementation of linear and panel models.

Can I use reghdfe for panel data econometrics alongside standard OLS regression diagnostics in Stata?

You can use reghdfe for panel data econometrics alongside standard OLS regression diagnostics in Stata. This package-aware guidance covers limited dependent variable models, panel methods, and necessary workflow validation checks.