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

