Stata Analyst Guide logo

Stata Analyst Guide

Community
wentorai
stata-analyst-guide

Stata workflows for publication-ready sociology and social science research

Overview

Publisherwentorai
Repositoryresearch-plugins
Skill namestata-analyst-guide
Stars
294
Forks
42
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by wentorai on GitHub. Read the source before you install it.

Installation

Install the Stata Analyst Guide AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/research-plugins.git /tmp/research-plugins
mkdir -p .claude/skills
cp -r /tmp/research-plugins/skills/analysis/econometrics/stata-analyst-guide .claude/skills/stata-analyst-guide
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Stata Analyst Guide in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Stata Analyst Guide on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Stata Analyst Guide is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Stata Analyst Guide for Social Science Research

Complete Stata workflow for sociology and social science research, from survey data preparation through publication-ready regression tables and visualizations. This skill covers the analytical techniques most commonly used in top sociology journals.

Overview

Stata is the dominant statistical software in sociology, political science, demography, and many social science disciplines. Its command-line interface, reproducible do-file workflow, and comprehensive support for survey data, multilevel models, and categorical data analysis make it the tool of choice for researchers working with complex social datasets.

This skill provides ready-to-use Stata code for the most common analytical tasks in social science research: descriptive statistics for diverse variable types, regression modeling with proper controls and robustness checks, interaction effects with meaningful visualizations, and automated production of APA/ASA-formatted tables suitable for direct inclusion in journal manuscripts.

The examples draw on typical social science data structures: individual-level survey data with sampling weights, nested data (individuals within organizations or regions), longitudinal panels, and event-history data. All code follows the conventions expected by reviewers at journals such as the American Sociological Review, American Journal of Sociology, and Social Forces.

Descriptive Statistics

Weighted Summary Statistics

stata
* Social science surveys typically require survey weights
svyset psu [pweight=finalweight], strata(stratum)

* Weighted means and proportions
svy: mean income education_years age
svy: proportion race gender marital_status

* Weighted cross-tabulation
svy: tabulate education_cat income_quintile, row se

* Descriptive statistics table for paper
estpost summarize age education_years income ///
    children household_size, detail
esttab using "tables/descriptives.tex", ///
    cells("mean(fmt(2)) sd(fmt(2)) min max count") ///
    label title("Descriptive Statistics") replace

Group Comparisons

stata
* T-tests with survey weights
svy: mean income, over(gender)
lincom [income]Male - [income]Female

* ANOVA
svy: regress income i.race i.education_cat
testparm i.race
testparm i.education_cat

* Effect sizes (Cohen's d)
esize twosample income, by(gender)

Regression Analysis

OLS with Standard Controls

stata
* Model building strategy (nested models for sociology papers)

* Model 1: Bivariate
reg income i.gender [pweight=finalweight], robust
estimates store m1

* Model 2: Add demographics
reg income i.gender age age_sq i.race i.marital [pweight=finalweight], robust
estimates store m2

* Model 3: Add human capital
reg income i.gender age age_sq i.race i.marital ///
    education_years experience experience_sq [pweight=finalweight], robust
estimates store m3

* Model 4: Add job characteristics
reg income i.gender age age_sq i.race i.marital ///
    education_years experience experience_sq ///
    i.occupation i.industry hours_worked [pweight=finalweight], robust
estimates store m4

* Publication-ready table
esttab m1 m2 m3 m4 using "tables/regression_income.tex", ///
    b(3) se(3) star(* 0.05 ** 0.01 *** 0.001) ///
    label title("OLS Regression of Income") ///
    mtitles("Bivariate" "Demographics" "Human Capital" "Full Model") ///
    stats(N r2_a, labels("Observations" "Adjusted R-squared") fmt(0 3)) ///
    addnotes("Standard errors in parentheses." ///
             "All models use survey weights.") ///
    replace

Logistic Regression

stata
* Binary outcome: employment status
logit employed i.gender age age_sq i.race i.education_cat ///
    children i.marital [pweight=finalweight], robust
estimates store logit1

* Report odds ratios
logit employed i.gender age age_sq i.race i.education_cat ///
    children i.marital [pweight=finalweight], robust or
estimates store logit_or

* Average marginal effects (preferred in sociology)
margins, dydx(*) post
estimates store ame

* Predicted probabilities by group
logit employed i.gender##i.race age education_years [pweight=finalweight], robust
margins gender#race, atmeans
marginsplot, title("Predicted Probability of Employment")

Interaction Effects

Continuous x Categorical Interaction

stata
* Gender x education interaction on income
reg income c.education_years##i.gender age i.race [pweight=finalweight], robust

* Visualize interaction
margins gender, at(education_years=(8(2)20))
marginsplot, ///
    title("Returns to Education by Gender") ///
    ytitle("Predicted Income ($)") ///
    xtitle("Years of Education") ///
    legend(order(1 "Male" 2 "Female")) ///
    scheme(s2mono)
graph export "figures/education_gender_interaction.pdf", replace

Moderation Analysis

stata
* Test whether the effect of X on Y varies by moderator Z
reg outcome c.x_var##c.moderator controls [pweight=finalweight], robust

* Simple slopes at meaningful values of moderator
margins, dydx(x_var) at(moderator=(10 25 50 75 90))  // Percentiles
marginsplot, recast(line) recastci(rarea) ///
    title("Effect of X on Y at Different Levels of Moderator")

Multilevel Models

stata
* Students nested within schools
mixed test_score gender ses || school_id:, ///
    variance mle

* Random slopes
mixed test_score gender c.ses || school_id: ses, ///
    covariance(unstructured) mle

* Calculate ICC
estat icc

* Store and compare models
estimates store mlm1
mixed test_score gender c.ses school_quality || school_id: ses, ///
    covariance(unstructured) mle
estimates store mlm2

lrtest mlm1 mlm2

Visualization for Publication

Journal-Quality Figures

stata
* Set publication-ready scheme
set scheme s2mono

* Coefficient plot
coefplot m2 m3 m4, ///
    drop(_cons) xline(0) ///
    title("Regression Coefficients Across Models") ///
    legend(order(2 "Demographics" 4 "Human Capital" 6 "Full")) ///
    graphregion(color(white))
graph export "figures/coefplot.pdf", replace

* Distribution comparison
twoway (kdensity income if gender==1, lcolor(navy)) ///
       (kdensity income if gender==2, lcolor(cranberry)), ///
    title("Income Distribution by Gender") ///
    legend(order(1 "Male" 2 "Female")) ///
    xtitle("Annual Income ($)") ytitle("Density") ///
    graphregion(color(white))
graph export "figures/income_density.pdf", replace

Replication Package

stata
* Master do-file structure for replication
* master.do
* ==========================================
* Project: [Title]
* Author: [Name]
* Date: [Date]
* Description: Master script for replication
* ==========================================

version 17
clear all
set more off
set maxvar 10000

global root "~/research/project_name"
global raw "$root/data/raw"
global processed "$root/data/processed"
global tables "$root/tables"
global figures "$root/figures"
global logs "$root/logs"

log using "$logs/master_log.smcl", replace

do "$root/code/01_data_cleaning.do"
do "$root/code/02_descriptives.do"
do "$root/code/03_main_analysis.do"
do "$root/code/04_robustness.do"
do "$root/code/05_tables_figures.do"

log close

References

Frequently asked questions

What does the Stata Analyst Guide AI skill do?

Stata workflows for publication-ready sociology and social science research

Why use Stata Analyst Guide on TypingMind?

Because you install it once and use it with any model. Stata Analyst Guide is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Stata Analyst Guide in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/stata-analyst-guide. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Stata Analyst Guide?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Stata Analyst Guide?

As many as you like. As long as a model supports skills, you can use Stata Analyst Guide with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Stata Analyst Guide AI skill free?

Yes. It is published on GitHub by wentorai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇