stata

Guide Stata users through data management, statistical analysis, and programming.

275|80|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/dylantmoore/stata-skill --skill stata-dylantmoore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stata
Source: https://github.com/dylantmoore/stata-skill/tree/main/skills/stata
Command: npx skills add https://github.com/dylantmoore/stata-skill --skill stata-dylantmoore

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and packages (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for using Stata, enabling users to write, debug, and understand Stata code effectively.

Core Features & Use Cases

  • Syntax and Best Practices: Covers critical Stata gotchas, command syntax, and workflow tips.
  • Data Management: Detailed instructions on importing, cleaning, transforming, merging, and reshaping data.
  • Statistical Analysis: Guides through descriptive statistics, regression, panel data, time series, causal inference, and advanced econometrics.
  • Programming: Explains Stata's programming capabilities, including macros, programs, Mata, and class programming.
  • Use Case: A researcher needs to perform a difference-in-differences analysis with staggered treatment adoption. They can use this Skill to find the relevant sections on DiD, understand the pitfalls of TWFE, and learn how to use modern packages like csdid or did_multiplegt for robust estimation and plotting.

Quick Start

Use the stata skill to explain how to perform a difference-in-differences analysis with staggered treatment adoption.

Frequently Asked Questions about stata

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

FAQPage Schema
How do I run a difference-in-differences analysis with staggered treatment adoption in Stata?

To run a difference-in-differences analysis with staggered treatment adoption in Stata, use modern community packages like `csdid` or `did_multiplegt` for robust estimation and plotting. These packages help avoid pitfalls associated with traditional two-way fixed effects (TWFE) regression by providing accurate treatment effect estimates under staggered rollout designs.

What is the best way to clean and reshape panel data for econometrics in Stata?

The best way to clean and reshape panel data for econometrics in Stata is to use built-in data management commands for importing, transforming, merging, and reshaping datasets. This skill guides you through detailed data manipulation techniques to ensure your panel data structure accurately supports fixed-effects and random-effects statistical models.

Can I use Mata for advanced programming and class definitions in Stata?

Yes, you can use Mata for advanced programming and class definitions in Stata. This skill explains Stata's programming capabilities, including how to utilize macros, write custom programs, and leverage Mata's matrix programming language to build classes and execute complex mathematical computations efficiently.

How does Stata handle causal inference and regression analysis?

Stata handles causal inference and regression analysis by providing built-in statistical commands alongside detailed guidance on econometric methods. It supports core syntax for descriptive statistics, panel data analysis, time series modeling, and advanced causal inference techniques, helping you estimate treatment effects and interpret results accurately.

Are there community packages for creating regression tables and plotting in Stata?

Yes, there are community packages available for creating regression tables and plotting in Stata. This skill offers detailed explanations of specialized community-contributed commands designed to format regression outputs into publication-ready tables and generate robust visual graphics for data presentation.

Why does my two-way fixed effects (TWFE) regression fail with staggered treatment timing?

Your two-way fixed effects (TWFE) regression fails with staggered treatment timing because TWFE can produce negative weighted averages of treatment effects under staggered adoption. To resolve this, use modern difference-in-differences packages like `csdid` or `did_multiplegt` which correctly handle staggered treatment designs.