Tutorials › Response-Adaptive Randomization › Assignment Vectors and Allocation Ratios

Randomization Basics · Tutorial 18 of 501

Assignment Vectors and Allocation Ratios

Learn to encode treatment assignments with a binary vector, interpret a treatment allocation ratio, and determine whether a target ratio can be met exactly for a fixed trial size.

Beginner 9 min read

What You'll Learn

  • Define a binary assignment vector and state what its entries represent.
  • Convert assignment-vector entries into treatment counts.
  • Interpret the order and meaning of a treatment allocation ratio.
  • Calculate exact treatment counts when the ratio fits the planned sample size.
  • Recognize when an exact ratio is impossible and describe the resulting approximation.
  • Distinguish a target ratio from a randomization procedure or assignment probability.

Representing Treatment Assignments

A treatment assignment has two related descriptions: the label given to each participant and the counts of participants assigned to each treatment. A vector records the labels in participant order; an allocation ratio summarizes the group counts. Keeping these descriptions distinct makes it easier to specify a design clearly and check that its planned sample size is compatible with its target ratio.

For a two-treatment trial, call the treatments A and B. Suppose there are \(N\) participants, indexed \(i=1,\ldots,N\). Use a binary indicator \(Z_i\) for participant \(i\): the value 1 indicates assignment to A, and the value 0 indicates assignment to B. The coding is a convention, so it must be stated; reversing which treatment is coded 1 changes the vector but not the underlying treatment groups.

Definition: The binary assignment vector is \(Z=(Z_1,\ldots,Z_N)\), where each \(Z_i\in\{0,1\}\). Under the convention that 1 denotes A and 0 denotes B, the number assigned to A is \(n_A=\sum_{i=1}^{N}Z_i\), and the number assigned to B is \(n_B=N-n_A=\sum_{i=1}^{N}(1-Z_i)\). Thus \(n_A+n_B=N\).

For example, \(Z=(1,0,1,1,0)\) means that participants 1, 3, and 4 are assigned to A, while participants 2 and 5 are assigned to B. The vector records who receives which treatment, in the chosen order. The pair \((n_A,n_B)\) records only the group sizes; it does not say which participants are in each group.

If assignment is generated randomly, the vector is a random object before assignments are made and a realized vector after they are made. This distinction does not change the counting definitions. Specifying an allocation ratio alone does not specify how a vector is selected, or how likely any particular participant is to receive a treatment.

Allocation Ratios and Fixed Sample Sizes

An allocation ratio states the intended relative numbers assigned to the treatments. For two treatments, write it in treatment order as A:B. A ratio of 2:1 means that the target number assigned to A is twice the target number assigned to B. It does not mean that every pair of consecutive participants must contain two assignments to A and one to B.

Definition: An allocation ratio \(a:b\) for treatments A:B specifies target counts in the proportion \(n_A:n_B=a:b\), where \(a\) and \(b\) are positive integers. The ratio is exact for realized counts when \(n_A/n_B=a/b\). It is usually useful to reduce a ratio to lowest terms before checking whether a fixed total can be divided exactly.

To find exact counts for a planned total \(N\), suppose \(a:b\) is reduced. If the exact ratio holds, there is an integer \(k\) such that \(n_A=ak\) and \(n_B=bk\). Adding the counts gives \(N=(a+b)k\), so:

$$ k=\frac{N}{a+b},\qquad n_A=\frac{aN}{a+b},\qquad n_B=\frac{bN}{a+b}. $$

These expressions give exact integer counts if and only if \(N\) is divisible by \(a+b\). Because \(a\) and \(b\) are relatively prime, when \(N\) is divisible by their sum, \(k\) is an integer and both counts are integers. If \(N\) is not divisible by \(a+b\), no pair of integer counts can have both total \(N\) and exactly that ratio.

The divisibility check is a useful design diagnostic, not a minor arithmetic detail. A stated sample size and ratio can be inconsistent if they are both intended as exact. If the total cannot be divided exactly, the protocol or planning description should say whether counts are approximate, whether the total may change, or which treatment receives the extra participant.

Worked Example: Reading a Vector and Checking a 2:1 Ratio

Suppose a hypothetical trial plans 12 participants and uses the convention 1 = A and 0 = B. Its assignment vector is \(Z=(1,0,1,1,0,1,1,0,1,1,0,1)\). Find the treatment counts and check whether they have a 2:1 ratio.

The vector has eight entries equal to 1 and four entries equal to 0. Therefore \(n_A=8\), \(n_B=4\), and \(n_A+n_B=8+4=12\), as required.

The realized ratio is \(n_A:n_B=8:4\). Dividing both parts by 4 gives \(2:1\), so the vector has exactly the stated ratio. The assignment order matters for identifying individual treatment labels, but the ratio check uses only the counts.

Worked Example: Translating a 3:2 Target Into Counts

A hypothetical study plans to enroll \(N=50\) participants and specifies A:B = 3:2. Assuming both the total and ratio are intended to be exact, calculate the required counts.

The ratio is already in lowest terms. The total number of ratio parts is \(3+2=5\), so \(k=N/(3+2)=50/5=10\). Each ratio part represents 10 participants.

Thus \(n_A=3k=3(10)=30\) and \(n_B=2k=2(10)=20\). The counts sum to \(30+20=50\), and \(30:20\) reduces to \(3:2\). The exact ratio is feasible because \(50\) is divisible by 5.

When the Target Ratio Does Not Divide the Total

When \(N\) is not divisible by the sum of the reduced ratio parts, the exact-count equations have no integer solution. A practical plan may still use a ratio as a target, but it must choose integer counts whose sum is \(N\). There can be more than one reasonable approximate choice, particularly when rounding produces a tie. State the rounding or tie-breaking rule rather than implying that a noninteger participant count can be enrolled.

One common approach is to choose the integer count for A nearest to \(aN/(a+b)\), then assign the remaining \(N-n_A\) participants to B. The realized ratio will generally differ slightly from the target. This method is a planning convention, not a mathematical guarantee that the chosen approximation is uniquely best for every scientific objective.

Worked Example: Approximating Equal Allocation With 47 Participants

A hypothetical two-treatment trial plans \(N=47\) and requests an equal A:B target of 1:1. Can it meet that ratio exactly? If the plan uses the convention of assigning the extra participant to A, what are the counts and realized ratio?

The reduced ratio has \(1+1=2\) parts, but 47 is not divisible by 2. The exact formulas give \(n_A=47/2=23.5\) and \(n_B=47/2=23.5\), which are not valid participant counts. Exact equality is therefore impossible with 47 participants.

Under the stated tie-break, choose \(n_A=24\) and let \(n_B=47-24=23\). The realized ratio is \(24:23\), or \(24/23\approx1.043\) A participants per B participant. This is close to, but not exactly, 1:1. Choosing 23 for A and 24 for B would be equally close in absolute count; the tie-break determines which treatment receives the extra participant.

What the Ratio Does—and Does Not—Specify

A ratio is a compact description of planned group sizes. It is not itself an assignment list, and it does not prescribe the order of assignments. For example, with eight participants and counts of four per treatment, many different binary vectors have those same counts. The ratio alone cannot identify which vector will be used.

It is also important to distinguish a ratio from a per-participant assignment probability. In a design with a 2:1 target, the planned counts are in a 2:1 proportion; that statement by itself does not establish that every participant has probability \(2/3\) of receiving A. Such probabilities depend on the assignment mechanism and the point at which they are defined. A ratio may be used in different randomization designs, and a count target alone does not tell us which one is in force.

Design descriptionWhat it tells youWhat it does not tell you alone
Binary assignment vectorThe treatment label for each indexed participantWhy that vector was selected
Allocation counts \((n_A,n_B)\)The number assigned to each treatmentThe participant-by-participant assignment order
Target ratio A:BThe intended relative group sizesThe realized counts when the target is infeasible, or the randomization mechanism

Equal allocation, such as 1:1, is a special case of a ratio. Unequal allocation, such as 2:1 or 3:2, changes the target group sizes. Choosing between these targets is a design decision; the arithmetic here translates a chosen target into counts but does not determine which target is scientifically or ethically appropriate.

Checks and Common Failure Modes

Before communicating a two-treatment allocation plan, check that the treatment order in the ratio is explicit, the binary coding convention is stated, the counts sum to \(N\), and any claimed exact ratio reduces to the stated target. If the target cannot be met exactly, document the approximation rule and the resulting counts. These simple checks catch many avoidable ambiguities.

  • Reversing the treatment order. A:B = 2:1 assigns twice as many target slots to A as to B. B:A = 2:1 says the reverse. Always label the order.
  • Calling a target an achieved ratio. A planned 1:1 target with 47 participants cannot yield equal integer counts. Report the realized 24:23 (or 23:24), not an exact 1:1 allocation.
  • Confusing vector and counts. The vector \((1,0,1,0)\) specifies participant labels; the counts \((2,2)\) discard their order. Both descriptions are useful, but they answer different questions.
  • Assuming a ratio is an assignment rule. A ratio does not say how assignments are generated, nor does it identify the probability of a treatment for a particular participant.
  • Using noninteger counts. Values such as 23.5 participants reveal that an exact ratio is incompatible with the fixed total; they are not valid final allocation counts.

A useful short derivation explains the feasibility rule. If the ratio is exactly \(a:b\), with \(a\) and \(b\) reduced, then the counts must be integer multiples of the ratio parts: \(n_A=ak\) and \(n_B=bk\) for an integer \(k\). Therefore \(N=n_A+n_B=(a+b)k\), which requires divisibility of \(N\) by \(a+b\). Conversely, if \(N=(a+b)k\) for an integer \(k\), the counts \(ak\) and \(bk\) are integers, sum to \(N\), and have ratio \(a:b\). This proves both necessity and sufficiency.

Key takeaway: State the binary coding convention, read the ratio in its labelled treatment order, and verify integer counts against the fixed total. If exact counts are impossible, report an explicit approximation instead of treating the target as achieved.

Check Your Understanding

For each question, identify the relevant counts or feasibility condition. Solutions are included below the questions.

  1. With 18 participants and A:B = 2:1, what are the exact counts?
  2. With 28 participants and A:B = 3:1, can the exact ratio be achieved? If so, give the counts.
  3. Under the convention 1 = A and 0 = B, a vector has 11 entries and its entries sum to 6. How many participants are assigned to each treatment?
  4. A trial has 25 participants and targets A:B = 1:1. Is exact equality possible? Give one approximate count pair and its realized ratio.
  5. Explain why the statement “the trial uses a 2:1 ratio” does not, by itself, specify the probability that a particular participant receives A.

Solutions. (1) The ratio has three parts, so \(k=18/(2+1)=6\). Thus \(n_A=2(6)=12\) and \(n_B=1(6)=6\); the counts sum to 18. (2) The reduced ratio has four parts and \(28/4=7\), so it is feasible: \(n_A=3(7)=21\) and \(n_B=1(7)=7\). (3) The sum of the entries is \(n_A=6\); therefore \(n_B=11-6=5\). (4) Exact equality would require \(25/2=12.5\) participants per treatment, so it is impossible. One approximate choice is \(n_A=13\), \(n_B=12\), with realized ratio \(13:12\); the reverse choice is equally close. (5) The ratio describes relative target counts, not the procedure for selecting each participant’s assignment. Assignment probabilities require a specified randomization mechanism and may depend on when the probability is evaluated.

Clinical Biostats