Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Intraclass Correlation in Single-Cell Data

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

Intraclass Correlation in Single-Cell Data

Calculate the intraclass correlation from variance components and interpret what it says about similarity among cells from the same donor.

Advanced 9 min read

What You'll Learn

  • Define the intraclass correlation coefficient for a donor random-intercept model.
  • Calculate the ICC from between-donor and within-donor variances.
  • Interpret the ICC as the correlation of two distinct cells from one donor.
  • Distinguish a variance ratio from incorrect ratios of standard deviations.
  • Recognize assumptions and limitations that affect the meaning of an ICC.

Why Intraclass Correlation Matters

Cells from one donor are not usually independent copies of cells from unrelated donors. They share donor-specific biology and may also share aspects of sample handling or measurement. The intraclass correlation coefficient (ICC) summarizes, on a specified measurement scale, how much cell-level similarity is associated with belonging to the same donor. It is useful for understanding the structure of cell-level variation; by itself, it does not establish a biological cause for that similarity.

The ICC is calculated from variance components, not from a ratio of standard deviations. Its interpretation also depends on the model and the population of cells under consideration. The same gene can have different ICCs in different cell types, conditions, or preprocessing scales because those choices can change the between- and within-donor variation.

Model and Definition

Consider a cell-level measurement \(Y_{ij}\), such as normalized expression of one gene, for cell \(j\) from donor \(i\). Use a random-intercept model:

$$ Y_{ij}=\mu+b_i+e_{ij} $$

Here, \(\mu\) is the overall mean, \(b_i\) is the deviation associated with donor \(i\), and \(e_{ij}\) is the cell-specific deviation. Assume \(E(b_i)=0\), \(\operatorname{Var}(b_i)=\sigma_b^2\), and \(E(e_{ij})=0\), \(\operatorname{Var}(e_{ij})=\sigma_w^2\). For the standard interpretation, donor effects are independent across donors, cell-specific deviations are independent across distinct cells and donors, and \(b_i\) is independent of the \(e_{ij}\). The subscript \(w\) denotes within-donor variation after the donor effect is accounted for.

This model treats cells in the same modeled group as exchangeable: they share the same donor-level variance component and the same within-donor variance component. The components must refer to the same measurement, scale, and target population. The ICC definition does not require that the random effects be normally distributed, although normality is often used for likelihood-based fitting.

Definition: The intraclass correlation coefficient for this random-intercept model is the between-donor variance divided by the total variance of a cell-level measurement: $$ \mathrm{ICC}=\frac{\sigma_b^2}{\sigma_b^2+\sigma_w^2}. $$ It is the correlation between two distinct cells sampled from the same donor under the model.

The two descriptions in the definition agree. The variance of one cell is \(\sigma_b^2+\sigma_w^2\), while the covariance of two distinct cells from the same donor is \(\sigma_b^2\): they share \(b_i\), but their cell-specific deviations are independent. Therefore their correlation is their covariance divided by their common standard deviation squared, giving the stated ratio.

$$ \operatorname{Cov}(Y_{ij},Y_{ik})=\sigma_b^2\quad (j\ne k), \qquad \operatorname{Var}(Y_{ij})=\sigma_b^2+\sigma_w^2, \qquad \operatorname{Corr}(Y_{ij},Y_{ik}) =\frac{\sigma_b^2}{\sigma_b^2+\sigma_w^2}. $$

Calculating and Interpreting the ICC

The calculation uses variances. If a problem gives standard deviations, square each one first. When both variance components are nonnegative, the ICC lies between 0 and 1. An ICC near 0 means that donor membership accounts for little of the total modeled variance; an ICC near 1 means that the within-donor variance is small relative to the between-donor variance. Neither value alone says whether the gene is highly expressed or biologically important.

Worked Example: Converting Standard Deviations to an ICC

Suppose a hypothetical expression measurement has a between-donor standard deviation of \(0.60\) expression units and a within-donor standard deviation of \(1.20\) expression units. Calculate and interpret the ICC.

Check the inputs. The stated quantities are standard deviations, so square them to obtain the variance components:

$$ \sigma_b^2=0.60^2=0.36,\qquad \sigma_w^2=1.20^2=1.44 $$

Calculate the ratio.

$$ \mathrm{ICC} =\frac{0.36}{0.36+1.44} =\frac{0.36}{1.80} =0.200 $$

Under this model, the correlation between two distinct cells from the same donor is \(0.200\). Equivalently, 20.0% of the total modeled cell-level variance is between donors. The remaining 80.0% is within donors, since \(1.44/1.80=0.800\).

A direct standard-deviation ratio is not the ICC: \(0.60/(0.60+1.20)=0.3333\ldots\), which differs from \(0.200\). The variance ratio requires squaring each standard deviation before dividing.

Worked Example: Calculating From Variance Components

For a hypothetical gene within one cell type, suppose the between-donor variance is \(0.25\) squared expression units and the within-donor variance is \(0.75\) squared expression units. Find the ICC and explain its meaning.

The total variance is \(0.25+0.75=1.00\) squared expression units. Thus:

$$ \mathrm{ICC} =\frac{0.25}{0.25+0.75} =\frac{0.25}{1.00} =0.250 $$

The model implies a correlation of \(0.250\) between two distinct cells from the same donor. One quarter of the modeled total variance is between donors; three quarters is within donors. This is a statement about variance decomposition on the specified expression scale, not a claim that one quarter of cells are alike or that a cell has a 25% chance of matching another cell.

Worked Example: A High ICC With Small Within-Donor Variation

Suppose a hypothetical measurement has between-donor variance \(0.80\) squared units and within-donor variance \(0.20\) squared units. Calculate the ICC and the variance proportions.

The total variance is \(0.80+0.20=1.00\) squared units. Therefore:

$$ \mathrm{ICC} =\frac{0.80}{1.00} =0.800 $$

The between-donor share is \(0.80/1.00=0.800\), and the within-donor share is \(0.20/1.00=0.200\). In the random-intercept model, two distinct cells from the same donor have correlation \(0.800\). This indicates strong donor-level clustering on this measurement scale. It does not mean the two cell measurements are identical: the within-donor variance is small, not zero.

Why the Correlation Formula Holds

The interpretation follows directly from the model. Take two distinct cells, \(j\) and \(k\), from donor \(i\). Their measurements are \(Y_{ij}=\mu+b_i+e_{ij}\) and \(Y_{ik}=\mu+b_i+e_{ik}\). Since the constant \(\mu\) has no variance, each cell has variance \(\sigma_b^2+\sigma_w^2\). In their covariance, the shared donor effect contributes \(\operatorname{Var}(b_i)=\sigma_b^2\). The covariance terms involving independent residuals are zero. Dividing that covariance by the product of the cells' standard deviations gives the ICC.

$$ \begin{aligned} \operatorname{Cov}(Y_{ij},Y_{ik}) &=\operatorname{Cov}(b_i+e_{ij},b_i+e_{ik})\\ &=\operatorname{Var}(b_i) +\operatorname{Cov}(b_i,e_{ik}) +\operatorname{Cov}(e_{ij},b_i) +\operatorname{Cov}(e_{ij},e_{ik})\\ &=\sigma_b^2+0+0+0\\ &=\sigma_b^2. \end{aligned} $$

Because the two cells have the same variance, their correlation is \(\sigma_b^2/(\sigma_b^2+\sigma_w^2)\). This derivation relies on the shared donor effect and independent cell-specific deviations. If distinct cells have additional shared dependencies, the covariance can include more than the donor effect, so the simple interpretation may no longer apply.

What the ICC Does and Does Not Measure

The ICC is a relative measure. It can be high because between-donor variation is large, because within-donor variation is small, or both. It does not report either variance component in isolation. For that reason, report or inspect the components as well as the ICC when the magnitudes of variation matter.

The ICC is also tied to the measurement scale and the modeled population. For example, a log-transformed expression measurement has variance components on the log scale; its ICC is not automatically the ICC for raw counts. A cell-type-specific calculation describes cells from that cell type under the model, not an unspecified mixture of cell types. If cell types or conditions are mixed without being accounted for, their differences can change the apparent variance decomposition.

The standard random-intercept ICC describes correlation for two distinct cells from the same donor. It is not the correlation of a cell with itself, which is 1 when the measurement has positive variance. It is not the proportion of donors with a particular expression value, and it is not a causal effect of donor identity.

Assumptions, Diagnostics, and Comparisons

Before interpreting a calculated ICC, check that its inputs match the model:

  • The between- and within-donor components describe the same cell-level outcome, transformation, cell type, and analysis population.
  • Donor effects are the shared source of covariance represented by the random intercept, and cell-specific deviations are independent across distinct cells once that effect is accounted for.
  • The variance components are meaningful and nonnegative for the stated variance decomposition.
  • Any major structure that changes the mean or covariance, such as cell type or condition, has been handled consistently with the intended interpretation.

In practice, examine whether donor-level patterns are plausible: do cells from a donor tend to shift together, or do residual patterns suggest additional structure? Strong residual dependence between cells could mean the model's within-donor component is not simply independent cell-level variation. Conversely, marked differences in means across cell types can inflate or otherwise alter a pooled ICC if cell type is ignored. A calculated ICC is a summary under the assumed model, not a diagnostic that validates the model on its own.

The ICC is different from several nearby quantities. A variance ratio partitions total variance, while a standard-deviation ratio does not. A raw correlation computed from a particular set of cell pairs may depend on how those pairs were selected; the model ICC targets the same-donor correlation under its assumptions. A donor-level summary, such as one mean per donor, describes variation among donor summaries and does not by itself separate within-donor from between-donor variation.

QuantityWhat it summarizesHow it differs from the ICC
ICCBetween-donor variance as a share of total cell-level varianceAlso equals the same-donor correlation for distinct cells under the stated model
Between-donor standard deviationAbsolute spread of donor effects on the measurement scaleDoes not account for within-donor variance
Ratio of standard deviationsA ratio formed from two spreadsNot the variance partition and generally not the same as the ICC
Donor-level summaryA statistic such as a mean or median for each donorDoes not alone describe cell-to-cell correlation within donors

A limitation is that the simple ICC assumes a single shared donor contribution and a common within-donor variance. Different donor-specific responses, multiple nested sources of dependence, or substantial changes in variance across donors require a richer description. Also, an ICC estimated from few donors can be uncertain even when many cells were measured; the number of cells does not replace the number of independent donors. Estimation uncertainty and ways to quantify it are separate from the variance-ratio calculation taught here.

Common Mistake

Common mistake: “The between-donor standard deviation is \(0.60\) and the within-donor standard deviation is \(1.20\), so the ICC is \(0.60/(0.60+1.20)=0.3333\).” This divides spreads rather than variances. The correction is to square each standard deviation first: \(\mathrm{ICC}=0.60^2/(0.60^2+1.20^2)=0.36/1.80=0.200\). The ICC is a variance ratio, not a standard-deviation ratio.

Another interpretive error is to say that an ICC of \(0.20\) means that 20% of cell pairs are similar. It means that, under the model, the same-donor correlation is \(0.20\), and that the between-donor component is 20% of total variance. Similarity in individual pairs is not a binary event.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A hypothetical measurement has between-donor variance \(0.40\) and within-donor variance \(1.60\). What is its ICC?
  2. Two distinct cells are sampled from one donor. Under the random-intercept model, what shared term creates their covariance?
  3. Between- and within-donor standard deviations are \(0.50\) and \(1.00\). Why is \(0.50/(0.50+1.00)\) not the ICC?
  4. What does an ICC of \(0.75\) say, and what does it not say?
  5. Give one reason a pooled ICC across cell types could be misleading.

Solutions. (1) The total variance is \(0.40+1.60=2.00\), so \(\mathrm{ICC}=0.40/2.00=0.200\). (2) The shared donor effect \(b_i\) creates covariance \(\sigma_b^2\); the distinct-cell residuals have zero covariance under the model. (3) Those are standard deviations. Square them: \(0.50^2=0.25\) and \(1.00^2=1.00\), giving \(\mathrm{ICC}=0.25/(0.25+1.00)=0.200\). (4) It says that 75% of modeled total variance is between donors and that distinct same-donor cells have model correlation \(0.75\). It does not mean 75% of cell pairs are identical or that donor identity causes the expression differences. (5) Cell types may have different mean expression or variance components; mixing them without accounting for those differences can change the apparent donor-level and within-donor variation.

Clinical Biostats