iv-estimation

Estimate causal effects with IV/2SLS and propensity score matching.

6|1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/zhouziyue233/great-econometrics --skill iv-estimation-zhouziyue233
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iv-estimation
Source: https://github.com/zhouziyue233/great-econometrics/tree/main/skills/iv-estimation
Command: npx skills add https://github.com/zhouziyue233/great-econometrics --skill iv-estimation-zhouziyue233

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Instrumental Variables & Treatment Effects Skill helps researchers identify causal effects in the presence of endogeneity by applying instrumental variables and two-stage least squares, complemented by propensity score matching for robustness.

Core Features & Use Cases

  • IV / 2SLS estimation with diagnostics (first-stage F-stat, Sargan/Hansen overidentification, Wu-Hausman endogeneity)
  • Propensity Score Matching (nearest-neighbor matching, ATT estimation, balance checks)
  • Interpretations of LATE and ATE with guidance for economics-style reporting
  • Quick templates for Python, R, and Stata implementations

Quick Start

Provide an instrumented dataset and run an IV/2SLS or PSM workflow to obtain diagnostics and causal estimates.

Frequently Asked Questions about iv-estimation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate causal effects with instrumental variables when treatment is endogenous?

Use IV and 2SLS estimation to identify causal effects with endogenous treatments. This approach requires valid instruments and exogenous controls, providing first-stage diagnostics like F-statistics and overidentification tests for robust reporting.

When should I use propensity score matching instead of 2SLS for treatment effects?

Apply propensity score matching when selection on observables is credible. PSM estimates ATT through nearest-neighbor matching and balance checks, whereas 2SLS is necessary when unobserved confounding causes endogeneity.

What diagnostics do I need for a valid 2SLS instrumental variables regression?

Valid 2SLS requires first-stage F-statistics to detect weak instruments, Sargan or Hansen tests for overidentification restrictions, and Wu-Hausman tests to confirm endogeneity, ensuring robust causal identification and reporting.

How do I interpret LATE versus ATE in instrumental variables estimation?

IV estimation identifies the Local Average Treatment Effect for compliers affected by the instrument, not the Average Treatment Effect. Proper interpretation requires first-stage diagnostics and overidentification tests to validate the LATE estimate.

Can I run IV 2SLS and PSM workflows across Python, R, and Stata?

IV 2SLS and propensity score matching workflows support Python, R, and Stata implementations. Provide an instrumented dataset with outcome, treatment, control, and instrument variables to obtain causal estimates and diagnostics.

How do I check for weak instruments in a 2SLS regression?

Check for weak instruments using the first-stage F-statistic during 2SLS estimation. A low F-statistic indicates weak instruments that compromise causal identification, requiring exogenous controls and valid instruments for robust results.