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…
Apply instrumental variables, 2SLS, and address endogeneity issues
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wentorai/research-plugins iv-regression-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .claude/skills/iv-regression-guide && rm -rf skills-srcUse ~/.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/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .claude/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wentorai/research-plugins iv-regression-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .agents/skills/iv-regression-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .agents/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wentorai/research-plugins iv-regression-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .cursor/skills/iv-regression-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .cursor/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wentorai/research-plugins.git --path skills/analysis/econometrics/iv-regression-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wentorai/research-plugins iv-regression-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .gemini/skills/iv-regression-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .gemini/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wentorai/research-plugins iv-regression-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .github/skills/iv-regression-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .github/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill iv-regression-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wentorai/research-plugins iv-regression-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/analysis/econometrics/iv-regression-guide .opencode/skills/iv-regression-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "iv-regression-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/iv-regression-guide into .opencode/skills/iv-regression-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "iv-regression-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
iv-regression-guideApply instrumental variables, 2SLS, and address endogeneity issues
Iv Regression Guide is an agent skill from wentorai/research-plugins. Apply instrumental variables, 2SLS, and address endogeneity issues
Its SKILL.md is about 1.6k 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.
Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python and r).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Iv Regression Guide loads about 1.6k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 139 words of instructions outside code blocks.
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.
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.
The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 139 words, ~1,569 tokens.
.claude/skills/iv-regression-guide/SKILL.md (or your agent's skills folder).A skill for applying instrumental variables (IV) estimation to address endogeneity in regression models. Covers the logic of IV, two-stage least squares (2SLS), instrument validity tests, weak instrument diagnostics, and reporting standards.
Ordinary Least Squares assumes: E[u | X] = 0
(Regressors are uncorrelated with the error term)
This assumption is violated when:
- Omitted variable bias: A confound affects both X and Y
- Simultaneity: X affects Y and Y affects X
- Measurement error: X is measured with noise
Consequence: OLS estimates are biased and inconsistent.
No amount of data will fix this.An instrumental variable Z satisfies two conditions:
1. Relevance: Z is correlated with the endogenous regressor X
Cov(Z, X) != 0
2. Exclusion: Z affects Y ONLY through X (not directly)
Cov(Z, u) = 0
Z --> X --> Y
Z -/-> Y (no direct path)Stage 1: Regress the endogenous variable on the instrument(s)
X = gamma_0 + gamma_1 * Z + controls + v
Save the fitted values: X_hat
Stage 2: Regress the outcome on the fitted values
Y = beta_0 + beta_1 * X_hat + controls + e
The coefficient beta_1 is the IV estimate of the causal effect.from linearmodels.iv import IV2SLS
import pandas as pd
def run_2sls(data: pd.DataFrame, dependent: str,
endogenous: str, instruments: list[str],
controls: list[str] = None) -> dict:
"""
Run a 2SLS instrumental variables regression.
Args:
data: DataFrame with all variables
dependent: Name of the dependent variable (Y)
endogenous: Name of the endogenous regressor (X)
instruments: List of instrument variable names (Z)
controls: List of exogenous control variable names
"""
controls = controls or []
exog_str = " + ".join(["1"] + controls) if controls else "1"
endog_str = endogenous
instr_str = " + ".join(instruments)
formula = f"{dependent} ~ {exog_str} + [{endog_str} ~ {instr_str}]"
model = IV2SLS.from_formula(formula, data)
result = model.fit(cov_type="robust")
return {
"coefficients": dict(result.params),
"std_errors": dict(result.std_errors),
"p_values": dict(result.pvalues),
"f_statistic_first_stage": result.first_stage.diagnostics,
"summary": str(result.summary)
}library(ivreg)
# 2SLS estimation
iv_model <- ivreg(
log(wage) ~ education + experience | parent_education + experience,
data = df
)
summary(iv_model, diagnostics = TRUE)def check_weak_instruments(first_stage_f: float) -> dict:
"""
Evaluate instrument strength using first-stage F-statistic.
Args:
first_stage_f: F-statistic from the first-stage regression
"""
return {
"f_statistic": first_stage_f,
"rule_of_thumb": (
"Strong instruments" if first_stage_f > 10
else "Potentially weak instruments"
),
"interpretation": (
"Stock & Yogo (2005) suggest F > 10 as a minimum for "
"one endogenous variable. For more precise thresholds, "
"consult the Stock-Yogo critical values table based on "
"the number of instruments and desired maximal bias."
),
"if_weak": [
"Use LIML (Limited Information Maximum Likelihood) instead of 2SLS",
"Report Anderson-Rubin confidence intervals (robust to weak IV)",
"Consider finding stronger instruments",
"Use the Lee et al. (2022) tF procedure for valid inference"
]
}When you have more instruments than endogenous variables, the Hansen J test (or Sargan test) checks whether the extra instruments are valid:
H0: All instruments are valid (uncorrelated with the error)
H1: At least one instrument is invalid
If p < 0.05: Reject -> at least one instrument may violate exclusion
If p > 0.05: Fail to reject -> instruments appear valid
(but this test has low power)Research Question | Endogenous Var | Instrument
---------------------------|---------------|------------------
Returns to education | Years of school| Quarter of birth (Angrist & Krueger)
Effect of institutions | Institutions | Settler mortality (Acemoglu et al.)
Colonial origins of trade | Trade openness | Geography (Frankel & Romer)
Effect of military service | Veteran status | Draft lottery number (Angrist)
Price elasticity of demand | Price | Supply shifters (cost, weather)1. Justify instrument choice with economic/theoretical reasoning
2. Report first-stage regression results:
- Coefficient of Z on X with standard error
- First-stage F-statistic
3. Report second-stage (2SLS) results:
- IV coefficient with robust standard errors
- Compare with OLS estimate (discuss direction of bias)
4. Report diagnostic tests:
- Weak instrument test (F-statistic or Kleibergen-Paap)
- Overidentification test if applicable (Hansen J)
- Endogeneity test (Hausman or Durbin-Wu-Hausman)
5. Discuss threats to instrument validity
- Can the exclusion restriction be challenged?
- Are there plausible alternative channels?Always present both OLS and IV estimates side by side. The comparison helps readers understand the direction and magnitude of endogeneity bias and assess whether the IV correction is meaningful.
© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/analysis/econometrics/iv-regression-guide of wentorai/research-plugins.
Open the folder on GitHubat commit bf44b3c
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.
Iv Regression 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Iv Regression Guide this skillwentorai/research-plugins | 298 | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Statadylantmoore/stata-skill | 291 | 1 repos | ~4.2k | Automated safety check: Pass | Custom licence | |
| Stata C Pluginsdylantmoore/stata-skill | 291 | 1 repos | ~5.8k | Automated safety check: Pass | Custom licence | |
| Example Datasetspymc-labs/CausalPy | 1.2k | — | ~587 | Automated safety check: Pass | Apache-2.0 | |
| Stata AuditSepineTam/mcp-for-stata | 264 | — | ~1.2k | Automated safety check: Pass | AGPL-3.0 | |
| Stata Skill Contributordylantmoore/stata-skill | 291 | 1 repos | ~2.4k | Automated safety check: Pass | Custom licence |
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…
dylantmoore/stata-skill
Develop high-performance C/C++ plugins for Stata using the stplugin.h SDK.
pymc-labs/CausalPy
Load built-in CausalPy example datasets for demos, tutorials, tests, and quick causal-analysis prototypes.
SepineTam/mcp-for-stata
Inspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp.
dylantmoore/stata-skill
Guide for contributing to the stata-skill project. An agent skill from dylantmoore/stata-skill.
SepineTam/mcp-for-stata
A skill your agent uses when the user needs to inspect, audit, or diagnose the safety of a Stata do-file.
wentorai/research-plugins
Craft structured research abstracts that maximize clarity and journal acceptance
wentorai/research-plugins
Manage academic citations across BibTeX, APA, MLA, and Chicago formats
wentorai/research-plugins
Summarize academic papers with structured extraction of key elements
wentorai/research-plugins
Evidence-based study techniques for academic learning and retention
wentorai/research-plugins
Adjust writing tone and register for academic audiences and venues
wentorai/research-plugins
Academic translation, post-editing, and Chinglish correction guide
Categories
Apply instrumental variables, 2SLS, and address endogeneity issues. Iv Regression Guide is an agent skill from wentorai/research-plugins.
Iv Regression Guide fits situations like: tasks that involve Econometrics and empirical research.
Run `npx skills add wentorai/research-plugins --skill iv-regression-guide -a claude-code`. Or copy the skill folder (skills/analysis/econometrics/iv-regression-guide in wentorai/research-plugins) into .claude/skills/iv-regression-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wentorai/research-plugins --skill iv-regression-guide -a codex`. Or copy the skill folder (skills/analysis/econometrics/iv-regression-guide in wentorai/research-plugins) into .agents/skills/iv-regression-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill iv-regression-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/iv-regression-guide, .gemini/skills/iv-regression-guide, .github/skills/iv-regression-guide and .opencode/skills/iv-regression-guide in your project.
SKILL.md names no scripts, command-line tools or credentials: Iv Regression Guide is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Iv Regression Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Iv Regression 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.
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.