Agent skill

iv-regression-guide

Apply instrumental variables, 2SLS, and address endogeneity issues

brycew6m4,252★ · +31/wk · 3 repos on radarProfile →
claude-codeNOASSERTION
Install
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill iv-regression-guide --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 6 KB
Bundled scripts: none
Path: skills/43-wentorai-research-plugins/skills/analysis/econometrics/iv-regression-guide/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 3,244
Language: Stata
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Instrumental Variables Regression Guide 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. ## The Endogeneity Problem ### Why OLS Fails ``` 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. ``` ### The IV Solution 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) ``` ## Two-Stage Least Squares (2SLS) ### How 2SLS Works ``` 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 fitt

What's inside
Steps it walks through
  1. The Endogeneity Problem
  2. Why OLS Fails
  3. The IV Solution
  4. Two-Stage Least Squares (2SLS)
  5. How 2SLS Works
  6. Implementation in Python
  7. Implementation in R
  8. Instrument Validity Tests
  9. First-Stage F-Statistic (Relevance)
  10. Overidentification Test (Exclusion Restriction)
  11. Classic IV Examples
  12. Famous Instruments in Economics
  13. Reporting IV Results
  14. Required Elements
More from Auto-Empirical-Research-Skills
All skills →
About this skill
What does the iv-regression-guide skill do?

Apply instrumental variables, 2SLS, and address endogeneity issues

How do I install it?

Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill iv-regression-guide --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going