
Stata Regression
- 374 installs
- 590 repo stars
- Updated June 23, 2026
- meleantonio/awesome-econ-ai-stuff
stata-regression is an agent skill that generates reproducible Stata regression workflows and publication-ready output tables for developers and economists running econometric analysis.
About
stata-regression is an agent skill in the meleantonio/awesome-econ-ai-stuff collection for running regression analyses in Stata with publication-ready tables. It walks through dependent variables, controls, fixed effects, and clustering strategy, then outputs tailored Stata code to load data, run estimators such as regress, xtreg, and reghdfe, apply robust or clustered standard errors, and export labeled tables via esttab or outreg2 to LaTeX, Word, or CSV. Developers and quantitative researchers reach for stata-regression when building reproducible policy or academic pipelines that need diagnostic checks, alternative specifications, and formatted regression output without hand-writing boilerplate .do files.
- stata-regression
- AI & Agent Building
- AI-coding skill
Stata Regression by the numbers
- 374 all-time installs (skills.sh)
- +12 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #2,072 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill stata-regressionAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 374 |
|---|---|
| repo stars | ★ 590 |
| Last updated | June 23, 2026 |
| Repository | meleantonio/awesome-econ-ai-stuff ↗ |
How do you run Stata regressions with esttab output?
Helps with ai & agent building tasks.
Who is it for?
Economists, data engineers, and policy researchers who write Stata pipelines and need reproducible regression tables with proper clustering and fixed effects.
Skip if: Teams using Python statsmodels or R fixest who do not run Stata 17+ or install SSC packages like estout and reghdfe.
When should I use this skill?
The user asks to run Stata regression, export esttab tables, set clustered standard errors, or run reghdfe or xtreg panel models.
What you get
Stata .do workflow code, regression diagnostics, and publication-ready tables in LaTeX, Word, or CSV via esttab or outreg2.
- Stata regression .do code
- publication-ready tables
- model diagnostic notes
Files
Stata Regression
Purpose
This skill produces reproducible regression analysis workflows in Stata, including model diagnostics and publication-ready tables using esttab or outreg2.
When to Use
- Estimating linear or nonlinear regression models in Stata
- Producing tables for academic papers and reports
- Running robustness checks and alternative specifications
Instructions
Follow these steps to complete the task:
Step 1: Understand the Context
Before generating any code, ask the user:
- What is the dependent variable and key regressors?
- What controls and fixed effects are required?
- How should standard errors be clustered?
- What output format is needed (LaTeX, Word, or CSV)?
Step 2: Generate the Output
Based on the context, generate Stata code that:
1. Loads and checks the data - Handle missing values and verify variable types 2. Runs the requested specification - Use regress, reghdfe, or xtreg as appropriate 3. Adds robust or clustered standard errors - Match the study design 4. Exports tables - Use esttab or outreg2 with clear labels
Step 3: Verify and Explain
After generating output:
- Explain what each model estimates
- Highlight assumptions and diagnostics
- Suggest robustness checks or alternative models
Example Prompts
- "Run OLS with firm and year fixed effects, clustering by firm"
- "Estimate a logit model and export results to LaTeX"
- "Create a regression table with three specifications"
Example Output
* ============================================
* Regression Analysis with Stata
* ============================================
* Load data
use "data.dta", clear
* Summary stats
summarize y x1 x2 x3
* Main regression with clustered SEs
regress y x1 x2 x3, vce(cluster firm_id)
eststo model1
* Alternative specification with fixed effects
reghdfe y x1 x2 x3, absorb(firm_id year) vce(cluster firm_id)
eststo model2
* Export table
esttab model1 model2 using "results/regression_table.tex", replace se labelRequirements
Software
- Stata 17+
Packages
estout(foresttab)reghdfe(optional, for high-dimensional fixed effects)
Install with:
ssc install estout
ssc install reghdfeBest Practices
1. Match standard errors to the design (cluster where treatment varies) 2. Report all model variants used in the analysis 3. Document variable definitions and transformations
Common Pitfalls
- Not clustering standard errors at the correct level
- Omitting fixed effects when required by the design
- Exporting tables without clear labels and notes
References
Changelog
v1.0.0
- Initial release
Stata Regression
Purpose
This skill produces reproducible regression analysis workflows in Stata, including model diagnostics and publication-ready tables using esttab or outreg2.
When to Use
- Estimating linear or nonlinear regression models in Stata
- Producing tables for academic papers and reports
- Running robustness checks and alternative specifications
Instructions
Follow these steps to complete the task:
Step 1: Understand the Context
Before generating any code, ask the user:
- What is the dependent variable and key regressors?
- What controls and fixed effects are required?
- How should standard errors be clustered?
- What output format is needed (LaTeX, Word, or CSV)?
Step 2: Generate the Output
Based on the context, generate Stata code that:
1. Loads and checks the data - Handle missing values and verify variable types 2. Runs the requested specification - Use regress, reghdfe, or xtreg as appropriate 3. Adds robust or clustered standard errors - Match the study design 4. Exports tables - Use esttab or outreg2 with clear labels
Step 3: Verify and Explain
After generating output:
- Explain what each model estimates
- Highlight assumptions and diagnostics
- Suggest robustness checks or alternative models
Example Prompts
- "Run OLS with firm and year fixed effects, clustering by firm"
- "Estimate a logit model and export results to LaTeX"
- "Create a regression table with three specifications"
Example Output
* ============================================
* Regression Analysis with Stata
* ============================================
* Load data
use "data.dta", clear
* Summary stats
summarize y x1 x2 x3
* Main regression with clustered SEs
regress y x1 x2 x3, vce(cluster firm_id)
eststo model1
* Alternative specification with fixed effects
reghdfe y x1 x2 x3, absorb(firm_id year) vce(cluster firm_id)
eststo model2
* Export table
esttab model1 model2 using "results/regression_table.tex", replace se labelRequirements
Software
- Stata 17+
Packages
estout(foresttab)reghdfe(optional, for high-dimensional fixed effects)
Install with:
ssc install estout
ssc install reghdfeBest Practices
1. Match standard errors to the design (cluster where treatment varies) 2. Report all model variants used in the analysis 3. Document variable definitions and transformations
Common Pitfalls
- Not clustering standard errors at the correct level
- Omitting fixed effects when required by the design
- Exporting tables without clear labels and notes
References
Changelog
v1.0.0
- Initial release
Related skills
How it compares
Pick stata-regression over python-panel-data when the pipeline must stay in Stata 17+ with esttab or outreg2 publication tables.
FAQ
What Stata estimators does stata-regression support?
stata-regression generates code for linear regress, panel xtreg, high-dimensional fixed-effects reghdfe, and nonlinear models such as logit, with robust or clustered standard errors aligned to the study design.
What output formats does stata-regression produce?
stata-regression exports labeled regression tables through esttab or outreg2 into LaTeX, Word, or CSV, alongside Stata .do workflow code and brief model assumption and diagnostic notes.