Stata Analyst Guideのロゴ

Stata Analyst Guide

コミュニティ
wentorai
stata-analyst-guide

Stata workflows for publication-ready sociology and social science research

概要

公開者wentorai
リポジトリresearch-plugins
スキル名stata-analyst-guide
スター
294
フォーク
42
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    wentoraiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Stata Analyst Guide」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/stata-analyst-guide
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでStata Analyst Guideを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にStata Analyst Guideを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Stata Analyst Guideは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

よくある質問

AIスキル「Stata Analyst Guide」では何ができますか?

Stata workflows for publication-ready sociology and social science research

TypingMindでStata Analyst Guideを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Stata Analyst Guideはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにStata Analyst Guideをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/stata-analyst-guideを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Stata Analyst Guideを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Stata Analyst Guideで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもStata Analyst Guideを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Stata Analyst Guide」は無料ですか?

はい。wentoraiがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇