Why Integer Rounding Needs Care
A Neyman allocation is first derived as a set of ideal sample sizes. Those targets can be fractional, but an experiment cannot enroll a fraction of a participant. Rounding each target independently may also change the planned total enrollment. The practical task is therefore not simply to round numbers: it is to choose feasible integer arm sizes that add to the fixed total and stay as close as reasonable to the variance-minimizing target.
This tutorial concerns the conversion step, assuming the continuous targets have already been determined. In the unconstrained, equal-cost, multiarm setting, let \(N\) be the fixed total enrollment and let \(\sigma_i\) be the outcome standard deviation in arm \(i\), for \(i=1,\ldots,K\). The variance objective for the allocation is \(\sum_i \sigma_i^2/n_i\). It is the variance of a sum of independent arm means with unit coefficients, and is the allocation criterion that yields targets proportional to the arm standard deviations. If the scientific contrast or cost structure gives a different criterion, its corresponding continuous targets and objective must be used instead.
The standard variance comparison assumes independent observations across participants, finite arm-specific variances, and fixed arm sizes when evaluating \(\sum_i \sigma_i^2/n_i\). The \(\sigma_i\) values are treated as the variances relevant to this allocation calculation. In a response-adaptive trial, this objective is a planning criterion; by itself it does not account for every possible effect of an adaptive assignment process on the sampling variance.
A Sum-Preserving Rounding Rule
A commonly used method is the largest-remainder rule. First take the floor of every continuous target. The sum of the floors cannot exceed \(N\), so the difference between \(N\) and that sum is the number of participants still to allocate. Add one participant to each of the arms with the largest fractional remainders until the total is reached. Ties require a prespecified or otherwise transparent tie-breaking rule.
Use the continuous targets \(q_i\), checking that their sum is \(N\).
For each arm, record \(\lfloor q_i\rfloor\) and \(r_i=q_i-\lfloor q_i\rfloor\).
Set \(R=N-\sum_i\lfloor q_i\rfloor\).
Add one to the \(R\) arms with largest remainders, then check the total and every minimum arm size.
When integer minimum arm sizes \(m_i\) apply, a feasible continuous target must be at least \(m_i\) in every arm. If constrained continuous targets have been found, flooring them preserves those integer minima: \(\lfloor q_i\rfloor\ge m_i\) whenever \(q_i\ge m_i\) and \(m_i\) is an integer. The resulting allocation still needs an explicit feasibility check. Do not use unconstrained targets that violate a minimum and assume that rounding will fix the underlying constrained optimization.
Worked Example: Three Arms and 101 Participants
Suppose a hypothetical three-arm trial has \(N=101\) participants and planned outcome standard deviations \(\sigma_1=10\), \(\sigma_2=20\), and \(\sigma_3=30\), in outcome units. The total standard deviation weight is \(10+20+30=60\). Assume equal per-participant costs and no arm-size minima beyond positive enrollment.
The continuous targets are:
Their floors are \((16,33,50)\), which sum to 99, so \(R=101-99=2\) participants remain. The fractional remainders are \(0.8333\), \(0.6667\), and \(0.5\), respectively. The two largest belong to arms 1 and 2, giving the integer allocation \((17,34,50)\). It sums to 101.
For comparison, the continuous minimum of the objective is \((10+20+30)^2/101=3600/101=35.6436\), in squared outcome units per participant under this variance criterion. The rounded allocation gives:
Thus its increase over the continuous minimum is about \(35.6471-35.6436=0.00349\) squared outcome units per participant. This small difference is the cost, under this objective, of using integer sample sizes rather than the ideal fractional targets.
How to Quantify the Rounding Penalty
The variance penalty can be calculated directly by evaluating the objective at an integer allocation and subtracting the continuous minimum. There is also a useful identity that expresses the difference in terms of how far each integer allocation is from its continuous target.
Write \(S=\sum_i\sigma_i\), so \(q_i=N\sigma_i/S\) and \(\sigma_i=S q_i/N\). For any positive integer allocation with \(\sum_i n_i=N\):
For the second equality, expand each squared difference: \(\sum_i(n_i-q_i)^2/n_i=\sum_i n_i-2\sum_i q_i+\sum_i q_i^2/n_i\). Both \(\sum_i n_i\) and \(\sum_iq_i\) equal \(N\), so this expression is \(\sum_iq_i^2/n_i-N\). Every term in the final penalty expression is nonnegative, and it is zero only when every integer allocation equals its continuous target. The identity therefore justifies the continuous minimum and gives a direct way to understand why deviations from the targets raise the objective.
Worked Example: Comparing Two Feasible Rounding Choices
Use the same hypothetical targets and standard deviations as above. The largest-remainder allocation is \((17,34,50)\). Another feasible allocation is \((16,35,50)\); it also sums to 101 and has positive enrollment in every arm. Compare their objectives with the continuous minimum \(3600/101=35.6436\).
For \((17,34,50)\), the objective is \(100/17+400/34+900/50=35.6471\), so the penalty is approximately \(35.6471-35.6436=0.00349\).
For \((16,35,50)\), it is:
Its penalty is approximately \(35.6786-35.6436=0.0350\). Both choices preserve the total, but the first is closer to the continuous minimum under this objective. The comparison is about allocation precision, not a claim that either arm is clinically preferable.
A third feasible choice, \((17,33,51)\), has objective \(100/17+400/33+900/51=35.6506\), giving a penalty of about \(0.00706\). This illustrates why the actual objective is useful: merely checking that the total is correct does not reveal which feasible choice is better for the stated variance criterion.
Largest Remainders and Exact Discrete Optimization
Largest remainder is simple, transparent, and preserves the total, but it is a rounding rule rather than a general proof of the best possible integer allocation. For the objective \(\sum_i\sigma_i^2/n_i\), an exact integer solution can be found by allocating participants according to marginal variance reduction, provided the starting minimum sizes and total are feasible.
If an arm currently has \(n_i\) participants, adding one more reduces its objective contribution by:
Starting at the required minimum sizes, repeatedly assign the next participant to the arm with the largest current reduction. This greedy procedure gives an exact minimum for this separable objective: each arm's successive reductions decrease as its size grows, so choosing the largest available reduction at each step selects the largest set of marginal reductions across arms. The resulting allocation uses the \(N-\sum_i m_i\) available additions with the greatest total reduction. In a tie, either tied arm gives the same immediate reduction; a consistent tie rule can be specified.
An alternative is to enumerate feasible integer allocations when there are few arms and a modest total. Independent nearest-integer rounding is not an adequate substitute: it may fail to preserve \(N\), and even when adjusted afterward, that adjustment can affect the objective. Largest remainder is often a convenient starting choice; exact discrete optimization is appropriate when the cost of even a small variance difference matters or when constraints complicate rounding.
Worked Example: Rounding With Minimum Arm Sizes
Suppose a hypothetical three-arm trial has \(N=20\), standard deviations \(1\), \(2\), and \(3\) outcome units, and a required minimum of four participants per arm. Assume the constrained continuous optimum has already been found with arm 1 at its minimum. The remaining 16 participants are allocated between arms 2 and 3 in proportion to their standard deviations, giving continuous targets \((4,6.4,9.6)\). These targets sum to 20 and satisfy all minima.
The floors are \((4,6,9)\), summing to 19. The remainder is \(1\), and the fractional parts are \(0\), \(0.4\), and \(0.6\). Largest remainder adds the final participant to arm 3, yielding \((4,6,10)\), which meets the minima and preserves the total.
The continuous constrained objective is:
At \((4,6,10)\), the objective is \(1/4+4/6+9/10=1.8167\), so the increase is approximately \(0.00417\). The other adjacent rounding choice \((4,7,9)\) also sums to 20 and satisfies the minima, but its objective is \(1/4+4/7+9/9=1.8214\), an increase of about \(0.00893\). Among these two choices, largest remainder has the smaller objective. The example assumes the constrained continuous targets are correct; deriving those targets is a separate optimization step.
Diagnostics, Limitations, and Common Mistakes
Before using an integer allocation, check the arithmetic and the assumptions behind the comparison. Confirm that the continuous targets sum to \(N\) before rounding, that the final integer arm sizes sum to \(N\), and that each size meets its minimum. If reported targets were rounded for display, perform the allocation calculations with unrounded values where available. Small display-rounding differences can otherwise change which fractional remainder is largest.
Then compare feasible alternatives with the stated objective if the choice is consequential. Check that the standard deviations refer to the same outcome scale and that the objective matches the intended allocation problem. If a minimum arm size binds, use constrained continuous targets rather than pretending the unconstrained targets are still optimal. If costs differ or the estimand gives arms unequal weights, the criterion may differ from \(\sum_i\sigma_i^2/n_i\), so the allocation comparison must change accordingly.
A common mistake is to round each target to the nearest integer and assume the total will still be \(N\). For example, that procedure can produce a sum that is too small or too large; adding or removing participants arbitrarily afterward may also worsen the variance objective. The correction is to use a sum-preserving rule such as largest remainder, verify constraints, and evaluate the objective when comparing alternatives. Another mistake is to describe the difference in \(\sum_i\sigma_i^2/n_i\) as a change in outcome units. It is a variance-scale quantity, in squared outcome units, under the objective defined here.
Finally, a small rounding penalty does not establish that the full response-adaptive design has the claimed operating characteristics. This calculation isolates the effect of integer allocation relative to its continuous target. It does not assess model misspecification, uncertainty in the standard deviations, or additional variance associated with an adaptive assignment procedure.
Check Your Understanding
Try each question, then compare your work with the solutions.
- For \(N=37\) and standard deviations \(2,3,5\), find the continuous targets and the largest-remainder integer allocation.
- Why can independent nearest-integer rounding fail even when the continuous targets sum to \(N\)?
- For an arm with \(\sigma_i=4\) and current size \(n_i=4\), what is the objective reduction from adding one participant?
- What does a rounding penalty of \(0.02\) mean if the outcome is measured in milligrams?
Solutions. (1) The standard deviation sum is \(10\), so the targets are \(37(2)/10=7.4\), \(37(3)/10=11.1\), and \(37(5)/10=18.5\). Their floors sum to \(7+11+18=36\); the one remaining participant goes to the largest remainder, \(0.5\), giving \((7,11,19)\), which sums to 37. (2) Rounding each target separately does not impose a sum constraint, so the rounded values can sum to a number other than \(N\). (3) The reduction is \(\sigma_i^2/[n_i(n_i+1)]=16/(4\cdot5)=0.8\) squared outcome units per participant under this objective. (4) It is a difference in the variance objective, expressed in squared milligrams, not a difference of \(0.02\) milligrams in an arm mean.