Designing for Condition–Batch Overlap
When biological condition and processing batch are entangled, adding more samples to the already observed groups may add little information about their separate effects. The useful question is not simply how many samples to collect, but which condition-by-batch groups should contain them. A targeted addition can make a condition effect estimable; additions that create overlap in more than one batch can also make the estimate less dependent on a single comparison.
The design calculations below concern independent biological samples, not individual cells treated as independent replicates. A sample might be a donor, animal, or independently prepared biological specimen. For a particular gene or other sample-level response, the model describes the sample-level outcome; the specific method used to form or model that outcome is outside this tutorial’s focus.
The design matrix \(X\) has one row \([1,C_i,B_i]\) for each sample. If \(X\) has full column rank, all three coefficients in this model are identifiable. But full rank is not necessary for every individual coefficient or contrast to be identifiable. A target such as \(\beta_C\) is identifiable when its value is uniquely determined by the design. More generally, a linear target \(a^\mathsf{T}\beta\) is identifiable exactly when \(a\) lies in the row space of \(X\). Equivalently, \(a^\mathsf{T}v=0\) for every vector \(v\) satisfying \(Xv=0\). The null space describes coefficient changes that leave all fitted values unchanged; an identifiable target cannot change under any such change.
Choosing Groups to Add
A condition-by-batch cross-tabulation shows which groups are present and which are empty. The earlier material on cross-tabulations and connectivity graphs provides ways to diagnose overlap; the design task is to use that diagnosis to choose new samples. When both conditions occur in the same batch, their within-batch contrast separates condition from batch under the additive model. Adding samples to a group already represented does not create that comparison if the other condition remains absent from the batch.
For two conditions and two batches, suppose the observed groups are condition 0 in batch 1 and condition 1 in batch 2. With the coding above, \(C_i=B_i\) in every observed row. Thus the condition and batch columns are identical: their separate effects cannot be distinguished from these data. Adding even one sample to either missing group breaks this exact aliasing and gives a full-rank design under the additive model. Adding samples to both missing groups is not required for full rank, but it creates a within-batch condition comparison in each batch and can improve precision and robustness.
Worked Example: One Addition Restores Full Rank
Suppose there are two reference-condition samples in batch 1, with responses 4 and 6 units, and two condition-of-interest samples in batch 2, with responses 10 and 12 units. The observed design rows are repetitions of \([1,0,0]\) and \([1,1,1]\). Because \(C_i=B_i\) for every sample, the design has rank 2, not 3; the separate condition and batch effects are not identifiable.
Now add one biological sample in condition 1, batch 1, with response 7 units. Three representative design rows are $$ X_{\mathrm{new}}= \begin{bmatrix} 1&0&0\\ 1&1&1\\ 1&1&0 \end{bmatrix}. $$ Its determinant is \(-1\), so these rows have rank 3 and all coefficients are identifiable. The batch-1 reference mean is \((4+6)/2=5\) units, and the batch-1 condition mean is 7 units. Therefore the adjusted condition estimate is \(7-5=2\) units. The batch-2 condition mean is 11 units, so the fitted batch effect is \(11-(5+2)=4\) units.
The new design does not provide a direct within-batch condition contrast in batch 2. Its interpretation relies on the model’s common condition effect across batches. The same rank restoration would occur by adding one reference-condition sample in batch 2 instead, giving overlap there rather than in batch 1.
How Overlap Affects Precision
Under the stated independent, equal-variance error model and a full-rank design, the ordinary least-squares estimator is \(\hat{\beta}=(X^\mathsf{T}X)^{-1}X^\mathsf{T}Y\), with variance matrix \(\sigma^2(X^\mathsf{T}X)^{-1}\). This shows why design affects precision: the arrangement of the rows of \(X\), not only their count, determines the variance of the condition estimate. If the design is rank deficient, this inverse does not exist for the full coefficient vector, although a particular identifiable target may still be estimable.
When both conditions are represented in batch \(b\), define the within-batch contrast \(D_b=\bar{Y}_{1b}-\bar{Y}_{0b}\), where \(\bar{Y}_{1b}\) and \(\bar{Y}_{0b}\) are the sample means for the two conditions. If the corresponding group sizes are \(n_{1b}\) and \(n_{0b}\), then $$ \operatorname{Var}(D_b)=\sigma^2\left(\frac{1}{n_{1b}}+\frac{1}{n_{0b}}\right). $$ This follows because the two independent sample means have variances \(\sigma^2/n_{1b}\) and \(\sigma^2/n_{0b}\), and the variance of their difference is the sum. Under the common-effect additive model, independent within-batch contrasts can be combined with weights proportional to their inverse variances. Batches without both conditions do not supply a direct within-batch contrast.
Worked Example: Two Overlapping Batches Improve Precision
Return to the initial design with two samples in condition 0, batch 1, and two in condition 1, batch 2. Add one sample to each missing group: condition 1, batch 1, and condition 0, batch 2. The group sizes are now \((n_{01},n_{11})=(2,1)\) in batch 1 and \((n_{02},n_{12})=(1,2)\) in batch 2. Suppose the sample means are 5 and 7 units in batch 1, and 8 and 10 units in batch 2. Each within-batch contrast is 2 units.
If the residual variance is \(\sigma^2\), each contrast has variance $$ \sigma^2\left(\frac{1}{2}+\frac{1}{1}\right)=1.5\sigma^2. $$ The two contrasts have equal precision, so their common-effect estimate is their average, \((2+2)/2=2\) units. The variance of that average is \((1.5\sigma^2+1.5\sigma^2)/4=0.75\sigma^2\). With only the batch-1 addition, the sole direct within-batch contrast would have variance \(1.5\sigma^2\). Thus adding the second missing group halves the variance in this example and provides overlap in both batches.
A Justification for Balanced Additions
Balanced group sizes make the within-batch comparisons easier to interpret and can improve precision for a fixed total number of samples. For a simple illustration, suppose every condition-by-batch group has \(m\) independent samples. Each batch contrast then has variance \(\sigma^2(1/m+1/m)=2\sigma^2/m\). Averaging the two independent batch contrasts gives $$ \operatorname{Var}\left(\frac{D_1+D_2}{2}\right) =\frac{1}{4}\left(\frac{2\sigma^2}{m}+\frac{2\sigma^2}{m}\right) =\frac{\sigma^2}{m}. $$ The result depends on independence, equal residual variance, and a common condition effect. It is a design calculation, not a guarantee that real biological variability will be identical across groups.
Worked Example: Comparing Two Four-Sample Addition Plans
Suppose the initial design again has two samples in condition 0, batch 1, and two in condition 1, batch 2. Consider two plans that each add four samples. Plan A adds all four to condition 1, batch 1. Plan B adds two to condition 1, batch 1 and two to condition 0, batch 2. Assume the residual standard deviation is 2 expression units, so \(\sigma^2=4\) expression units squared.
Under Plan A, the only batch with both conditions has group sizes 2 and 4. The condition estimate is identified from that within-batch contrast, whose variance is $$ 4\left(\frac{1}{2}+\frac{1}{4}\right)=3 $$ expression units squared. Its standard error is \(\sqrt{3}=1.732\) expression units.
Under Plan B, both batches have two samples in each condition. Each batch contrast has variance \(4(1/2+1/2)=4\) expression units squared. Averaging the two independent contrasts gives variance \((4+4)/4=2\) expression units squared and standard error \(\sqrt{2}=1.414\) expression units. Relative to Plan A, this reduces the variance by \((3-2)/3=0.3333\), or 33.3%. Both plans identify the common condition effect; Plan B is more precise under the assumptions and also supplies overlap in both batches.
Practical Design Checks and Limitations
A useful design review asks both whether the target is identifiable and whether its uncertainty is likely to be acceptable. Full rank alone does not answer the second question. A barely connected design can have full rank but weak information, reflected in a large standard error or a very small singular value of the design matrix. Before collecting samples, inspect the condition-by-batch counts and the design matrix; after additions, verify that the intended contrast is estimable and assess its standard error under plausible residual variability.
- Prioritize missing comparisons. If resources permit, add independent biological samples to absent condition-by-batch groups rather than only enlarging groups that cannot provide a within-batch comparison.
- Decide whether one-batch overlap is sufficient. One sample in either missing group can restore full rank in the two-condition, two-batch additive example. Replication in the overlap group is still needed for stable estimation of within-group variability, and overlap in both batches reduces dependence on a single batch.
- Check the model before using its leverage. If the condition effect varies by batch, a common-effect additive model may be misleading. Estimating batch-specific condition effects requires condition overlap within the relevant batches; one overlap in only one batch cannot establish effects in both.
- Do not count cells as independent biological replication. Many cells from one specimen do not replace independent samples for estimating a condition effect across specimens. A large cell count can coexist with inadequate sample-level replication.
There are alternatives when a targeted addition is impossible: collect a new batch containing both conditions, or redesign collection so condition is represented across batches from the outset. If the available design has no informative overlap, adding more samples only to its existing groups cannot separate condition from batch without additional assumptions or external information. Changing the model’s assumptions may produce a number, but it does not create information that the design did not contain.
Common Mistake
Wrong reasoning: “The design matrix is rank deficient, so no condition effect can be estimated,” or, conversely, “one sample in a missing group makes the study fully reliable.” Both claims go too far. Rank deficiency concerns whether all coefficients are identifiable; a particular contrast can remain identifiable. And one added sample may restore algebraic identifiability while leaving the estimate imprecise and dependent on the additive-model assumption. State the target, check its identifiability, then evaluate precision and assumptions separately.
Check Your Understanding
Answer each question, then compare with the solutions.
- In a two-condition, two-batch study, only condition 0 in batch 1 and condition 1 in batch 2 are observed. Which single missing group could receive one sample to restore full rank under the additive model?
- Explain why a rank-deficient design does not necessarily make every coefficient contrast unidentifiable.
- In one batch, there are 3 condition-0 samples and 2 condition-1 samples. If \(\sigma^2=9\) response-units squared, calculate the variance and standard error of the within-batch contrast.
- Why might adding samples to both missing groups be preferable to adding one sample to only one missing group, even if either can restore full rank?
Solutions. (1) Either condition 1 in batch 1 or condition 0 in batch 2 breaks the exact equality of the condition and batch columns and gives a full-rank design. (2) A target is identifiable if it is unchanged by every coefficient change \(v\) for which \(Xv=0\); the design may fail to identify all coefficients while still identifying a particular contrast. (3) The variance is \(9(1/3+1/2)=9(5/6)=7.5\) response-units squared, and the standard error is \(\sqrt{7.5}=2.739\) response units. (4) Both additions create within-batch comparisons in each batch, can improve precision, and reduce reliance on a single batch-specific comparison, though the common-effect model and independent biological replication assumptions still matter.