Tutorials › Response-Adaptive Randomization › Worked Example With Unequal Outcome Variances

Optimal Allocation Targets · Tutorial 107 of 501

Worked Example With Unequal Outcome Variances

Learn to calculate the two-arm Neyman allocation from outcome standard deviations and a fixed total, then quantify its variance reduction relative to equal allocation.

Intermediate 9 min read

What You'll Learn

  • Calculate the two-arm Neyman sample-size ratio from the arm-specific outcome standard deviations.
  • Convert that ratio into sample sizes for a fixed total.
  • Compute the variance of the difference in sample means under Neyman and equal allocation.
  • Quantify variance reductions using consistent, unrounded calculations.
  • Check the assumptions and limitations behind a variance-based allocation target.

Why Unequal Variances Change the Allocation

When two treatment arms have different outcome variability, assigning the same number of participants to each arm is not generally the allocation that gives the smallest variance for the difference in sample means. A more variable arm contributes more sampling variance. With a fixed total sample size, allocating more participants to that arm can reduce the contrast variance.

This tutorial works through the two-arm Neyman allocation numerically. The allocation is a target derived from a specified variance model; it is not, by itself, a rule for how an adaptive randomization procedure updates assignments during a trial. The focus is the sample-size calculation and its variance comparison with equal allocation.

Definition: For two independent treatment arms with outcome standard deviations \(\sigma_1\) and \(\sigma_0\), and a fixed total sample size \(N=n_1+n_0\), the two-arm Neyman allocation assigns sample sizes in proportion to the standard deviations: $$ \frac{n_1}{n_0}=\frac{\sigma_1}{\sigma_0}, \qquad n_1=N\frac{\sigma_1}{\sigma_1+\sigma_0}, \qquad n_0=N\frac{\sigma_0}{\sigma_1+\sigma_0}. $$ The displayed formulas give the continuous Neyman target, which minimizes variance over positive real sample sizes under the assumptions stated below. With integer participant counts, the target may require rounding, and the resulting allocation need not attain that continuous minimum.

Model, Assumptions, and Variance Formula

Let \(\bar{X}_1\) and \(\bar{X}_0\) be the sample means in the two arms. The treatment contrast is \(\bar{X}_1-\bar{X}_0\), which estimates the difference in population means. For this calculation, suppose outcomes within each arm are independent observations with finite variances \(\sigma_1^2\) and \(\sigma_0^2\), and the two arm samples are independent. The sample sizes are treated as fixed, all assigned participants provide an outcome, and the same outcome scale is used in both arms.

Under these assumptions, the variance of the contrast is

$$ \operatorname{Var}(\bar{X}_1-\bar{X}_0) = \frac{\sigma_1^2}{n_1}+\frac{\sigma_0^2}{n_0}. $$

The standard deviations must describe the outcome variability in the respective arms on the scale being analyzed. The formula does not require normally distributed outcomes for the variance calculation itself, although normality or large-sample approximations may matter for inference. It also presumes the sample sizes are positive. In the worked examples, the stated totals are chosen so the continuous Neyman targets are integers; no rounding is needed.

Why the Standard Deviations Determine the Ratio

A short minimization argument shows why the allocation uses standard deviations rather than variances. Write \(n_0=N-n_1\), so the contrast variance as a function of \(n_1\) is

$$ V(n_1)=\frac{\sigma_1^2}{n_1}+ \frac{\sigma_0^2}{N-n_1}, \qquad 0<n_1<N. $$

Differentiating with respect to \(n_1\), setting the derivative to zero, and using \(n_0=N-n_1\) gives

$$ -\frac{\sigma_1^2}{n_1^2} +\frac{\sigma_0^2}{n_0^2}=0 \quad\Longrightarrow\quad \frac{\sigma_1}{n_1}=\frac{\sigma_0}{n_0} \quad\Longrightarrow\quad \frac{n_1}{n_0}=\frac{\sigma_1}{\sigma_0}. $$

The second derivative is \(2\sigma_1^2/n_1^3+2\sigma_0^2/n_0^3\), which is positive for positive sample sizes and positive standard deviations. Thus this stationary point is the unique minimum. Solving the ratio together with \(n_1+n_0=N\) gives the Neyman sample sizes in the definition. Substitution also gives the minimum variance:

$$ V_{\text{Neyman}} = \frac{(\sigma_1+\sigma_0)^2}{N}. $$

For comparison, equal allocation sets \(n_1=n_0=N/2\), yielding \(V_{\text{equal}}=2(\sigma_1^2+\sigma_0^2)/N\). These are contrast variances, in squared outcome units. A smaller variance means greater precision under this model; it does not by itself establish that a trial is unbiased, ethically preferable, or more informative for every scientific objective.

Worked Example: Standard Deviations in a One-to-Two Ratio

Hypothetical scenario. Suppose the outcome standard deviations are 10 points in arm 1 and 20 points in arm 0, and the fixed total is 120 participants. Assume independent arm outcomes, the stated standard deviations apply to the trial population, and all 120 outcomes are observed.

The Neyman ratio is \(n_1/n_0=10/20=1/2\). The sample sizes are therefore

$$ n_1=120\frac{10}{10+20}=40, \qquad n_0=120\frac{20}{10+20}=80. $$

The Neyman contrast variance is

$$ V_{\text{Neyman}} =\frac{10^2}{40}+\frac{20^2}{80} =\frac{100}{40}+\frac{400}{80} =2.5+5=7.5\ \text{points}^2. $$

With equal allocation, there would be 60 participants per arm, giving \(V_{\text{equal}}=100/60+400/60=500/60=25/3\approx8.333\ \text{points}^2\). The reduction is \(25/3-15/2=5/6\approx0.8333\ \text{points}^2\), which is \(100(5/6)/(25/3)=10.0\%\) of the equal-allocation variance. The Neyman target is more precise in this comparison because it assigns more participants to the arm with the larger standard deviation.

Two Further Numerical Comparisons

Worked Example: A Modest Difference in Variability

Hypothetical scenario. Consider an outcome measured in millimetres of mercury, with standard deviations of 6 mmHg in arm 1 and 9 mmHg in arm 0. Let \(N=150\). Assume independent observations, those standard deviations are appropriate for the target population, and outcomes are complete.

The ratio is \(6:9=2:3\). Applying the fixed-total formulas gives

$$ n_1=150\frac{6}{15}=60, \qquad n_0=150\frac{9}{15}=90. $$

The contrast variance at the Neyman target is

$$ V_{\text{Neyman}} =\frac{36}{60}+\frac{81}{90} =0.6+0.9 =1.50\ \text{mmHg}^2. $$

Equal allocation would give 75 participants per arm and variance \(36/75+81/75=117/75=1.56\ \text{mmHg}^2\). The reduction is \(1.56-1.50=0.06\ \text{mmHg}^2\), or \(100(0.06/1.56)\approx3.846\%\). Thus the target improves precision under the assumed model, but the variance gain is relatively small. The standard deviations differ, yet the practical gain depends on both their imbalance and the fixed total.

Worked Example: A Larger Standard-Deviation Imbalance

Hypothetical scenario. Suppose the outcome is a score in points, with standard deviations 8 points in arm 1 and 15 points in arm 0. The total is \(N=138\). Assume the same independent-sampling and complete-outcome conditions as in the preceding calculations.

The ratio is \(8:15\), so the allocation is

$$ n_1=138\frac{8}{23}=48, \qquad n_0=138\frac{15}{23}=90. $$

The resulting variance is

$$ V_{\text{Neyman}} =\frac{8^2}{48}+\frac{15^2}{90} =\frac{64}{48}+\frac{225}{90} =\frac{4}{3}+\frac{5}{2} =\frac{23}{6}\approx3.833\ \text{points}^2. $$

Equal allocation gives 69 participants in each arm and variance \(64/69+225/69=289/69\approx4.188\ \text{points}^2\). Using the exact values, the variance reduction is \(289/69-23/6=49/138\approx0.3551\ \text{points}^2\), and its percentage of the equal-allocation variance is

$$ 100\frac{(49/138)}{(289/69)} =100\frac{49}{578} \approx8.478\%. $$

The comparison is consistent: the Neyman target gives the lower modeled contrast variance, by about 8.478% relative to equal allocation. The percentage is calculated from the exact fractions, avoiding discrepancies that can arise when percentages are recomputed from rounded display values.

How to Read and Check the Result

For each numerical comparison, keep the allocation, variance, and reference denominator explicit. The percentage variance reduction relative to equal allocation is

$$ 100\frac{V_{\text{equal}}-V_{\text{Neyman}}}{V_{\text{equal}}}\%. $$

This is a relative reduction in variance, not a percentage increase in sample size and not a percentage change in the treatment effect. If comparing standard errors instead, take square roots of the variances first; a variance percentage does not equal the corresponding standard-error percentage.

A practical calculation check has three parts. First, verify the sample sizes sum to \(N\). Second, verify that the arm with the larger standard deviation receives the larger sample size, in the same ratio as the standard deviations. Third, substitute the sample sizes into \(\sigma_1^2/n_1+\sigma_0^2/n_0\), making sure each variance is paired with its own arm's sample size. A result with the standard deviations reversed, or with a variance divided by the other arm's allocation, is not the stated design.

Common Mistake, Alternatives, and Limitations

Common mistake: “Arm 0 has four times the outcome variance, so Neyman allocation gives it four times as many participants.” This uses the variance ratio as the sample-size ratio. The correct ratio is based on standard deviations: if the variance ratio is four, the standard-deviation ratio is two, so Neyman allocation gives the more variable arm twice—not four times—the sample size.

Equal allocation is the main alternative considered here. It is simple to implement and may be chosen for reasons beyond minimizing this particular contrast variance. Under the model above, it has the same total \(N\), but its variance is generally larger when the arm standard deviations differ. The Neyman target instead prioritizes precision for the difference in means, assuming its inputs and conditions are suitable.

The calculation is only as credible as its inputs and model. If the standard deviations are poor representations of the trial outcome variability, the calculated target may not be best for the realized trial. Missing outcomes, dependence among observations, or a different estimand can also make the displayed variance formula inappropriate without modification. In addition, the continuous target does not automatically handle constraints on arm sizes or integer rounding. These practical issues do not alter the calculation shown here, but they limit how literally its optimum should be interpreted.

Finally, lower contrast variance is not the same as a larger treatment effect, and it does not guarantee a particular result or conclusion. It describes the sampling variability of the specified difference in means under the stated assumptions. Whether that precision gain is worth using depends on the trial’s goals and other design requirements.

Check Your Understanding

Try each question, then compare your reasoning with the solutions below.

  1. Two arms have outcome standard deviations 5 and 10, with a fixed total of 90. What are the Neyman sample sizes?
  2. For the settings in question 1, calculate the Neyman contrast variance and the equal-allocation contrast variance.
  3. If one arm's variance is nine times the other arm's variance, what is the Neyman sample-size ratio for the more variable arm relative to the less variable arm?
  4. Name two assumptions needed to use the contrast-variance formula in this tutorial.
  5. Does a smaller Neyman variance imply a larger treatment effect? Explain.

Solutions. 1. The standard-deviation ratio is \(5:10=1:2\). Thus \(n_1=90(5/15)=30\) and \(n_0=90(10/15)=60\); they sum to 90. 2. The Neyman variance is \(25/30+100/60=0.8333+1.6667=2.500\) outcome-units squared. Equal allocation gives 45 per arm, so its variance is \(25/45+100/45=125/45\approx2.778\) outcome-units squared. 3. A variance ratio of nine corresponds to a standard-deviation ratio of three, so the more variable arm receives three times the sample size. 4. For example, the formula assumes independent observations within arms and independent arm samples, with the specified finite arm variances and fixed sample sizes. Complete outcome observation is another condition used for the examples. 5. No. The variance describes precision of the estimated difference under the model; the treatment effect is the population mean difference and need not be larger under one allocation.

Clinical Biostats