Ask Mallard
Analysis method

Instrumental variable analysis

5 min read

Instrumental variable analysis uses a cause of treatment to estimate an effect when ordinary adjustment cannot remove confounding.

Fit

When to use it, and when not to

Use it when

  • You have a credible source of treatment variation, such as randomized encouragement, that affects the outcome only through treatment.

Not when

Before you start

What you need

Decide these first
  1. A clearly defined instrumentExplain what changes treatment and why that source of variation is credible.
  2. Treatment, outcome and target grouptargetoutcomeTypeName the effect sought and whose treatment the instrument could change.
  3. The first-stage modelRecord how strongly the instrument predicts treatment after the planned covariate adjustment.
It rests on these
  1. The instrument changes treatment.How to check: Estimate the first-stage association and report its uncertainty and an appropriate strength statistic.
  2. The instrument has no shared causes with the outcome.How to check: Justify this from the design, conditional on any required baseline covariates. Measured balance cannot prove it.
  3. The instrument affects the outcome only through treatment.How to check: Describe and challenge other plausible pathways. This exclusion restriction cannot be established by a strong first stage.
  4. A complier effect needs no people who move against the instrument.How to check: For binary treatment and instrument, monotonicity rules out defiers. Also require well-defined treatment and no interference.
  5. Choose a missing-data method because of a stated assumption.How to check: Missing completely at random (MCAR) means gaps depend on neither observed nor unseen data. Missing at random (MAR) means recorded data explain gaps. Under MAR, suitable multiple imputation may help; it is not inherently better. Missing not at random (MNAR) means unseen values still predict gaps. Under plausible MNAR, add a delta or tipping-point sensitivity analysis. Dropping people with missing exposure can cause selection bias.

Plain language

How it works

For a binary instrument, divide its outcome difference by its treatment difference. This is the Wald ratio. With binary treatment, the usual causal reading is local to compliers, people whose treatment changes with the instrument.

Two-stage least squares and strength

Two-stage least squares first predicts treatment from the instrument and covariates. It then regresses the outcome on predicted treatment and the same covariates. This linear IV fit needs standard errors that account for both stages. Report the first-stage partial F statistic with its context; 10 is a warning rule, not a guarantee. Weak instruments can give biased estimates and misleading intervals.

Binary outcomes

For a binary outcome, it estimates a risk difference under a linear model; a logistic second stage does not give a causal odds ratio.

Which paths must be absent
An instrumental variable diagram. The instrument has an arrow into the exposure, which is the one testable assumption. An unmeasured confounder causes both exposure and outcome. Two struck-through paths mark the untestable assumptions: no path from the instrument to the confounder, and no path from the instrument to the outcome except through the exposure.Instrumental variables: three assumptions, one testable1. Associated withexposure (testable)2. Independent ofconfounders (not testable)3. Affects outcome onlythrough exposure (nottestable)InstrumentExposureOutcomeUnmeasuredconfounderStruck-through dashed arrow: a path the method assumes is absent. Dashed box: unmeasured.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
A trial randomly encourages some adults to start blood-pressure treatment.
Question
What is the treatment effect among people whose uptake changes with encouragement?
Approach
Uptake is 60 in 100 with encouragement and 20 in 100 without it. Mean blood pressure is 120 versus 124 mmHg.
Result
First-stage difference: 0.40. Outcome difference: -4 mmHg. Wald estimate: -10 mmHg per person whose treatment changes with encouragement.
What it means
Divide the outcome difference by the uptake difference. This is a complier effect under the stated assumptions, not an effect for every patient.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

A strong first stage does not prove an instrument is valid. Exclusion and independence need substantive arguments; the effect may apply only to people whose treatment the instrument changes.

  • Calling any predictor of treatment an instrument.Instead: Explain independence and exclusion, not just prediction.
  • Using ordinary second-stage regression standard errors.Instead: Use an IV estimator that accounts for both stages and any clustering.
  • Treating a familiar first-stage cutoff as proof of validity.Instead: Weak-instrument bias and uncertainty depend on the design and estimator. Use appropriate diagnostics and weak-instrument-robust inference.

Inside Mallard

How Mallard uses this

Plans do not link to this method yet. You can find it in Learn and the Atlas.

Code example in Mallard: Instrumental variables by two-stage least squares (Mendelian randomization) (instrumental-variables-2sls).
Atlas node analysis.instrumental_variable, the id a plan cue records.
Code for this method
Loading…

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. An IV for the RCT: using instrumental variables to adjust for treatment contamination in randomised controlled trials (opens in a new tab) · BMJ · doi 10.1136/bmj.c2073
  2. Identification of causal effects using instrumental variables in randomized trials with stochastic compliance (opens in a new tab) · Biom J · doi 10.1002/bimj.201200104
  3. A review of instrumental variable estimators for Mendelian randomization (opens in a new tab) · Stat Methods Med Res · doi 10.1177/0962280215597579
Prepared with AI assistance for the owner-approved one-method wave 1. Indexed sources were checked by PMID, title, authors, year and DOI against PubMed on 2026-11-06. Record verification is not methodological approval. Sussman and Hayward explain the Wald/IV approach to trial contamination. Scosyrev derives identification limits and why an IV effect need not equal the population effect. Moved methodological records rechecked against PubMed on 2026-11-07: record verified, confirm it supports this use.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.