Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Deriving the Cluster Design Effect

Biological Replication and Donor-Level Inference · Tutorial 433 of 700

Deriving the Cluster Design Effect

Derive the variance multiplier for equally sized cell clusters and interpret how shared donor-level correlation changes the uncertainty of a cell-level mean.

Advanced 9 min read

What You'll Learn

  • State the equal-size, common-variance, and within-cluster correlation assumptions behind the design effect.
  • Derive the variance of the overall mean when cells are grouped into independent clusters.
  • Calculate the design effect and distinguish variance inflation from standard-error inflation.
  • Interpret how cluster size and intraclass correlation affect the variance.
  • Recognize when unequal cluster sizes or non-exchangeable correlations make the simple formula inadequate.

Why Cells in the Same Donor Change the Variance

A large number of measured cells can make an estimate look highly precise if every cell is treated as an independent observation. But cells from the same donor share biological and technical influences, so their expression values may be correlated. Positive within-donor correlation means that observing more cells from one donor often adds less independent information than observing the same number of cells from different donors.

The cluster design effect quantifies this change in variance under a specific, tractable setting: every donor contributes the same number of cells, donors are independent, and every pair of cells from one donor has the same correlation. It is a variance ratio, not a multiplier to apply directly to an estimate or its standard error. The derivation makes clear both why the formula has its particular form and when it should not be used.

Definition: Suppose there are \(D\) independent clusters, each containing \(m\) observations \(Y_{ij}\), where \(i=1,\ldots,D\) indexes clusters and \(j=1,\ldots,m\) indexes observations within a cluster. Assume every observation has mean \(\mu\) and variance \(\sigma^2\), and any two distinct observations in the same cluster have correlation \(\rho\). The equal-size cluster design effect is the ratio of the variance of the mean over all \(Dm\) observations under this clustered covariance structure to its variance under independence with the same marginal variance and sample size.

Assumptions and Derivation

The target here is the overall mean \(\bar{Y}=(1/(Dm))\sum_{i=1}^{D}\sum_{j=1}^{m}Y_{ij}\). Because each observation has mean \(\mu\), this mean is unbiased for \(\mu\). The assumptions are: clusters are mutually independent; each observation has the same finite variance \(\sigma^2\); all within-cluster pairs have covariance \(\rho\sigma^2\); and cluster sizes are all exactly \(m\). This common within-cluster correlation structure is often called exchangeable. The usual application has \(0\leq\rho\leq1\), though mathematically a negative \(\rho\) is possible within a lower bound set by \(m\).

For a single cluster, its sum \(S_i=\sum_{j=1}^{m}Y_{ij}\) contains \(m\) individual variances and \(m(m-1)\) ordered covariance terms. Therefore:

$$ \begin{aligned} \operatorname{Var}(S_i) &= \sum_{j=1}^{m}\operatorname{Var}(Y_{ij}) + \sum_{j\ne k}\operatorname{Cov}(Y_{ij},Y_{ik}) \\ &= m\sigma^2 + m(m-1)\rho\sigma^2 \\ &= m\sigma^2\left[1+(m-1)\rho\right]. \end{aligned} $$

The mean over all observations is the sum of the \(D\) cluster totals divided by \(Dm\). Since the clusters are independent, variances of their totals add. Dividing by \((Dm)^2\) gives the variance of the overall mean:

$$ \operatorname{Var}(\bar{Y}) = \frac{D\,m\sigma^2[1+(m-1)\rho]}{(Dm)^2} = \frac{\sigma^2}{Dm}\left[1+(m-1)\rho\right]. $$

If all \(Dm\) observations were independent with the same marginal variance, the variance would instead be \(\sigma^2/(Dm)\). Taking the ratio gives the result.

Theorem: Under the equal-size and exchangeable-correlation assumptions, the variance of the overall mean is the independent-observation variance multiplied by the design effect, $$ \operatorname{DE}=1+(m-1)\rho. $$ Thus \(\operatorname{Var}(\bar{Y})=\sigma^2\operatorname{DE}/(Dm)\). The corresponding standard error is multiplied by \(\sqrt{\operatorname{DE}}\), not by \(\operatorname{DE}\).

The expression can also be rearranged to expose the role of cluster size:

$$ \operatorname{Var}(\bar{Y}) = \frac{\sigma^2}{D}\left[\rho+\frac{1-\rho}{m}\right]. $$

For positive \(\rho\), the term \(\rho\sigma^2/D\) remains as \(m\) grows, while the within-cluster contribution \(\sigma^2(1-\rho)/(Dm)\) declines. In other words, adding cells within existing donors can reduce the part of uncertainty due to cell-level variation, but it cannot eliminate variation shared within donors. This interpretation concerns the variance of this mean under the stated model; it does not imply that every analysis should use this mean as its estimand.

Worked Example: Calculating the Variance and Standard-Error Inflation

Suppose a hypothetical study measures a gene in \(D=12\) donors, with \(m=10\) cells per donor. Assume the cell-level marginal variance is \(\sigma^2=25\) expression-units squared and the within-donor correlation is \(\rho=0.08\). Under the assumptions above, calculate the design effect and the variance and standard error of the overall mean.

The design effect is:

$$ \operatorname{DE}=1+(m-1)\rho =1+(10-1)(0.08) =1+0.72 =1.72. $$

There are \(Dm=12(10)=120\) cells. The clustered variance is:

$$ \operatorname{Var}(\bar{Y}) =\frac{25}{120}(1.72) =0.3583\ \text{expression-units}^2. $$

The standard error is the square root of that variance:

$$ SE(\bar{Y})=\sqrt{0.3583}=0.5986\ \text{expression units}. $$

Under independence, the variance would be \(25/120=0.2083\) expression-units squared and the standard error would be \(\sqrt{0.2083}=0.4564\) expression units. The design effect of 1.72 means the clustered variance is 1.72 times the independence variance; the standard error is instead \(\sqrt{1.72}=1.311\) times as large. These calculations assume the supplied variance and correlation are appropriate and that donors are independent.

Worked Example: More Cells per Donor at a Fixed Total Cell Count

Compare two hypothetical designs with the same total of 120 cells and the same \(\sigma^2=9\) expression-units squared and \(\rho=0.10\). Design A has \(D=30\) donors and \(m=4\) cells per donor; design B has \(D=10\) donors and \(m=12\) cells per donor. Calculate the design effect and variance of the overall mean for each design.

For design A:

$$ \operatorname{DE}_A=1+(4-1)(0.10)=1.30, \qquad \operatorname{Var}(\bar{Y}_A)=\frac{9}{120}(1.30)=0.09750\ \text{expression-units}^2. $$

For design B:

$$ \operatorname{DE}_B=1+(12-1)(0.10)=2.10, \qquad \operatorname{Var}(\bar{Y}_B)=\frac{9}{120}(2.10)=0.1575\ \text{expression-units}^2. $$

The corresponding standard errors are \(\sqrt{0.09750}=0.3122\) and \(\sqrt{0.1575}=0.3969\) expression units. With the same total number of cells, the design with fewer, larger clusters has greater variance under these assumptions. This comparison holds the marginal variance and correlation fixed; it is not a universal claim that one sampling design is preferable for every estimand or study.

Worked Example: Seeing the Limit as Cluster Size Grows

Consider a hypothetical design with \(D=8\) independent donors, \(\sigma^2=9\) expression-units squared, and \(\rho=0.05\). Calculate the variance when \(m=20\), compare it with the independence variance, and find the limiting variance as \(m\) increases without bound while \(D\) remains fixed.

For \(m=20\), the design effect and variance are:

$$ \operatorname{DE}=1+(20-1)(0.05)=1.95, \qquad \operatorname{Var}(\bar{Y})=\frac{9}{8(20)}(1.95)=0.1097\ \text{expression-units}^2. $$

The independence variance for 160 cells would be \(9/160=0.05625\) expression-units squared, so the clustered variance is 1.95 times that benchmark. From the rearranged formula, as \(m\) grows, the term \((1-\rho)/m\) approaches zero. The limiting variance is therefore:

$$ \lim_{m\to\infty}\operatorname{Var}(\bar{Y}) =\frac{\sigma^2\rho}{D} =\frac{9(0.05)}{8} =0.05625\ \text{expression-units}^2. $$

The limit is a mathematical consequence of holding the number of donors and the correlation structure fixed. It illustrates diminishing variance reduction from taking increasingly many cells within the same donors; it is not a recommendation to sample any particular number of cells.

What the Formula Depends On

For nonnegative \(\rho\), the design effect is at least 1. If \(\rho=0\), observations within a donor are uncorrelated and \(\operatorname{DE}=1\), so this particular variance inflation disappears. If \(\rho>0\), increasing either \(m\) or \(\rho\) increases the design effect: increasing \(m\) adds more correlated pairs within each cluster, and increasing \(\rho\) makes each such pair contribute more covariance. When \(m=1\), there are no within-cluster pairs, so \(\operatorname{DE}=1\) for any \(\rho\).

A negative \(\rho\) can mathematically produce a design effect below 1, but it is constrained by the requirement that the covariance matrix be valid. For an equal-size exchangeable cluster, that lower bound is \(\rho\geq-1/(m-1)\) when \(m>1\). The familiar interpretation of design effect as an inflation factor generally concerns nonnegative within-donor correlation, as is common when cells share donor-level influences.

The assumptions matter as much as the algebra. If donors are not independent, the cluster totals have covariance terms that the derivation omits. If cells have different variances or their within-donor correlations vary substantially, one common \(\sigma^2\) and \(\rho\) do not describe the covariance structure. If donor sizes differ, the equal-size formula does not generally give the variance of the cell-weighted mean. These situations call for an analysis that represents the actual sampling and covariance structure, rather than mechanical use of \(1+(m-1)\rho\).

Diagnostics, Alternatives, and Common Pitfalls

The design effect is a model-based summary, not something guaranteed by the number of cells alone. In practice, assess whether the assumed clustering is plausible by examining within-donor similarity after accounting for relevant covariates and comparing it with between-donor variation. A random-intercept or other covariance model can represent shared donor-level variation; a marginal approach can instead specify a working within-donor correlation structure. Such methods can address richer designs, but their validity depends on their own assumptions and on how uncertainty in estimated covariance parameters is handled.

For a simple equal-size setting, the design-effect calculation is a useful benchmark for understanding the cost of correlation. It does not by itself select an estimand, account for a treatment allocation scheme, or determine the degrees of freedom for a test. In particular, applying the multiplier to a standard error is incorrect: the variance is multiplied by \(\operatorname{DE}\), while the standard error is multiplied by its square root.

  • Ignoring shared correlation. The wrong reasoning is that 100 cells provide 100 independent pieces of information just because 100 expression values were recorded. The correction is that cells from the same donor may have nonzero covariance; under this model, that covariance enters the variance through the within-cluster pairs.
  • Multiplying the standard error by the design effect. The wrong calculation is \(SE_{\text{clustered}}=\operatorname{DE}\,SE_{\text{independent}}\). The correct calculation is \(SE_{\text{clustered}}=\sqrt{\operatorname{DE}}\,SE_{\text{independent}}\).
  • Applying the equal-size formula to unequal clusters without checking. The wrong reasoning is that an average cell count can simply replace \(m\). Unequal sizes change how many correlated pairs contribute to the variance, so the derivation no longer applies as written.
  • Treating the design effect as a causal quantity. The wrong interpretation is that a larger design effect causes gene expression to change. It describes how a specified covariance structure changes variance relative to an independence benchmark; it is not an effect on the expression mean.

The central comparison is between an independence calculation and a covariance-aware calculation. The former is a reference case with \(\rho=0\); the latter uses the shared within-cluster covariance. Donor-level summaries or mixed and marginal models may be suitable alternatives depending on the target and design, but they answer inferential questions through their own modeling choices. The design effect alone is not a substitute for those choices.

Key takeaway: With \(D\) independent clusters of equal size \(m\), common marginal variance \(\sigma^2\), and common within-cluster correlation \(\rho\), the overall mean has variance \(\sigma^2[1+(m-1)\rho]/(Dm)\). The multiplier applies to variance; its square root applies to standard error. The result relies on the stated covariance structure and equal cluster sizes.

Check Your Understanding

Work each problem using the equal-size cluster assumptions unless a question asks you to identify why they fail. Solutions are included below.

  1. There are 15 donors with 6 cells each and within-donor correlation \(\rho=0.12\). What is the design effect?
  2. If the independence standard error is 0.20 expression units and the design effect is 2.25, what is the clustered standard error?
  3. With \(D=10\), \(m=5\), \(\sigma^2=4\) expression-units squared, and \(\rho=0.10\), calculate the variance of the overall mean.
  4. What happens to the design effect when \(\rho=0\), and why?
  5. A study has donor cluster sizes of 3, 5, and 12 cells. Can \(1+(m-1)\rho\) be used exactly by substituting the average cluster size? Explain.

Solutions. (1) \(\operatorname{DE}=1+(6-1)(0.12)=1.60\). (2) Standard error is multiplied by the square root: \(0.20\sqrt{2.25}=0.20(1.5)=0.300\) expression units. (3) \(\operatorname{DE}=1+(5-1)(0.10)=1.40\), so \(\operatorname{Var}(\bar{Y})=(4/50)(1.40)=0.1120\) expression-units squared. (4) The design effect is 1 because the within-cluster covariance is zero, so the variance matches the independence benchmark under the other assumptions. (5) No. The derivation counts within-cluster pairs for one common size \(m\); unequal sizes contribute different numbers of pairs, so substituting the average size is not generally exact.

Clinical Biostats