From Allocation Counts to a Schedule
A complete-randomization design can specify how many participants are assigned to each treatment while leaving the order of those assignments random. To implement it, the design must become a schedule: an ordered list of treatment labels, with one entry for each planned participant. The list is prepared before assignment, then its entries are used in order as participants enroll.
For example, suppose a trial plans to assign 8 participants to treatment A and 4 to treatment B. The allocation counts are fixed, but the position of each label in the schedule is randomized. This guarantees the planned totals if all 12 scheduled assignments are used. It does not guarantee a particular order, balanced allocation at every interim point, or balance on participants’ characteristics.
The schedule’s order matters operationally, but a particular eligible order should not be favored over another by the randomization procedure. One straightforward method is to create a list containing the required number of each treatment label and uniformly shuffle the list. The schedule then assigns its first label to the first enrolled participant, its second label to the second participant, and so on.
Generating the Schedule by Permuting Labels
A standard way to shuffle a list is the Fisher–Yates procedure. Begin with the list of labels. Starting at its last position and moving left, choose an integer position uniformly from the positions not yet fixed, then swap the label in the current position with the label in the chosen position. Once position 2 is processed, the list is shuffled.
For allocation counts \(n_1,\ldots,n_K\), include exactly \(n_k\) copies of each treatment label \(k\).
Use a documented random-number generator and a valid uniform-shuffling procedure, such as Fisher–Yates.
Confirm the schedule has \(N\) entries and that each treatment label appears its specified number of times.
Save the schedule and the information needed to regenerate it, and specify how its entries are used.
Uniformity is important. At each Fisher–Yates step, the selected position must be uniform among the available positions. A routine that produces a shuffle by repeatedly swapping arbitrary positions can bias the result if it is not designed to sample permutations uniformly. In practice, use a recognized shuffle implementation rather than improvising one.
Worked Example: Shuffling a 2:1 Allocation
A hypothetical trial plans 9 assignments, with 6 to A and 3 to B. The required label list is A, A, A, A, A, A, B, B, B. Suppose a valid shuffle returns B, A, A, B, A, A, A, B, A. This is one possible schedule; the order is illustrative, not a recommendation for any real trial.
Check the length. The schedule contains 9 entries, matching \(N=6+3=9\).
Check the treatment counts. A appears in positions 2, 3, 5, 6, 7, and 9, so it appears 6 times. B appears in positions 1, 4, and 8, so it appears 3 times. Both specified totals are satisfied.
Read it as an assignment rule. If participants enroll in a fixed sequence and all assignments are made as planned, the first receives B, the second A, and the third A, continuing in schedule order. The schedule does not say that the first three must include a particular treatment mix; in this example, they happen to include two A assignments and one B assignment.
Why Permuting Labels Gives Complete Randomization
The label list has repeated labels, so several permutations of the individual list produce the same treatment schedule. This does not make some treatment schedules more likely than others. The reason is that every schedule with the specified counts is produced by the same number of permutations of labels treated as distinct tokens.
The denominator is the number of distinct schedules with those counts. This argument explains why shuffling repeated treatment labels yields uniform complete randomization when the underlying shuffle is uniform. It also shows that the allocation counts are fixed by construction, not merely expected to be achieved on average.
Worked Example: Reproducing a Schedule From a Recorded Seed
Consider a hypothetical 6-assignment trial with 4 assignments to A and 2 to B. A valid Fisher–Yates shuffle of the distinct tokens A1, A2, A3, A4, B1, B2 starts with that token order. For a fully specified reproducibility record, suppose the recorded seed is 418 and the documented random-number generator, in the stated software environment, returns the successive shuffle positions 2, 5, 1, 3, 1 for the steps with current positions 6, 5, 4, 3, 2. The seed and generator details identify how this stream is obtained; the position stream is included here so the hand calculation can be checked.
At position 6, swap positions 6 and 2: the list becomes A1, B2, A3, A4, B1, A2. At position 5, swap position 5 with itself, leaving the list unchanged. At position 4, swap positions 4 and 1: the list becomes A4, B2, A3, A1, B1, A2. At position 3, swap position 3 with itself. Finally, at position 2, swap positions 2 and 1: the list becomes B2, A4, A3, A1, B1, A2.
Removing the token subscripts gives the assignment schedule B, A, A, A, B, A. A rerun with the same seed and the same generator and shuffle procedure should reproduce this order in the specified environment. The final count check gives four A labels and two B labels, as required.
A seed by itself is not a complete reproducibility record. The generator algorithm, software and version, shuffle function, input list and its order, and any random-number calls made before the shuffle can affect the result. Some software changes its random-number implementation between versions. Therefore, retain the actual schedule as well as the seed-based information; the saved schedule is the operational record if exact regeneration later fails.
Checking the Schedule and Its Limits
A basic verification checks that the schedule contains the planned number of entries and that each treatment total is correct. A simple count table makes this explicit. If any count is wrong, stop and investigate rather than silently changing labels: editing the output may alter the randomization distribution and break reproducibility.
| Check | What to verify | What it establishes |
|---|---|---|
| Length | The number of entries equals \(N\). | The schedule covers the planned number of assignments. |
| Arm totals | Treatment \(k\) appears \(n_k\) times for every \(k\). | The specified fixed allocation counts are present. |
| Reproduction | The documented procedure regenerates the saved vector. | The computational record is consistent with the schedule. |
| Use in sequence | Assignment follows the specified enrollment order. | The generated schedule is applied as intended. |
These checks do not prove that the random-number generator was implemented correctly, that the schedule was protected from unauthorized access, or that participants received assignments in the intended order. Nor do fixed totals imply balance at interim sample sizes: a schedule may begin with several consecutive assignments to the same treatment. Complete randomization controls the final counts specified in advance; it does not force balance within shorter portions of the schedule.
The central alternative for producing fixed counts is to select the positions for one treatment directly, then assign the remaining positions to the other treatment. For example, one could select \(n_A\) of the \(N\) positions uniformly from all subsets of that size. This is equivalent in distribution to uniformly shuffling a list with \(n_A\) A labels and \(N-n_A\) B labels. Shuffling is often convenient for implementation because it directly yields an ordered assignment vector; direct position selection can make the fixed-count logic especially transparent. Neither approach creates interim balance guarantees.
Worked Example: Finding an Incorrect Total
A hypothetical schedule for 10 participants is recorded as A, B, A, A, B, A, B, A, B, B. The planned counts are 6 assignments to A and 4 to B.
Count A labels at positions 1, 3, 4, 6, and 8: there are 5, not 6. Count B labels at positions 2, 5, 7, 9, and 10: there are 5, not 4. The length is correct, but both treatment totals are wrong; the vector cannot be the required 6:4 fixed-count schedule.
The appropriate response is to compare the saved vector with the original generated output and the allocation specification. Do not replace one B with A merely to make the totals work, because this would be an undocumented change to the randomized schedule. If a corrected schedule must be generated, document the reason, procedure, seed information, and which schedule is authoritative.
Common Mistakes and Practical Safeguards
- Checking only the total length. A vector can have \(N\) entries and still have incorrect arm counts. Count every treatment separately.
- Assuming the seed alone guarantees reproduction. Reproduction depends on the generator, software environment, input ordering, and sequence of random-number calls as well as the seed.
- Changing a schedule after inspection. Hand edits can destroy the intended randomization. Preserve the original output and use a documented regeneration process if correction is necessary.
- Confusing fixed totals with balance throughout enrollment. The final counts are fixed, but early portions of the schedule can be imbalanced.
- Revealing the schedule too early. Reproducibility requires retaining the schedule and its generation record, not making future assignments available to people who could anticipate them. Keep access consistent with the trial’s assignment procedures.
The practical value of this simple procedure is that the allocation rule is explicit, inspectable, and reproducible. Its limits are equally important: it provides the specified final arm counts, but it does not respond to outcomes, guarantee covariate balance, or constrain the order in which those counts appear. Those are distinct design properties, not consequences of shuffling labels.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A schedule has 15 assignments, planned as 9 to A and 6 to B. What label list should be shuffled, and what two count checks should be made?
- Why does uniformly shuffling a list with repeated treatment labels give equal probability to each eligible fixed-count schedule?
- A saved schedule has the correct counts, but a rerun using the recorded seed produces a different order. Name at least three details to investigate.
- Does a fixed-count schedule guarantee that the first half of enrollment has the planned allocation ratio? Explain.
Solutions. (1) Shuffle 9 A labels and 6 B labels. Verify that the resulting vector has length 15, exactly 9 A labels, and exactly 6 B labels. (2) Each eligible schedule can be produced by the same number, \(\prod_k n_k!\), of permutations of distinct tokens, so uniform permutations induce equal probabilities for all such schedules. (3) Check the generator algorithm and software version, the shuffle implementation, the initial label order, and whether earlier random-number calls changed the stream. Also verify the seed and that the same procedure was used. (4) No. Fixed counts apply to the complete schedule; the early segment can have a different ratio because the order is random.