Tutorials › Response-Adaptive Randomization › A Two-Arm Implementation Audit from Inputs to Random Draws

Doubly Adaptive Biased Coin Designs · Tutorial 186 of 501

A Two-Arm Implementation Audit from Inputs to Random Draws

Learn to verify every stage of a two-arm DBCD allocation, including how response data, target shares, current allocation counts, and the random draw determine an assignment.

Advanced 11 min read

What You'll Learn

  • Separate response-rate estimates, target shares, current allocation counts, and assignment probabilities.
  • Calculate a two-arm DBCD probability from the normalized-weight rule.
  • Derive and check the allocation-odds identity when both target shares are positive.
  • Audit a random-number comparison and update the allocation record without prematurely changing response data.
  • Handle a zero target share directly rather than using an undefined odds ratio.
  • Diagnose common implementation errors and compare DBCD with target-share and equal randomization.

Why Audit the Whole Allocation Step?

A response-adaptive assignment is the end of a sequence of calculations, not a direct translation of a response rate into a treatment choice. The response data produce estimates; a specified target map turns those estimates into target shares; the current allocation counts and the DBCD rule turn the target shares into assignment probabilities; finally, a random draw selects an arm. An error at any stage can leave the final assignment looking plausible while implementing a different design.

This tutorial audits that sequence for two arms. The target map below is deliberately explicit: for binary beneficial responses, estimate each arm’s response rate and normalize the two rates to sum to one. This is a stipulated target map for the audit, not a claim that normalized response rates are optimal for every trial objective. The central task is to distinguish the inputs and verify how the specified coin rule uses them.

Definition: Let \(N_1\) and \(N_2\) be the numbers assigned to arms 1 and 2 before the next assignment, and let \(n=N_1+N_2\). Let \(\hat{\rho}_1\) and \(\hat{\rho}_2\) be the current target shares, with \(\hat{\rho}_1+\hat{\rho}_2=1\). For a chosen tuning parameter \(\gamma\geq 0\), the two-arm DBCD assigns arm \(k\) with probability $$ q_k=\frac{w_k}{w_1+w_2}, \qquad w_k=\frac{\hat{\rho}_k^{\gamma+1}}{(N_k/n)^\gamma}, \quad k=1,2. $$ This formula presumes positive current allocation shares. Boundary cases in the target shares are handled directly from the weights, not by a ratio that may be undefined.

For the response-rate target map used here, let \(S_k\) be the number of observed beneficial responses among \(M_k\) participants with an observed outcome in arm \(k\). The estimated response rate is \(\hat{r}_k=S_k/M_k\), and, when \(\hat{r}_1+\hat{r}_2>0\), the target shares are \(\hat{\rho}_k=\hat{r}_k/(\hat{r}_1+\hat{r}_2)\). The response denominator \(M_k\) need not equal the allocation count \(N_k\): a participant can be randomized before their outcome is available. At each decision, the implementation must use only outcomes available by that decision time and the allocation counts accrued by then.

The audit also assumes that the target map and \(\gamma\) have been specified in advance for the calculation, the allocation counts are current, and the stated probabilities are used for a genuine random assignment. The examples use positive allocation counts. If a design allows a target share to be zero, compute the normalized weights directly; if a protocol requires positive assignment chances, its prescribed safeguard must be applied and recorded explicitly.

From Weights to Allocation Odds

When both target shares are positive, the weight formula gives a useful odds check. Dividing the two weights cancels the common factor \(n^\gamma\) implicit in the allocation shares:

$$ \frac{q_1}{q_2} = \frac{w_1}{w_2} = \left(\frac{\hat{\rho}_1}{\hat{\rho}_2}\right)^{\gamma+1} \left(\frac{N_2}{N_1}\right)^\gamma, \qquad \hat{\rho}_1>0,\ \hat{\rho}_2>0. $$

The condition on the target shares matters: if one is zero, the corresponding odds ratio is not defined. For positive shares, the identity says that the target-share odds are raised to the power \(\gamma+1\) and adjusted by the inverse current-allocation odds to the power \(\gamma\). Once the odds \(R=q_1/q_2\) are found, \(q_1=R/(1+R)\) and \(q_2=1/(1+R)\). These are assignment probabilities, not target shares.

Worked Example: Audit the Inputs, Weights, and Random Draw

Suppose a hypothetical trial has assigned \(N_1=8\) participants to arm 1 and \(N_2=12\) to arm 2. Outcomes are available for all 20: arm 1 has 5 beneficial responses among 8 observed outcomes, and arm 2 has 6 among 12. Use the response-rate target map above, set \(\gamma=1\), and suppose the next random number is \(U=0.68\).

1. Estimate response rates and targets. The response-rate estimates are \(\hat{r}_1=5/8=0.6250\) and \(\hat{r}_2=6/12=0.5000\). Their sum is positive, so the target map is defined:

$$ \hat{\rho}_1=\frac{0.6250}{0.6250+0.5000}=\frac{5}{9}\approx0.5556, \qquad \hat{\rho}_2=\frac{0.5000}{0.6250+0.5000}=\frac{4}{9}\approx0.4444. $$

2. Keep current allocation shares separate. Before the new assignment, \(n=8+12=20\), so the current shares are \(N_1/n=8/20=0.4000\) and \(N_2/n=12/20=0.6000\). Neither is a target share.

3. Calculate the weights and probabilities. With \(\gamma=1\), the exponent on each target share is 2:

$$ w_1=\frac{(5/9)^2}{8/20}=\frac{25}{81}\cdot\frac{5}{2}=\frac{125}{162}\approx0.7716, \qquad w_2=\frac{(4/9)^2}{12/20}=\frac{16}{81}\cdot\frac{5}{3}=\frac{80}{243}\approx0.3292. $$

Using the exact fractions, the normalized probabilities are \(q_1=(125/162)/(125/162+80/243)=375/535=75/107\approx0.7009\) and \(q_2=32/107\approx0.2991\). As a separate check, the odds identity gives \((5/4)^2(12/8)=75/32\), hence \(q_1=(75/32)/(1+75/32)=75/107\), the same result.

4. Compare the draw and record the assignment. Use a \(U\sim\operatorname{Uniform}(0,1)\) draw and assign arm 1 when \(U<q_1\); otherwise assign arm 2. Since \(0.68<0.7009\), assign the participant to arm 1. Record the pre-assignment counts, response data and their availability, target shares, \(\gamma\), probabilities, random number, and assignment. After randomization, the allocation counts become \(N_1=9\) and \(N_2=12\). The response data remain 5/8 and 6/12 until this participant’s outcome is observed; randomization alone does not create a response.

Check the Draw, Then Update the Right Fields

A complete audit follows the order of operations. The probability for a participant is calculated from information available immediately before that participant is assigned. The draw is compared with the resulting probability, and only then is the allocation count updated. When the outcome later becomes available, the response data and any target estimates that depend on them can be updated for a subsequent assignment. This timing prevents a future response from leaking into an earlier assignment.

1
Freeze the decision-time inputs.
Identify the response records available now, the pre-assignment counts \(N_1,N_2\), the target map, and \(\gamma\).
2
Calculate targets and probabilities.
Compute response estimates and target shares, then calculate the two weights and normalize them. Check that the probabilities sum to one.
3
Use and retain the random draw.
Apply the stated threshold convention to \(U\), and preserve the draw and resulting arm in the assignment record.
4
Update counts and later outcomes at the right times.
Increment the assigned arm’s allocation count after assignment. Incorporate the participant’s response only when it is observed.

Worked Example: Detect a Reversed Allocation Correction

Continue with the inputs in the first example: the target shares are \(5/9\) and \(4/9\), the current counts are 8 and 12, and \(\gamma=1\). An implementation is suspected of using \(N_1/N_2\), rather than \(N_2/N_1\), in its odds adjustment. Compare the correct and faulty calculations using \(U=0.62\).

The correct odds are \((5/4)^2(12/8)=75/32\), so \(q_1=75/(75+32)=75/107\approx0.7009\). Because \(0.62<0.7009\), the correct implementation assigns arm 1.

With the reversed count ratio, the faulty odds would instead be \((5/4)^2(8/12)=25/24\). The corresponding probability is \(q_1=25/(25+24)=25/49\approx0.5102\). That implementation would assign arm 2 because \(0.62\) is not less than \(0.5102\). Thus, a single stored draw distinguishes the two calculations here. This comparison is a diagnostic, not a substitute for checking the formula and the inputs.

A second common slip is to use the target share \(5/9\approx0.5556\) itself as the assignment probability. That also assigns arm 2 for \(U=0.62\), but it ignores the current allocation counts and the specified \(\gamma\). The target share describes the target allocation proportion; the DBCD probability is the result of applying the coin rule at the current counts.

Boundary Cases and Direct Calculation

The odds identity is a convenience for positive target shares, not the definition of the procedure. If one target share is zero, the normalized-weight formula remains the direct way to reason about the raw DBCD probabilities, provided the weights are defined. Do not form a ratio with a zero target share and then interpret the result as an ordinary finite odds value.

Worked Example: One Target Share Is Zero

Suppose the response-rate estimates are \(\hat{r}_1=4/5=0.8000\) and \(\hat{r}_2=0/6=0\). The specified normalized-rate map gives \(\hat{\rho}_1=1\) and \(\hat{\rho}_2=0\). Let the current allocation counts be \(N_1=7\) and \(N_2=8\), and let \(\gamma=1\).

The current shares are \(7/15\) and \(8/15\). Calculate weights directly:

$$ w_1=\frac{1^2}{7/15}=\frac{15}{7}, \qquad w_2=\frac{0^2}{8/15}=0. $$

Normalization gives \(q_1=(15/7)/(15/7+0)=1\) and \(q_2=0\). The target-share odds \(\hat{\rho}_1/\hat{\rho}_2\) are undefined, so the odds identity cannot be used. If the trial protocol instead requires a positive minimum chance for each arm, this raw calculation is not the final assignment rule: apply the prespecified safeguard and record the resulting probabilities. Do not silently replace the zero or clip the target, because that changes the design.

Diagnostics, Alternatives, and Limitations

An implementation audit should check both arithmetic and data flow. The following checks are useful because they expose errors before a long allocation sequence is run:

  • Inputs and timing: confirm the response records were available before the assignment and that \(N_1,N_2\) are the counts before it, not after it.
  • Target map: recompute response estimates from the stated numerators and denominators, then verify that the target shares sum to one when the map is defined.
  • Probability calculation: verify \(w_1,w_2\geq0\), a positive sum of weights, \(q_1+q_2=1\), and \(0\leq q_k\leq1\). For positive targets, independently check the odds identity.
  • Random draw: preserve the generated \(U\) and apply the same threshold convention throughout. A reproducible audit needs the random-number source or seed as well as the decision rule.
  • State updates: check that the assigned arm’s allocation count changes immediately after randomization, while its response count changes only when an outcome is observed.

DBCD differs from two simple alternatives. Equal randomization uses \(q_1=q_2=1/2\), regardless of estimated targets or current imbalance. Randomization directly in proportion to the target shares uses \(q_k=\hat{\rho}_k\). In the stated DBCD formula, \(\gamma=0\) reduces to target-share randomization when the targets are defined; for \(\gamma>0\), the weights also respond to current allocation shares. These approaches answer different design choices and should not be treated as interchangeable implementations.

The calculation does not establish that the chosen target map is scientifically appropriate, that estimated targets are stable, or that the resulting design has a particular long-run property. Those questions require separate design and theoretical analysis. A correct audit establishes the narrower but essential fact that the recorded assignment was generated from the specified inputs, target map, coin rule, and random draw. It cannot compensate for a poorly chosen response definition, delayed or misclassified outcomes, or an undocumented change to the rule.

Common pitfall: “The target for arm 1 is 0.5556, so arm 1 must be assigned with probability 0.5556.” This is incorrect for a DBCD with \(\gamma>0\) and unequal current counts. The target share is an input to the rule; the assignment probability is obtained only after combining the target share with the current allocation share and normalizing the weights.

Check Your Understanding

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

  1. Before a new assignment, \(N_1=6\), \(N_2=9\), \(\hat{\rho}_1=2/3\), \(\hat{\rho}_2=1/3\), and \(\gamma=1\). What are the two weights and assignment probabilities?
  2. Why can the response denominators \(M_k\) differ from the allocation counts \(N_k\)?
  3. For \(q_1=0.70\), what is the assignment when \(U=0.70\) under the convention that arm 1 is assigned only when \(U<q_1\)?
  4. If \(\hat{\rho}_1=0\) and \(\hat{\rho}_2=1\), should the positive-target odds identity be used? What is the direct raw DBCD calculation when both current counts are positive?

Solutions. (1) The current shares are \(6/15=2/5\) and \(9/15=3/5\). Thus \(w_1=(2/3)^2/(2/5)=10/9\), and \(w_2=(1/3)^2/(3/5)=5/27\). Their sum is \(35/27\), giving \(q_1=(10/9)/(35/27)=6/7\approx0.8571\) and \(q_2=1/7\approx0.1429\). (2) Allocation counts include randomized participants, whereas response denominators include participants whose outcomes are observed by the decision time. An outcome may not yet be available. (3) Since the rule assigns arm 1 only for \(U<q_1\), equality does not meet the threshold; assign arm 2. The equality has probability zero for an ideal continuous uniform draw, but an implementation still needs a consistent convention. (4) No: the ratio of target shares has a zero denominator. With \(\hat{\rho}_1=0\), \(\hat{\rho}_2=1\), positive current counts, and \(\gamma\geq0\), direct weights give \(w_1=0\), \(w_2=1/(N_2/n)^\gamma>0\), so normalization gives \(q_1=0\) and \(q_2=1\).

Clinical Biostats