iv-2sls

Community

Run IV/2SLS with endogeneity diagnostics.

Authorxjtulyc
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you estimate causal effects when a regressor is endogenous, producing consistent parameter estimates via Instrumental Variables (IV) and Two-Stage Least Squares (2SLS).

Core Features & Use Cases

  • Instrumental-variables estimation (2SLS/LIML): Estimate structural parameters using excluded instruments and included exogenous controls.
  • Endogeneity and validity diagnostics: Automatically compute Wu-Hausman endogeneity tests, first-stage weak-instrument checks, and (when over-identified) Sargan-Hansen overidentification tests.
  • Practical econometrics workflow: Provide an end-to-end pipeline that compiles results into a diagnostic summary and supports OLS vs IV comparison for intuition.
  • Use case: Estimate the causal return to schooling when education is endogenous, using proximity-to-college (or a similar relevance-based instrument) while verifying instrument strength and endogeneity.

Quick Start

Use the iv-2sls skill to estimate IV/2SLS by providing y, an endogenous regressor DataFrame, an instruments DataFrame, and optional exogenous controls.

Dependency Matrix

Required Modules

linearmodels>=5.3.0statsmodels>=0.14.0pandas>=2.0.0numpy>=1.24.0scipy>=1.10.0matplotlib>=3.7.0

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: iv-2sls
Download link: https://github.com/xjtulyc/awesome-rosetta-skills/archive/main.zip#iv-2sls

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.