Tutorials › Propensity Score Matching and Instrumental Variables › Coding Instrument Direction and Treatment Direction

IV Assumptions and Local Average Treatment Effects · Tutorial 465 of 699

Coding Instrument Direction and Treatment Direction

Track coding reversals through the IV contrasts and compliance types so the Wald estimate retains the right causal interpretation.

Advanced 10 min read

What You'll Learn

  • Define instrument and treatment contrasts using the coded value one minus the coded value zero
  • Derive how reversing either or both binary codings changes the Wald ratio
  • Track how always-taker, never-taker, complier, and defier labels transform
  • Distinguish a change of labels from a change in the underlying intervention
  • Audit first-stage signs, monotonicity direction, and causal-effect units
  • Work through sign changes under single and simultaneous recoding

Why Coding Direction Matters

An instrumental-variable estimate is a ratio of two contrasts: an outcome contrast across instrument values divided by a treatment contrast across those same values. Reversing which instrument value is called “one” changes both contrasts. Reversing which treatment value is called “one” changes the treatment contrast and the meaning of the treatment effect. These changes can alter signs and compliance labels even when the underlying data and causal question have not changed.

A sign change is not automatically an error. The key is to specify which value is coded one, take every contrast in the same direction, and interpret the result for the treatment definition actually being used. The algebra can be checked exactly; the substantive interpretation still depends on the instrumental-variable assumptions.

Set Up the Coding and the Wald Ratio

Let \(Z\) be a binary instrument, with \(Z=1\) denoting the instrument level being contrasted against \(Z=0\). Let \(D\) be a binary treatment, with \(D=1\) denoting receipt of the treatment of interest. Write \(D(z)\) for the treatment status a person would have under instrument value \(z\), and \(Y(d)\) for the outcome under treatment status \(d\). The observed outcome is \(Y=Y(D)\) under consistency and exclusion.

Define the reduced-form contrast as the mean outcome at \(Z=1\) minus the mean outcome at \(Z=0\). Define the first-stage contrast the same way for treatment. When the first-stage contrast is nonzero, their ratio is the Wald ratio.

$$ \Delta_Y = E(Y\mid Z=1)-E(Y\mid Z=0), \qquad \Delta_D = E(D\mid Z=1)-E(D\mid Z=0), \qquad W = \frac{\Delta_Y}{\Delta_D}. $$

In the standard binary-instrument LATE result, \(W\) identifies the average treatment effect among compliers when the instrument is independent of the relevant potential outcomes and treatment statuses, exclusion holds, the first stage is nonzero, and monotonicity holds in the chosen direction: \(D(1)\geq D(0)\) for every person. Under these assumptions, a complier has \(D(1)=1\) and \(D(0)=0\); a defier has the reverse pair. Always-takers have \(D(1)=D(0)=1\), and never-takers have \(D(1)=D(0)=0\). The treatment effect is \(Y(1)-Y(0)\), measured in outcome units per treatment contrast.

Definition: A coding reversal replaces a binary variable \(X\) by \(1-X\). It changes which observed category is labelled one, but does not by itself change the people, assignments, outcomes, or physical treatment delivered. A causal interpretation must nevertheless follow the meaning of the newly coded treatment.

For the algebra below, let \(Z^*=Z\) if the instrument coding is retained and \(Z^*=1-Z\) if it is reversed. Likewise, let \(D^*=D\) if the treatment coding is retained and \(D^*=1-D\) if it is reversed. Use \(a=1\) for unchanged instrument coding and \(a=-1\) for reversed instrument coding; use \(b=1\) or \(b=-1\) in the same way for treatment coding. Every contrast in the recoded variables is still defined as the conditional mean at coded value one minus that at coded value zero.

What Reversing the Instrument Does

If only the instrument coding is reversed, the new \(Z^*=1\) group is the old \(Z=0\) group, and the new \(Z^*=0\) group is the old \(Z=1\) group. Thus the reduced-form and first-stage contrasts both change sign. Their ratio does not.

$$ \Delta_Y^*=-\Delta_Y,\qquad \Delta_D^*=-\Delta_D,\qquad W^*=\frac{-\Delta_Y}{-\Delta_D}=W. $$

The ratio’s numerical invariance does not mean that the conventional monotonicity statement is unchanged. Reversing \(Z\) swaps the order of each person’s two potential treatment statuses. Old compliers, with \((D(0),D(1))=(0,1)\), respond in the opposite direction to the recoded instrument and meet the conventional definition of defiers under that coding. Old defiers become compliers. Always-takers and never-takers remain in their respective categories. Consequently, one cannot reverse the instrument, observe that the Wald ratio is unchanged, and then claim that the original monotonicity condition still holds in the new direction. The ratio maps back to the original LATE under the original assumptions; a standard LATE interpretation using the reversed instrument requires monotonicity in that reversed direction.

Worked Example: Reversing the Instrument

Consider hypothetical population contrasts with \(E(D\mid Z=0)=0.20\), \(E(D\mid Z=1)=0.60\), \(E(Y\mid Z=0)=12\), and \(E(Y\mid Z=1)=16\). Suppose the original coding is substantively meaningful and the independence, exclusion, relevance, and monotonicity assumptions hold in that direction.

Original coding. The first stage is \(0.60-0.20=0.40\) treatment-probability points, and the reduced form is \(16-12=4\) outcome units. Therefore,

$$ W=\frac{16-12}{0.60-0.20}=\frac{4}{0.40}=10. $$

Under the stated assumptions, this is a complier average effect of 10 outcome units for treatment \(D=1\) versus \(D=0\). Now set \(Z^*=1-Z\), without changing \(D\). The new coded-value-one means are the old \(Z=0\) means, and the new coded-value-zero means are the old \(Z=1\) means. Hence the new reduced form is \(12-16=-4\), and the new first stage is \(0.20-0.60=-0.40\). The recoded ratio is \((-4)/(-0.40)=10\).

The positive ratio agrees with the original LATE, but the direction of uptake has reversed: the treatment rate is lower at \(Z^*=1\). The original assumption that uptake does not decrease with the original instrument’s value one is not the conventional nondecreasing-monotonicity assumption for \(Z^*\). The calculation is valid as a re-expression of the original result, not as a license to ignore which direction monotonicity supports.

What Reversing the Treatment Does

If the instrument coding is kept but treatment is recoded as \(D^*=1-D\), its first-stage contrast changes sign: the probability of \(D^*=1\) is the probability of original \(D=0\). The reduced form for \(Y\) does not change, because neither the instrument groups nor their outcomes have changed. Thus the Wald ratio changes sign.

The causal contrast changes too. Under the recoded treatment definition, \(D^*=1\) means the original treatment was absent, while \(D^*=0\) means it was received. The outcome potential outcomes indexed by the new treatment are \(Y^*(d^*)=Y(1-d^*)\). Therefore the recoded treatment effect is \(Y^*(1)-Y^*(0)=Y(0)-Y(1)\), the negative of the original treatment effect.

$$ \Delta_D^*=-\Delta_D,\qquad \Delta_Y^*=\Delta_Y,\qquad W^*=\frac{\Delta_Y}{-\Delta_D}=-W. $$

Under treatment recoding, always-takers and never-takers exchange labels because their constant treatment statuses are complemented. Compliers and defiers also exchange labels: complementing both treatment statuses reverses whether uptake rises or falls as the original instrument moves from zero to one. If the original monotonicity assumption ruled out defiers, it does not become the standard nondecreasing condition for \(D^*\); instead, \(D^*(1)\leq D^*(0)\). The negative Wald ratio is interpretable as the local effect of the recoded treatment \(D^*\) for the original compliers, with the treatment contrast reversed. One may instead retain the original treatment definition and report the original LATE.

Worked Example: Reversing the Treatment Label

Use the same hypothetical means as above: the outcome means are 12 at \(Z=0\) and 16 at \(Z=1\); the original treatment means are 0.20 and 0.60, respectively. Recode treatment as \(D^*=1-D\).

The recoded treatment means are \(1-0.20=0.80\) at \(Z=0\) and \(1-0.60=0.40\) at \(Z=1\). Thus the recoded first stage is \(0.40-0.80=-0.40\). The reduced form remains \(16-12=4\) outcome units, so

$$ W^*=\frac{16-12}{(1-0.60)-(1-0.20)} =\frac{4}{0.40-0.80} =\frac{4}{-0.40} =-10. $$

This is not a contradictory estimate. The coding \(D^*=1\) now represents not receiving the original treatment. Its local effect relative to \(D^*=0\) is \(Y(0)-Y(1)\), which is \(-10\) outcome units for the original compliers when the original local effect is 10. The negative first stage also signals that the original nondecreasing monotonicity condition has become nonincreasing under the recoded treatment.

Reversing Both Codings and Tracking Compliance Types

When both variables are reversed, the instrument contrast changes direction and the treatment contrast is complemented. The reduced form changes sign because the instrument groups switch; the first stage retains its original sign because the two reversals cancel in that contrast. The Wald ratio therefore changes sign, just as it does when treatment alone is reversed.

More generally, the recoded contrasts obey

$$ \Delta_Y^*=a\Delta_Y,\qquad \Delta_D^*=ab\Delta_D,\qquad W^*=\frac{a\Delta_Y}{ab\Delta_D}=bW. $$

Here \(a\) records instrument orientation and \(b\) records treatment orientation. Instrument orientation cancels from the ratio; treatment orientation determines its sign. For compliance labels, compare the recoded potential treatment statuses at \(Z^*=1\) and \(Z^*=0\). Their direction of change relative to the original is multiplied by \(ab\). Thus compliers and defiers exchange labels exactly when \(ab=-1\). Always-taker and never-taker labels exchange exactly when treatment is reversed (\(b=-1\)); reversing the instrument alone does not exchange those two categories.

Worked Example: Reversing Both Codings

Consider another hypothetical set of means: \(E(Y\mid Z=0)=5\), \(E(Y\mid Z=1)=8\), \(E(D\mid Z=0)=0.30\), and \(E(D\mid Z=1)=0.55\). The original reduced form is \(8-5=3\) outcome units, the first stage is \(0.55-0.30=0.25\), and \(W=3/0.25=12\).

Now use \(Z^*=1-Z\) and \(D^*=1-D\). At \(Z^*=1\), corresponding to old \(Z=0\), the outcome mean is 5 and the recoded treatment mean is \(1-0.30=0.70\). At \(Z^*=0\), corresponding to old \(Z=1\), those means are 8 and \(1-0.55=0.45\). The contrasts and ratio are

$$ \Delta_Y^*=5-8=-3,\qquad \Delta_D^*=0.70-0.45=0.25,\qquad W^*=\frac{-3}{0.25}=-12. $$

The first stage is positive because both directions were reversed. The Wald ratio is negative because the treatment contrast is now “originally untreated versus originally treated.” If the original \(12\)-unit estimate was a LATE for the original treatment among original compliers, the recoded \(-12\) is the corresponding reverse treatment contrast for those same people. The numerical sign alone does not indicate whether the causal conclusion is favorable or unfavorable; that depends on the outcome scale and which treatment category is being compared.

Diagnostics, Alternatives, and Common Pitfalls

A coding audit should be done before interpreting a Wald estimate. Record in words what \(Z=1\), \(D=1\), \(Z^*=1\), and \(D^*=1\) mean. Then calculate each contrast as coded-value-one minus coded-value-zero, including units. Check whether the first-stage sign matches the stated direction of uptake. Finally, state the monotonicity direction and identify which people the compliance labels refer to. If a recoding is a simple complement, compare the new contrasts with the predicted sign changes above.

A zero first stage makes the Wald ratio undefined; a very small first stage makes the ratio sensitive to small changes in the contrasts. Coding can reveal a negative first stage, but cannot repair weak relevance or establish independence, exclusion, or monotonicity. Nor does a sign check show that those substantive assumptions hold.

  • Pitfall: treating a negative ratio as automatically wrong. A student sees a negative Wald estimate and flips its sign to make it positive. Correction: keep the computed sign, identify the coded treatment contrast, and interpret the result for that contrast. A treatment recoding legitimately reverses the effect’s sign.
  • Pitfall: reversing the instrument but changing only one contrast. This creates a spurious sign reversal. Correction: reversing \(Z\) swaps the two instrument groups in both the outcome and treatment contrasts; both signs change, leaving the ratio unchanged.
  • Pitfall: assuming “complier” is a label independent of coding. Correction: define compliance by the pair of potential uptake statuses under the explicitly ordered instrument and treatment values. Reversals can relabel the principal strata.
  • Pitfall: treating recoding as a new intervention. Correction: changing a label does not change who received treatment. If the scientific intervention itself changes, that is a different causal question, not merely a coding operation.

The main alternative is to retain the original scientifically meaningful treatment and instrument definitions and report contrasts in that orientation. This avoids unnecessary sign translation. If a dataset or software uses the opposite coding, transform the contrasts and labels explicitly rather than silently changing the estimand. Either approach gives the same substantive conclusion when the mappings and assumptions are handled consistently.

Key takeaway: Reversing the instrument flips both contrasts and leaves the Wald ratio unchanged. Reversing the treatment flips the first stage and the ratio, because it reverses the treatment effect being described. Compliance labels must be recomputed from the recoded potential-status pairs, not carried over by name.

Check Your Understanding

Answer each question using contrasts defined as coded-value one minus coded-value zero. Solutions follow the questions.

  1. If the original reduced form is 6 and first stage is 0.30, what is the Wald ratio? What happens to the ratio if only the instrument coding is reversed?
  2. If treatment is recoded as \(D^*=1-D\) while the instrument is unchanged, how do the first stage, reduced form, and Wald ratio change?
  3. Under original monotonicity \(D(1)\geq D(0)\), what happens to the direction of monotonicity if only the instrument is reversed?
  4. Which compliance labels exchange when treatment coding is reversed? Which labels exchange when only instrument coding is reversed?
  5. If both codings are reversed, and the original Wald ratio is 8, what is the recoded Wald ratio? Explain its sign.

Solutions. (1) \(W=6/0.30=20\); instrument reversal changes the contrasts to \(-6\) and \(-0.30\), so the ratio remains 20. (2) The first stage changes from \(0.30\) to \(-0.30\), the reduced form remains 6, and the ratio becomes \(6/(-0.30)=-20\), the reversed treatment contrast. (3) Reversed instrument coding swaps the potential-status order, giving nonincreasing uptake under the reversed coding; original compliers are then conventional defiers under that order. (4) Treatment reversal exchanges always-takers with never-takers and compliers with defiers. Instrument reversal alone exchanges compliers and defiers, but leaves always-taker and never-taker labels unchanged. (5) The ratio becomes \(-8\), because reversing the treatment coding reverses the treatment contrast; reversing the instrument as well does not undo that sign change.

Clinical Biostats