Two Routes to Inference With Nested Cells
Single-cell measurements are nested: many cells may be measured from each donor, but a condition is often assigned to donors and donor-to-donor variation is substantial. The inferential question is therefore not simply how many cell measurements were collected. It is which source of repetition justifies the uncertainty calculation? Model-based and design-based inference answer that question differently.
Model-based inference specifies a probability model for outcomes and uses it to describe variation across donors and cells. Design-based inference instead grounds uncertainty in a sampling or treatment-assignment procedure. Both can respect the donor as the biological unit, but they rely on different assumptions and can produce different results. Neither method makes a nonrepresentative set of donors representative of a wider population.
A Shared Nested Example
Consider a hypothetical experiment in which eight donors are randomly assigned, four per condition, to control or treatment. Two cells are sampled from each donor, and a normalized expression measurement for one gene is recorded for each cell. The values below are hypothetical. For clarity, the treatment effect is expressed as the difference between treatment and control means, in expression units.
| Condition | Donor | Cell measurements | Donor mean |
|---|---|---|---|
| Control | C1 | -0.1, 0.1 | 0.0 |
| Control | C2 | 0.0, 0.2 | 0.1 |
| Control | C3 | -0.2, 0.0 | -0.1 |
| Control | C4 | 0.1, 0.3 | 0.2 |
| Treatment | T1 | 0.8, 1.0 | 0.9 |
| Treatment | T2 | 0.9, 1.1 | 1.0 |
| Treatment | T3 | 1.1, 1.3 | 1.2 |
| Treatment | T4 | 1.2, 1.4 | 1.3 |
The donor means are the natural summaries for a donor-level comparison. Averaging cells within a donor reduces cell-sampling noise, but it does not turn the eight donors into sixteen independent donors. Earlier material on intraclass correlation and cell sampling uncertainty explains why measurements from the same donor can be correlated.
Worked Example: A Donor-Level Contrast and Interval
Calculate the treatment-minus-control contrast and a pooled two-sample t interval using the eight donor means. Assume independent donors, normally distributed donor means within each condition, and a common variance across the two conditions. These assumptions are for this particular interval, not automatic properties of the data.
The control mean is \((0.0+0.1-0.1+0.2)/4=0.05\), and the treatment mean is \((0.9+1.0+1.2+1.3)/4=1.10\). Thus the estimated contrast is \(1.10-0.05=1.05\) expression units.
For control, the sum of squared deviations from 0.05 is \(0.0025+0.0025+0.0225+0.0225=0.0500\). For treatment, the sum of squared deviations from 1.10 is \(0.0400+0.0100+0.0100+0.0400=0.1000\). The pooled donor-level variance is therefore
The standard error is \(SE=\sqrt{0.0250(1/4+1/4)}=0.1118\) expression units. With \(df=6\), the 95% interval uses \(t_{0.975,6}\approx2.447\):
Under the stated normality and common-variance assumptions, this interval is a plausible range for the population mean treatment-minus-control contrast. It is not a 95% probability statement about this particular interval containing a fixed parameter. The observed donor sample variances are 0.01667 for control and 0.03333 for treatment, so their difference is worth noting, especially with only four donors per condition.
What the Hierarchical Model Adds
A simple random-intercept model makes the nested structure explicit. Let \(Y_{ij}\) be the expression measurement for cell \(j\) from donor \(i\), and let \(A_i=1\) for a treatment donor and \(A_i=0\) for a control donor. The model is
Here \(\beta_0\) is the control mean, \(\beta_1\) is the treatment-minus-control mean contrast, \(b_i\) is a donor-specific deviation, and \(\varepsilon_{ij}\) is cell-level deviation within donor. A standard version assumes \(b_i\sim N(0,\tau^2)\), \(\varepsilon_{ij}\sim N(0,\sigma^2)\), independence between these terms and across donors, and that the model describes the mean and variance adequately in both conditions. It also assumes the sampled cells give a meaningful representation of the donor-level quantity being modeled. These are substantive modeling choices, not consequences of having many cells.
For \(m\) cells per donor, the donor mean has variance \(\tau^2+\sigma^2/m\). This follows because averaging \(m\) independent cell errors gives variance \(\sigma^2/m\), while the shared donor effect remains in every cell:
The equation shows why additional cells can improve each donor's estimate without supplying the same amount of information as additional donors. As \(m\) grows, the cell-sampling component \(\sigma^2/m\) shrinks, but the between-donor component \(\tau^2\) remains.
Worked Example: Separating Donor and Cell Variation
Use the nested measurements in the table to obtain simple balanced-design moment estimates of the two variance components. Each donor has two cells, and the model assumes a common residual variance and a common donor variance across conditions.
Within every donor, the two cell measurements differ from their donor mean by \(-0.1\) and \(0.1\). Their squared deviations sum to \(0.02\) per donor, or \(0.16\) across eight donors. There are \(16-8=8\) within-donor degrees of freedom, so the within-donor mean square estimates the cell residual variance as \(\hat{\sigma}^2=0.16/8=0.0200\).
The sum of squared deviations of donor means from their respective condition means is \(0.0500+0.1000=0.1500\), with \(8-2=6\) degrees of freedom. Thus the between-donor mean square is \(0.1500/6=0.0250\). With two cells per donor, its expectation is \(\tau^2+\sigma^2/2\); consequently the moment estimate of donor variance is
The estimated variance of a donor mean is \(0.0150+0.0200/2=0.0250\). The estimated standard error of the contrast between two groups of four donors is therefore
This matches the pooled donor-level calculation in the balanced example. In this special case, fitting the hierarchical structure and analyzing donor means lead to the same estimated contrast and uncertainty. That agreement does not mean the methods are identical: the model estimates separate variance components and can accommodate more complex structures, while this simple balanced design collapses to the same donor-mean variance.
Design-Based Inference and Random Assignment
In the example, treatment was randomly assigned to donors. For design-based inference, imagine that the eight donors and their potential outcomes are fixed, and the assignment mechanism is the source of randomness. The difference in the observed donor-level means estimates the average treatment effect for these donors without requiring a normal distribution of donor outcomes. It does require that assignment really was randomized as specified and that each donor's outcome is measured according to a consistent rule.
A randomization test can assess the sharp null hypothesis that treatment has no effect on any donor. Under that null, the donor means would be unchanged by reassignment, so the assignment labels can be permuted among donors in the manner allowed by the design. If donors were sampled randomly from a broader population, that sampling design can support generalization beyond this set; random treatment assignment alone does not.
Worked Example: An Exact Donor-Level Randomization Test
For the same data, suppose exactly four of the eight donors were assigned to treatment by complete randomization. Use the absolute difference in donor means as the test statistic for the sharp null of no effect on any donor.
The observed treatment donor means sum to \(0.9+1.0+1.2+1.3=4.4\), and the total of all eight donor means is \(4.6\). For any assignment of four donors to treatment, if their sum is \(S\), the treatment-minus-control difference is
There are \(\binom{8}{4}=70\) possible assignments. The largest possible treatment sum is 4.4, from assigning the four largest donor means, and the smallest is 0.2, from assigning the four smallest. These give differences of \(4.4/2-1.15=1.05\) and \(0.2/2-1.15=-1.05\). No other assignment has an absolute difference as large as 1.05. Thus two of the 70 assignments are at least as extreme as the observed assignment, and the exact two-sided randomization p-value is \(2/70=0.02857\).
This p-value is calculated under the sharp null and the stated randomization scheme. It is not the probability that the null is true. It differs from a parametric t-test p-value because it uses the assignment distribution rather than a normal outcome model. The test is exact for the sharp null under the specified assignment mechanism; it does not, by itself, provide an interval for a general average effect.
Assumptions, Alternatives, and Failure Modes
The main distinction is the source of uncertainty. A hierarchical model can represent cell-level and donor-level variation, adjust for covariates, and estimate donor-specific responses, but its inference depends on the model and its distributional and independence assumptions. Design-based inference avoids specifying a full outcome distribution when randomization justifies the calculation, but it depends on the actual assignment or sampling design and may have limited precision with few donors.
A donor-level t analysis is another useful design-respecting approach when donors are the independent units. Its exact pooled t interval needs independent, normally distributed donor outcomes with a common variance across conditions. If the variances may differ, a Welch interval relaxes the common-variance assumption but still uses a small-sample approximation. Neither donor-level t analysis nor randomization inference treats cells as independent treatment replicates.
Common warning signs include a reported sample size equal to the number of cells when treatment was assigned to donors, a standard error that shrinks as if every cell were independent, and a model whose donor variance is effectively ignored. A large cell count cannot repair having only a few donors. Likewise, a random-intercept model is not automatically adequate just because it includes a donor term: the assumed variance structure and donor sampling process still matter. Formal residual and influence diagnostics are useful checks, but they cannot establish that the donors represent a target population or that an assignment was randomized.
Worked Example: The Cost of Treating Cells as Independent
For illustration, suppose the 16 cell measurements are incorrectly analyzed as independent observations, with eight cells per condition and a common cell-level variance. Calculate the naive pooled variance and standard error, then compare them with the donor-level standard error.
The control cell mean is 0.05. The sum of squared deviations of its eight cell values from 0.05 is \(0.18\), giving a sample variance of \(0.18/7=0.02571\). The treatment cell mean is 1.10; its squared deviations sum to \(0.28\), giving a sample variance of \(0.28/7=0.04000\). The pooled cell variance is
The naive standard error is
The donor-level standard error was \(0.1118\) expression units. The naive cell-level calculation is smaller because it counts the within-donor observations as independent replicates of the condition comparison. It does not account for the shared donor component. Its smaller standard error is not evidence of more biological replication; it reflects an incorrect independence assumption for this question.
Check Your Understanding
Answer each question before reading the solutions.
- If a treatment is assigned to donors, what is the independent unit for the treatment comparison, and what role do additional cells play?
- In the hypothetical example, what is the estimated treatment-minus-control contrast from the donor means?
- Under complete randomization of four of eight donors, why does the exact two-sided randomization test have \(70\) possible assignments?
- Does random assignment of donors alone justify generalizing the treatment effect to all donors in a wider population? Explain.
Solutions. (1) The donor is the independent assignment unit; more cells can improve measurement of each donor's outcome but do not add independent assignments. (2) The estimated contrast is \(1.10-0.05=1.05\) expression units. (3) Any subset of four donors could have received treatment, giving \(\binom{8}{4}=70\) assignments. (4) No. Random assignment supports a causal comparison for the randomized donors under the assignment design; generalization to a wider donor population requires a defensible sampling or representativeness argument, or an explicit model for transport beyond the observed donors.