Agent skill

Stata Reference Guide

by wentorai in wentorai/research-plugins

Comprehensive Stata reference covering syntax, econometrics, and 20+ packages

MITAuto-check passedResearch & Science

Install Stata Reference Guide

skills CLI
$ npx skills add wentorai/research-plugins --skill stata-reference-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wentorai/research-plugins stata-reference-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/econometrics/stata-reference-guide .claude/skills/stata-reference-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stata-reference-guide
GitHub stars
298
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
200 words
Files
1
Skills in repo
405
Repo updated
First seen
Licence
MIT

At a glance

Comprehensive Stata reference covering syntax, econometrics, and 20+ packages

  • Works in 7 steps: Always set a random seed before any… → Use preserve/restore for temporary data… → Log your sessions: log using… → …
  • Tasks that involve Econometrics and empirical research
  • SKILL.md covers Overview, Core Syntax and Data Management, Estimation Commands and Community Packages (20+), plus 4 more sections
  • Reaches raw.githubusercontent.com

What it does

Stata Reference Guide is an agent skill from wentorai/research-plugins. Comprehensive Stata reference covering syntax, econometrics, and 20+ packages

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Econometrics and empirical research. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Econometrics and empirical research

Example prompts

  • “/stata-reference-guide”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Always set a random seed before any procedure involving randomness: set seed 12345
  2. Use preserve/restore for temporary data manipulations within a do-file
  3. Log your sessions: log using "analysis_log.smcl", replace
  4. Version control: Start do-files with version 17 (or your version) for reproducibility
  5. Use tempfiles for intermediate datasets: tempfile merged then save merged'`
  6. Profile your code with timer on 1 / timer off 1 / timer list for long-running operations
  7. Use gtools (greshape, gcollapse, gegen) for 5-10x speedups on large datasets

What it can do on your machine

Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are stata).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • raw.githubusercontent.com

    Also links to:

    • stata.com
    • stats.oarc.ucla.edu
    • stata-journal.com
    • ideas.repec.org
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stata Reference Guide loads about 2k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 200 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~25
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 200 words, ~1,973 tokens.

Download SKILL.mdSave it as .claude/skills/stata-reference-guide/SKILL.md (or your agent's skills folder).
name
stata-reference-guide
description
Comprehensive Stata reference covering syntax, econometrics, and 20+ packages

Stata Comprehensive Reference Guide

Overview

Stata is the dominant statistical software in economics, political science, public health, and sociology research. This guide provides a comprehensive reference covering core syntax, data management, estimation commands, causal inference methods, graphics, Mata programming, and 20+ community-contributed packages. It is designed as a progressive-disclosure reference: use the section relevant to your current task rather than reading end-to-end.

Core Syntax and Data Management

Data Import and Export
stata
* Import CSV with variable names in first row
import delimited "data.csv", clear varnames(1)

* Import Excel (specific sheet and cell range)
import excel "workbook.xlsx", sheet("Sheet1") cellrange(A1:Z1000) firstrow clear

* Import Stata format
use "dataset.dta", clear

* Export to CSV
export delimited "output.csv", replace

* Save as Stata format
save "cleaned_data.dta", replace
Variable Management
stata
* Generate new variables
gen log_income = ln(income)
gen age_sq = age^2
gen treatment_post = treatment * post

* Recode and label
recode education (1/12 = 1 "HS or less") (13/16 = 2 "College") (17/20 = 3 "Graduate"), gen(edu_cat)
label variable edu_cat "Education Category"

* String operations
gen first_name = word(full_name, 1)
gen year_str = string(year)
destring price_str, gen(price) force

* Date handling
gen date = date(date_str, "YMD")
format date %td
gen year = year(date)
gen quarter = quarter(date)
Data Cleaning Patterns
stata
* Identify and handle duplicates
duplicates report id year
duplicates tag id year, gen(dup_flag)
duplicates drop id year, force

* Missing values
misstable summarize
misstable patterns
replace income = . if income < 0  // recode impossible values

* Merge datasets
merge 1:1 id year using "panel_data.dta", keep(match master) nogen
merge m:1 state year using "state_controls.dta", keep(match master) nogen

* Reshape between wide and long
reshape long income_, i(id) j(year)
reshape wide income, i(id) j(year)

* Collapse to group level
collapse (mean) avg_income=income (sd) sd_income=income (count) n=income, by(state year)

Estimation Commands

Linear Regression
stata
* OLS with robust standard errors
reg y x1 x2 x3, robust

* Clustered standard errors
reg y x1 x2 x3, cluster(firm_id)

* Fixed effects (within estimator)
xtreg y x1 x2 x3, fe cluster(firm_id)
xtset firm_id year  // must declare panel structure first

* Absorbing high-dimensional FE (reghdfe)
reghdfe y x1 x2 x3, absorb(firm_id year) cluster(firm_id)

* Instrumental variables (2SLS)
ivregress 2sls y x1 x2 (endog_var = instrument1 instrument2), robust
estat firststage
estat overid
Panel Data Methods
stata
* Panel setup
xtset firm_id year

* Hausman test (FE vs RE)
quietly xtreg y x1 x2, fe
estimates store fe
quietly xtreg y x1 x2, re
estimates store re
hausman fe re

* Dynamic panel GMM (xtabond2)
xtabond2 y L.y x1 x2, gmm(L.y, lag(2 4)) iv(x1 x2) robust twostep

* Test for serial correlation and overidentification
estat abond    // Arellano-Bond test
estat sargan   // Sargan/Hansen test
Causal Inference
stata
* Difference-in-Differences
gen did = treatment * post
reg y did treatment post controls, cluster(state)

* Modern DiD with staggered treatment (csdid)
csdid y x1 x2, ivar(id) time(year) gvar(first_treat) method(dripw)
csdid_plot  // event study plot

* Regression Discontinuity (rdrobust)
rdrobust y running_var, c(0) p(1) kernel(triangular)
rdplot y running_var, c(0) p(1)

* Propensity Score Matching (psmatch2)
psmatch2 treatment x1 x2 x3, outcome(y) logit caliper(0.05) common
pstest x1 x2 x3  // balance check

* Synthetic Control (synth)
synth y x1 x2 x3 y(1990) y(1991) y(1992), trunit(1) trperiod(1993) fig
Limited Dependent Variables
stata
* Logit/Probit
logit binary_y x1 x2, robust
margins, dydx(*)  // average marginal effects

probit binary_y x1 x2, robust
margins, dydx(*)

* Ordered logit
ologit ordered_y x1 x2, robust
margins, predict(outcome(3)) dydx(x1)

* Tobit (censored regression)
tobit y x1 x2, ll(0)

* Poisson and Negative Binomial
poisson count_y x1 x2, robust
nbreg count_y x1 x2, robust

Community Packages (20+)

Installation
stata
* Install from SSC (Statistical Software Components)
ssc install reghdfe
ssc install estout
ssc install coefplot
ssc install csdid
ssc install rdrobust
ssc install psmatch2
ssc install synth
ssc install ivreg2
ssc install xtabond2
ssc install winsor2
ssc install gtools
ssc install ftools
ssc install binscatter
ssc install binsreg
ssc install grstyle

* Install from GitHub
net install did_multiplegt, from("https://raw.githubusercontent.com/chaisemartinDehejia/did_multiplegt/main")
Publication-Quality Output
stata
* estout / esttab — formatted regression tables
eststo clear
eststo: reg y x1 x2, robust
eststo: reg y x1 x2 x3, robust
eststo: reg y x1 x2 x3, cluster(firm_id)
esttab, se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Main Results") label replace ///
    scalars("r2 R-squared" "N Observations")

* Export to LaTeX
esttab using "table1.tex", replace booktabs ///
    se star(* 0.10 ** 0.05 *** 0.01) label

* Export to CSV/Excel
esttab using "table1.csv", replace se

* coefplot — coefficient visualization
coefplot est1 est2 est3, drop(_cons) xline(0) ///
    title("Coefficient Estimates") legend(order(1 "Model 1" 2 "Model 2" 3 "Model 3"))

Graphics

stata
* Scatter with fit line
twoway (scatter y x) (lfit y x), title("Y vs X") ///
    xtitle("X Variable") ytitle("Y Variable")

* Event study plot
coefplot, vertical drop(_cons) yline(0) ///
    title("Event Study") xtitle("Periods Relative to Treatment")

* Binned scatter (binscatter)
binscatter y x, controls(z1 z2) nquantiles(20) ///
    title("Binned Scatter") xtitle("X") ytitle("Y")

* Kernel density
kdensity income if year==2020, normal ///
    title("Income Distribution") xtitle("Income")

* Graph styling (grstyle)
grstyle init
grstyle set plain, horizontal grid
grstyle color background white
grstyle set color economist

Mata Programming

stata
* Basic Mata usage
mata:
    // Matrix operations
    X = st_data(., ("x1", "x2", "x3"))
    y = st_data(., "y")
    n = rows(X)

    // OLS by hand
    X = X, J(n, 1, 1)  // add constant
    beta = invsym(X'X) * X'y
    e = y - X * beta
    sigma2 = (e'e) / (n - cols(X))
    V = sigma2 * invsym(X'X)
    se = sqrt(diagonal(V))

    beta, se
end

Workflow Best Practices

  1. Always set a random seed before any procedure involving randomness: set seed 12345
  2. Use preserve/restore for temporary data manipulations within a do-file
  3. Log your sessions: log using "analysis_log.smcl", replace
  4. Version control: Start do-files with version 17 (or your version) for reproducibility
  5. Use tempfiles for intermediate datasets: tempfile merged then save merged'`
  6. Profile your code with timer on 1 / timer off 1 / timer list for long-running operations
  7. Use gtools (greshape, gcollapse, gegen) for 5-10x speedups on large datasets

References

© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/analysis/econometrics/stata-reference-guide of wentorai/research-plugins.

Open the folder on GitHubat commit bf44b3c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Stata Reference Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stata Reference Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stata Reference Guide this skillwentorai/research-plugins2981 repos~2kAutomated safety check: PassMIT
Statadylantmoore/stata-skill2911 repos~4.2kAutomated safety check: PassCustom licence
Stata C Pluginsdylantmoore/stata-skill2911 repos~5.8kAutomated safety check: PassCustom licence
Example Datasetspymc-labs/CausalPy1.2k—~587Automated safety check: PassApache-2.0
Stata AuditSepineTam/mcp-for-stata264—~1.2kAutomated safety check: PassAGPL-3.0
Stata Skill Contributordylantmoore/stata-skill2911 repos~2.4kAutomated safety check: PassCustom licence

Similar skills

  • Stata

    dylantmoore/stata-skill

    Comprehensive Stata reference for writing correct .do files, data management, econometrics, causal inference, graphics, Mata programming, and 20 community packages (reghdfe, estout, did, rdrobust…

    291 GitHub starsUsed in 1 repo~4.2k tokens
    Research & ScienceAuto-check passed
  • Stata C Plugins

    dylantmoore/stata-skill

    Develop high-performance C/C++ plugins for Stata using the stplugin.h SDK.

    291 GitHub starsUsed in 1 repo~5.8k tokens
    Research & ScienceAuto-check passed
  • Example Datasets

    pymc-labs/CausalPy

    Load built-in CausalPy example datasets for demos, tutorials, tests, and quick causal-analysis prototypes.

    1.2k GitHub stars~587 tokensUpdated today
    Research & ScienceAuto-check passed
  • Stata Audit

    SepineTam/mcp-for-stata

    Inspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp.

    264 GitHub stars~1.2k tokensUpdated 2 days ago
    Research & ScienceAuto-check passed
  • Stata Skill Contributor

    dylantmoore/stata-skill

    Guide for contributing to the stata-skill project. An agent skill from dylantmoore/stata-skill.

    291 GitHub starsUsed in 1 repo~2.4k tokens
    Research & ScienceAuto-check passed
  • Review Paper

    maxwell2732/paper-replicate-agent-demo

    Comprehensive manuscript review covering argument structure, econometric specification, citation completeness, and potential referee objections

    137 GitHub starsUsed in 3 repos~1.1k tokens
    Research & ScienceAuto-check passed

More from wentorai/research-plugins

All 405 skills in this repo
  • Abstract Writing Guide

    wentorai/research-plugins

    Craft structured research abstracts that maximize clarity and journal acceptance

    298 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Academic Citation Manager

    wentorai/research-plugins

    Manage academic citations across BibTeX, APA, MLA, and Chicago formats

    298 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Academic Paper Summarizer

    wentorai/research-plugins

    Summarize academic papers with structured extraction of key elements

    298 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Academic Study Methods

    wentorai/research-plugins

    Evidence-based study techniques for academic learning and retention

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Academic Tone Guide

    wentorai/research-plugins

    Adjust writing tone and register for academic audiences and venues

    298 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Academic Translation Guide

    wentorai/research-plugins

    Academic translation, post-editing, and Chinglish correction guide

    298 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Questions about Stata Reference Guide

What does Stata Reference Guide do?

Comprehensive Stata reference covering syntax, econometrics, and 20+ packages. Stata Reference Guide is an agent skill from wentorai/research-plugins.

When should I use Stata Reference Guide?

Stata Reference Guide fits situations like: tasks that involve Econometrics and empirical research.

How do I install Stata Reference Guide in Claude Code?

Run `npx skills add wentorai/research-plugins --skill stata-reference-guide -a claude-code`. Or copy the skill folder (skills/analysis/econometrics/stata-reference-guide in wentorai/research-plugins) into .claude/skills/stata-reference-guide in your project. Claude Code loads it when a task matches its description.

How do I install Stata Reference Guide in Codex?

Run `npx skills add wentorai/research-plugins --skill stata-reference-guide -a codex`. Or copy the skill folder (skills/analysis/econometrics/stata-reference-guide in wentorai/research-plugins) into .agents/skills/stata-reference-guide in your project. Codex loads it when a task matches its description.

Can I use Stata Reference Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill stata-reference-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stata-reference-guide, .gemini/skills/stata-reference-guide, .github/skills/stata-reference-guide and .opencode/skills/stata-reference-guide in your project.

What does Stata Reference Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Stata Reference Guide is instructions for the agent only.

Does Stata Reference Guide access the network?

SKILL.md names 6 domains. In commands or code: raw.githubusercontent.com; the agent is likely to contact it when it follows the instructions. As links in the text: stata.com, stats.oarc.ucla.edu, stata-journal.com, ideas.repec.org and github.com. This is read from the text; nothing was executed.

Is Stata Reference Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stata Reference Guide use?

Stata Reference Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stata Reference Guide use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Stata Reference Guide?

Skills that share tags, products or a category with Stata Reference Guide: Stata (dylantmoore/stata-skill, 291 stars), Stata C Plugins (dylantmoore/stata-skill, 291 stars), Example Datasets (pymc-labs/CausalPy, 1.2k stars) and Stata Audit (SepineTam/mcp-for-stata, 264 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stata Reference Guide?

wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.

Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.