Tutorials › Response-Adaptive Randomization › Inverse-Probability Weighting for Changing Allocation Probabilities

Time Trends and Drift · Tutorial 400 of 501

Inverse-Probability Weighting for Changing Allocation Probabilities

Learn how to use known sequential assignment probabilities to weight outcomes for a cohort-average treatment contrast, and how to recognize when the resulting estimates may be unstable.

Advanced 10 min read

What You'll Learn

  • Define the inverse-probability weights for treatment and control from each participant’s assignment probability.
  • Derive why weighted Horvitz–Thompson means target treatment-specific averages for the enrolled cohort.
  • Calculate Horvitz–Thompson and normalized Hájek estimates from a hypothetical sequential trial.
  • Distinguish exact finite-sample unbiasedness from the variance properties of normalized estimates.
  • Check probability records, temporal balance, weight concentration, and effective sample size.
  • Explain how positivity violations and incorrect probabilities undermine weighted contrasts.

Why Weight for Changing Allocation Probabilities?

In a response-adaptive trial, the probability of assigning treatment can change as enrollment proceeds. For example, an algorithm may assign treatment more often during one period than another because earlier trial outcomes altered its allocation target. If prognosis also changes over calendar time, the participants assigned to each arm may represent different mixes of enrollment times. A raw difference in observed arm means can then reflect both treatment and those differing mixes.

Inverse-probability weighting uses the probability recorded immediately before each assignment to reweight the observed outcome. A participant assigned to an arm with a low probability receives a larger weight: that observation stands in, in expectation, for similar participants who could have been assigned to that arm but were not. This is a probability-based correction, not a guarantee that the realized arms will have identical time distributions.

Definition: For participant \(i\), let \(A_i=1\) denote assignment to treatment and \(A_i=0\) assignment to control. Let \(\pi_i=P(A_i=1\mid H_i)\) be the known treatment-assignment probability conditional on the information \(H_i\) available immediately before that assignment. The inverse-probability weights are \(1/\pi_i\) for an observed treatment assignment and \(1/(1-\pi_i)\) for an observed control assignment.

The conditioning on \(H_i\) matters: assignments need not be independent across participants. The allocation algorithm may adapt to earlier assignments or outcomes. What matters for the calculation is the actual conditional probability used for participant \(i\), not an overall treatment fraction or an estimate from the realized assignments.

Estimands and the Weighted Estimators

Suppose the trial has a fixed cohort of \(n\) participants. Write \(Y_i(1)\) and \(Y_i(0)\) for participant \(i\)'s potential outcomes under treatment and control, respectively, and let \(Y_i\) be the observed outcome. The finite-cohort treatment-specific means are \(\mu_1=n^{-1}\sum_iY_i(1)\) and \(\mu_0=n^{-1}\sum_iY_i(0)\). Their difference \(\tau=\mu_1-\mu_0\) is the average treatment effect for these enrolled participants. The observed outcome is \(Y_i=A_iY_i(1)+(1-A_i)Y_i(0)\), under consistency: the outcome observed under the assigned treatment is the corresponding potential outcome.

The Horvitz–Thompson (HT) estimates use the cohort size \(n\) as the denominator. Define \(p_{i1}=\pi_i\) and \(p_{i0}=1-\pi_i\). Then:

$$ \widehat{\mu}_{a}^{HT} = \frac{1}{n}\sum_{i=1}^{n} \frac{I(A_i=a)Y_i}{p_{ia}}, \qquad \widehat{\tau}^{HT} = \widehat{\mu}_{1}^{HT}-\widehat{\mu}_{0}^{HT}. $$

Here \(I(A_i=a)\) equals 1 when participant \(i\) received arm \(a\), and 0 otherwise. A normalized alternative, often called the Hájek estimate, divides each weighted outcome total by the corresponding total weight:

$$ \widehat{\mu}_{a}^{H} = \frac{\sum_{i=1}^{n} I(A_i=a)Y_i/p_{ia}} {\sum_{i=1}^{n} I(A_i=a)/p_{ia}}, \qquad \widehat{\tau}^{H} = \widehat{\mu}_{1}^{H}-\widehat{\mu}_{0}^{H}. $$

The HT form has a direct finite-cohort unbiasedness result under the assumptions below. The Hájek form normalizes the weights separately within each arm; it can be more stable in some samples, but its random denominator means it is not generally exactly unbiased in finite samples. Both target a cohort-average contrast when the weights are correctly specified; neither should be interpreted as automatically producing exact time balance in the observed data.

Why the HT Weight Works

Assume treatment assignment is randomized at each enrollment, with the stated probability conditional on the pre-assignment history, and that this random draw is independent of the current participant’s potential outcomes conditional on that history. Then, for either arm \(a\), the assignment indicator has conditional expectation \(p_{ia}\). Consequently:

$$ E\left[ \left. \frac{I(A_i=a)Y_i}{p_{ia}} \right| H_i,Y_i(0),Y_i(1) \right] = \frac{P(A_i=a\mid H_i)}{p_{ia}}Y_i(a) = Y_i(a). $$

Averaging this equality over participants gives \(E(\widehat{\mu}_a^{HT})=\mu_a\), and subtracting the arm-specific equalities gives \(E(\widehat{\tau}^{HT})=\tau\). The reasoning uses conditional assignment probabilities participant by participant, so adaptation based on prior information does not itself invalidate the result. It does require the probabilities actually used by the randomization mechanism, not probabilities reconstructed incorrectly from the final allocation totals.

The assumptions have substantive content. The treatment and control outcomes must be well defined and observed for the assigned arm; there must be no interference between participants; and the probability supplied to the weight must be the probability of the assignment that was genuinely made. Most importantly, for every participant in the target cohort, both arm probabilities must be positive: \(0<\pi_i<1\). If outcomes are missing after assignment, these formulas alone do not correct for that missingness.

Worked Calculations

Worked Example: Six Sequential Assignments With Changing Probabilities

Consider a hypothetical trial with six participants enrolled at six distinct times, one assignment at each time. The treatment probabilities recorded before assignment are \(0.80, 0.70, 0.60, 0.40, 0.30,\) and \(0.20\), respectively. The assignments are treatment, control, treatment, control, treatment, control; the corresponding observed outcomes, measured in points, are 18, 10, 16, 12, 14, and 14. Each probability is strictly between 0 and 1, and the recorded value is the probability used for that participant’s assignment.

For treatment, the observed inverse-probability weights are \(1/0.80\), \(1/0.60\), and \(1/0.30\). The HT treatment mean is:

$$ \widehat{\mu}_1^{HT} = \frac{1}{6}\left(\frac{18}{0.80}+\frac{16}{0.60}+\frac{14}{0.30}\right) = \frac{22.5+26.6667+46.6667}{6} = 15.9722\text{ points}. $$

The treatment weight total is \(1.25+1.6667+3.3333=6.25\). Therefore the normalized treatment mean is \((22.5+26.6667+46.6667)/6.25=15.3333\) points.

For control, the assignment probabilities are \(0.30\), \(0.60\), and \(0.80\), so the observed control weights are \(1/0.30\), \(1/0.60\), and \(1/0.80\). The HT control mean and its normalized counterpart are:

$$ \widehat{\mu}_0^{HT} = \frac{1}{6}\left(\frac{10}{0.30}+\frac{12}{0.60}+\frac{14}{0.80}\right) = \frac{33.3333+20+17.5}{6} = 11.8056\text{ points}, $$

The control weight total is \(3.3333+1.6667+1.25=6.25\), giving \(\widehat{\mu}_0^{H}=70.8333/6.25=11.3333\) points. Thus the HT contrast is \(15.9722-11.8056=4.1667\) points, while the Hájek contrast is \(15.3333-11.3333=4.0000\) points. The unweighted arm means happen to be 16 and 12 points here, also a 4-point difference; that numerical coincidence does not show that unweighted means generally target the same cohort-average contrast under changing allocation.

Worked Example: Checking the Weight by Its Assignment Expectation

Suppose a hypothetical participant has potential outcomes of 20 points under treatment and 10 points under control. Immediately before assignment, the known treatment probability is \(0.80\), so the control probability is \(0.20\). For the treatment mean, the weighted contribution before dividing by the cohort size is \(I(A=1)Y/0.80\). It is 25 points with probability 0.80 and zero with probability 0.20. Its expectation is:

$$ 0.80(25)+0.20(0)=20\text{ points}=Y(1). $$

For the control mean, the corresponding contribution is \(I(A=0)Y/0.20\). It is 50 points with probability 0.20 and zero with probability 0.80, so its expectation is \(0.20(50)+0.80(0)=10\) points, equal to \(Y(0)\). Only one of these outcomes is observed for this participant, but the randomization expectation explains why the weighted contribution targets the potential outcome in that arm.

Worked Example: A Rare Assignment Can Dominate a Weighted Estimate

In a separate hypothetical four-participant illustration, the recorded treatment probabilities are \(0.05, 0.50, 0.50,\) and \(0.50\). The assignments are treatment, treatment, control, and control, and the observed outcomes are 30, 12, 10, and 14 points. All assignment probabilities are positive, but the first treatment assignment was unlikely under its recorded probability.

The treatment HT mean is \(\{30/0.05+12/0.50\}/4=(600+24)/4=156\) points. The treatment Hájek mean is \((600+24)/(1/0.05+1/0.50)=624/22=28.3636\) points. The control HT and Hájek means both equal \(\{10/0.50+14/0.50\}/4=12\) points, since the two control weights sum to 4. The resulting HT contrast is 144 points and the Hájek contrast is 16.3636 points. These extreme estimates are mathematically possible; they signal that the rare, high-weight treatment observation has substantial influence, not that the trial has demonstrated an enormous treatment effect.

Diagnostics, Alternatives, and Limitations

Before interpreting a weighted contrast, check the probability record and the resulting weights. Confirm that each value is the pre-assignment conditional probability for that participant, including any dependence on earlier trial history. Then examine the largest weights, arm-specific weight distributions, and how the weighted enrollment-time distribution compares across arms and with the full cohort. The effective sample size for weights \(w_i\) in an arm is \((\sum_i w_i)^2/\sum_i w_i^2\); a value much smaller than the number of observed participants in that arm indicates that a few observations carry much of the weighted estimate.

The essential positivity condition is that treatment and control each remain possible for every participant in the target cohort. Probabilities close to zero or one technically satisfy positivity but can still create very large weights and high variance, as the preceding example illustrates. If an arm has probability zero for some participants, its potential outcomes for those participants cannot be recovered by these weights from the observed assignments. Truncating or capping extreme weights may reduce variability, but changes the estimator and can introduce bias; it is not a way to restore information where an arm was impossible.

A raw arm-mean contrast uses no probability weights, so it may be appealing for its simplicity, but changing allocation combined with time-related prognosis can leave the observed arm means comparing different enrollment-time mixes. Time-stratified standardization, temporal blocking, and regression adjustment are alternatives with different requirements and finite-sample behavior. Weighting is especially transparent when the sequential randomization probabilities are known and correctly recorded. It can nevertheless be noisy, and weighting alone does not promise exact balance in a small realized trial. The target here is the average over the enrolled cohort; a different target population requires a corresponding change in the estimand and weighting strategy.

A common mistake is to say, “The trial assigned treatment to 60% of participants, so I will use 0.60 as every participant’s treatment probability.” That substitutes an overall realized fraction for each participant’s conditional randomization probability. The correction is to use the recorded \(\pi_i\) and \(1-\pi_i\) at each assignment. Another mistake is to assume that correct weights force exact balance in calendar time. They balance in the relevant randomization expectation; observed weighted time distributions still require inspection.

Key takeaway: Inverse-probability weighting divides each observed outcome by its probability of being assigned to the observed arm. Under correct sequential probabilities, randomization, consistency, and positivity, the HT contrast is unbiased for the enrolled-cohort average treatment effect. Small assignment probabilities can make that estimate unstable, and realized balance is not guaranteed.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A participant has treatment probability \(0.25\). What are the treatment and control weights if this participant is assigned to treatment? What are they if assigned to control?
  2. For one participant, \(Y(1)=16\), \(Y(0)=8\), and \(\pi=0.40\). Find the randomization expectation of each arm’s weighted contribution \(I(A=a)Y/p_a\).
  3. In a cohort of four, two observed treatment outcomes are 10 and 14 points, with treatment probabilities \(0.50\) and \(0.25\). Calculate the treatment HT mean and Hájek mean.
  4. Why can a correct inverse-probability analysis still yield an extreme estimate in a small trial?

Solutions. (1) If assigned to treatment, the treatment weight is \(1/0.25=4\); if assigned to control, the control weight is \(1/0.75=1.3333\). (2) The treatment contribution is 40 with probability 0.40 and zero otherwise, so its expectation is \(0.40(40)=16\) points. The control contribution is \(8/0.60=13.3333\) with probability 0.60 and zero otherwise, so its expectation is \(0.60(13.3333)=8\) points. (3) The treatment HT mean is \(\{10/0.50+14/0.25\}/4=(20+56)/4=19\) points. Its Hájek mean is \(76/(2+4)=12.6667\) points. (4) A participant assigned to an arm with a small probability receives a large inverse-probability weight; if that observation has a high or low outcome, it can strongly influence the estimate. Correct weighting protects the target in expectation, not the precision of every realized estimate.

Clinical Biostats