liveBook · Manning

Instrumental variable

As explained in Causal AI

An instrumental variable is a variable that affects an exposure or treatment and influences an outcome only through that exposure or treatment under specified causal assumptions.

Suppose you want the average causal effect of side-quest engagement on in-game purchases. Player skill and time spent playing may influence both, making an observed association a poor answer to the causal question. Side-quest group assignment is a possible instrumental variable: it changes engagement, while its effect on purchases is assumed to run only through engagement. section 11.2

In a causal DAG, an instrument Z causes the treatment T, which causes the outcome Y: Z → T → Y. Unlike a common cause of T and Y, Z is not included to satisfy causal sufficiency. Include a candidate instrument when it may help estimate the treatment effect, then check whether its proposed role holds. section 3.3.1 section 3.3.2

A candidate is useful only under explicit assumptions:

  • As-if-random: backdoor paths between the instrument and outcome must be blocked. In the illustrated DAG, this makes independence from the specified confounders especially important to test. section 11.3.2 section 4.3.3
  • Exclusion: the instrument must not cause the outcome along a path that bypasses the treatment. section 11.3.2
  • Strength: the instrument should have a strong causal effect on treatment. A weak instrument can produce a high-variance effect estimate even with substantial data. section 11.4.5

These graphical requirements alone do not identify an instrumental-variable effect. The illustrated DoWhy workflow also assumes linearity and fits linear regressions to obtain an average treatment effect estimate. Its instrument checks are deliberately restrictive: although backdoor adjustment could sometimes block problematic paths, the interface rules those paths out. section 11.3.2

Estimate, then inspect uncertainty

Specify side-quest group assignment as the instrument in DoWhy’s `iv.instrumental_variable` estimator and request a confidence interval. The illustrated estimate is about 206, but its 95% interval runs from about −369 to 924. That interval is too wide to treat the point estimate as a reliable answer; the group-assignment instrument is weak in this data. section 11.4.5

Listing 11.13 Instrumental variable estimation in DoWhy
causal_estimate_iv = model.estimate_effect(
    identified_estimand,
    method_name="iv.instrumental_variable",    #1
    method_params = {
        "iv_instrument_name": "Side-quest Group Assignment"   #2
    },
    confidence_intervals=True
)
print(causal_estimate_iv)

The DoWhy call shows where to name the instrument and request confidence intervals. section 11.4.5

How Causal AI covers it

How deep it goes
Defines validity through as-if-random and exclusion, adds instrument strength and linear estimation, but does not derive the estimand.
Examples
Uses side-quest group assignment and customization level for gaming purchases, with DoWhy estimates and wide confidence intervals.
What it assumes
Assumes familiarity with treatments, outcomes, causal DAGs, and confounding; states instrument-validity assumptions explicitly.
What you can do after
Apply it via DoWhy to estimate an average treatment effect and assess whether a weak instrument makes the estimate too uncertain.
How it connects
Connects instrumental variables to causal DAGs, backdoor paths, confounding, average treatment effects, and regression discontinuity.

Also explained in

Compare how 2 books explain instrumental variable →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal AI. The section links point to the parts of the book it draws on.