Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Interpreting Random-Effect Variance

Differential Expression With Pseudobulk and Mixed Models · Tutorial 501 of 700

Interpreting Random-Effect Variance

Interpret donor-level variance and covariance estimates on the log-mean and fold-change scales, including what boundary estimates do—and do not—imply for gene-level condition inference.

Advanced 11 min read

What You'll Learn

  • Define donor random-intercept and random-slope variance in a cell-level negative binomial mixed model.
  • Translate log-scale variance estimates into donor-to-donor variability in fitted means and condition ratios.
  • Distinguish a typical donor’s condition ratio from the arithmetic mean of donor-specific ratios.
  • Interpret intercept-slope covariance and recognize when a variance estimate lies on a boundary.
  • Explain how donor heterogeneity affects gene-level condition inference and compare random effects with donor fixed effects.

What Donor-Level Variance Describes

A condition effect in a single-cell model need not be identical for every donor. A random intercept allows donors to differ in their baseline expression, while a random slope allows their condition responses to vary. Interpreting these variance estimates is therefore part of interpreting the gene-level model: they describe how expression or response differs across donors, not how many cells were observed.

Consider gene \(g\), donor \(i\), and cell \(j\). Let \(Y_{gij}\) be the observed count and let \(x_{ij}\) indicate condition, with \(x_{ij}=0\) for the reference condition and \(x_{ij}=1\) for the comparison condition. A common model, with other covariates and a library-size offset omitted from the notation, is

$$ Y_{gij}\mid b_{0ig},b_{1ig}\sim \operatorname{NB}(\mu_{gij},\phi_g),\qquad \log(\mu_{gij})=\text{offset}_{ij}+\beta_{0g}+\beta_{1g}x_{ij}+b_{0ig}+b_{1ig}x_{ij}. $$

Here the conditional negative binomial distribution has mean \(\mu_{gij}\) and variance \(\mu_{gij}+\phi_g\mu_{gij}^2\). The donor effects are assumed to follow a centered bivariate normal distribution:

$$ \begin{pmatrix}b_{0ig}\\b_{1ig}\end{pmatrix} \sim N\!\left( \begin{pmatrix}0\\0\end{pmatrix}, \begin{pmatrix}\tau_{00,g}&\tau_{01,g}\\\tau_{01,g}&\tau_{11,g}\end{pmatrix} \right). $$

This formulation assumes, conditional on the donor effects and modeled covariates, that the cell counts follow the stated negative binomial model and are conditionally independent. It also assumes the donor effects are drawn from the same distribution across donors. The covariance matrix must be positive semidefinite, so its variances are nonnegative and \(\tau_{01,g}^2\leq\tau_{00,g}\tau_{11,g}\). In practice, estimating a donor-level slope requires enough donors with observations informative about both conditions; many cells from only a few donors do not provide the same information as many independent donors.

Definition: \(\tau_{00,g}\) is the between-donor variance in the gene’s random log-scale baseline, and \(\tau_{11,g}\) is the between-donor variance in its random log-scale condition effect. \(\tau_{01,g}\) is the covariance between those two donor deviations. The corresponding random-effect standard deviations are \(\sqrt{\tau_{00,g}}\) and \(\sqrt{\tau_{11,g}}\), measured on the log-mean and log-ratio scales, respectively.

Reading the Estimates on Their Scales

At the reference condition, the donor-specific random contribution to the log mean is \(b_{0ig}\). Its variance is \(\tau_{00,g}\). At the comparison condition, the contribution is \(b_{0ig}+b_{1ig}\); expanding its variance gives

$$ \operatorname{Var}(b_{0ig}+b_{1ig}) =\tau_{00,g}+2\tau_{01,g}+\tau_{11,g}. $$

Thus the intercept-slope covariance matters when comparing how spread out donor expression is between conditions. A positive covariance means donors with higher-than-average baseline effects tend to have higher-than-average condition effects; a negative covariance means the opposite tendency. It does not, by itself, establish a biological mechanism.

For a donor, the log condition ratio is \(\beta_{1g}+b_{1ig}\). Its across-donor variance is \(\tau_{11,g}\). The fixed coefficient \(\beta_{1g}\) is the mean log condition effect under the centered random-effects model. Consequently, \(\exp(\beta_{1g})\) is the condition ratio for a donor whose random slope is zero and, under the stated normal model, the geometric mean of donor-specific condition ratios. It is not generally their arithmetic mean. Since \(b_{1ig}\sim N(0,\tau_{11,g})\), the arithmetic mean ratio is \(\exp(\beta_{1g}+\tau_{11,g}/2)\).

Worked Example: Interpreting Baseline Heterogeneity

Suppose a hypothetical fit for one gene estimates \(\tau_{00,g}=0.36\). The random-intercept standard deviation is

$$ \sqrt{0.36}=0.60 $$

on the log-mean scale. Exponentiating one standard deviation gives \(\exp(0.60)=1.822\). Under the normal random-intercept assumption, roughly 68% of donor random intercepts lie within one standard deviation of zero. Holding the other model terms fixed, those values correspond to baseline multiplicative factors from \(\exp(-0.60)=0.5488\) to \(\exp(0.60)=1.822\), relative to the zero-random-effect baseline. This describes variation in donor baselines; it is not a claim that every donor’s observed count lies in that range, because cell-level count variation remains as well.

Worked Example: Random-Slope Variance and Average Ratios

For a hypothetical gene, suppose \(\beta_{1g}=-0.20\) and \(\tau_{11,g}=0.16\). The random-slope standard deviation is \(\sqrt{0.16}=0.40\) log units. The geometric mean of donor-specific condition ratios, and the ratio for a donor with \(b_{1ig}=0\), is

$$ \exp(-0.20)=0.8187. $$

The negative fixed effect therefore corresponds to an approximately 18.1% lower condition ratio for the zero-random-slope donor, since \(1-0.8187=0.1813\). The arithmetic mean of donor-specific ratios is instead

$$ \exp\!\left(-0.20+\frac{0.16}{2}\right) =\exp(-0.12)=0.8869. $$

These differ because exponentiation is nonlinear. The random-slope standard deviation also indicates substantial donor variation in log ratios: one standard deviation above and below the fixed log effect gives ratios \(\exp(-0.20+0.40)=1.221\) and \(\exp(-0.20-0.40)=0.5488\). These are illustrative points on the modeled distribution, not guaranteed bounds for individual donors.

Why the Variance Matters for Condition Inference

The fixed condition coefficient and its uncertainty answer a population-level question under the model; the random-slope variance describes how much donor responses vary around that fixed effect. When \(\tau_{11,g}\) is appreciable, a single common condition response is a poor description of all donors, even if the estimated fixed effect is near zero. Conversely, small estimated slope variance does not prove that every donor has exactly the same response.

A random slope can increase uncertainty about the average condition effect because donor responses differ. The independent units supporting generalization across donors are donors, not the cells within them. Treating cells as independent evidence for a condition effect can therefore make inference too confident. The variance estimate is one part of the fitted model and does not, on its own, determine a p-value or establish whether the fixed effect is statistically significant. That also depends on the fixed-effect estimate, its standard error, the design, and the inferential procedure.

For a paired condition comparison, a donor random intercept accounts for baseline clustering, while a random slope additionally represents donor-to-donor variation in the within-donor contrast. A donor fixed-effects model instead assigns a separate intercept to each donor and does not estimate a population distribution of donor intercepts. It can control for stable donor differences in a paired analysis, but it does not by itself provide a random-slope variance describing a population of donor responses. These approaches answer related but distinct modeling questions.

Worked Example: Intercept-Slope Covariance

Suppose a hypothetical gene has estimates \(\tau_{00,g}=0.25\), \(\tau_{11,g}=0.09\), and \(\tau_{01,g}=-0.06\). The covariance is feasible because

$$ \tau_{01,g}^2=0.0036\leq (0.25)(0.09)=0.0225. $$

At the reference condition, the donor-effect variance is \(0.25\). At the comparison condition it is

$$ 0.25+2(-0.06)+0.09=0.22. $$

The comparison-condition variance is smaller because the negative covariance partially offsets the intercept and slope variances. The slope standard deviation is \(\sqrt{0.09}=0.30\) log units, so the donor-specific log condition effects vary around \(\beta_{1g}\) with that standard deviation. The negative covariance says that higher baseline random effects tend to accompany lower random slopes in this fitted distribution; it does not mean that the average condition effect is negative.

Boundary Estimates, Diagnostics, and Limits

Variance estimates are constrained to be nonnegative. An estimate of zero is therefore a boundary estimate: the fitted model places the corresponding random-effect variance at the edge of its allowable range. If \(\widehat{\tau}_{11,g}=0\), the fit has not found evidence in these data for measurable random-slope variation under this model. It does not demonstrate that the true variation is exactly zero. With few donors, limited condition coverage, or weak information for a particular gene, variance components can be imprecise and may be estimated at the boundary.

When a variance is zero, the associated random-effect correlation is not meaningfully estimated: a correlation divides covariance by the product of standard deviations, and one standard deviation is zero. Very small variance estimates can likewise make a reported correlation unstable. A fitted covariance matrix that is nearly singular, estimates that change substantially under modest model changes, or failure of the model to converge are reasons to be cautious about interpreting its components. These observations flag possible fit limitations; they do not alone identify which alternative model is correct.

Variance-component null hypotheses require care because zero lies on the boundary, so ordinary large-sample tests that assume an interior parameter value may not apply directly. A boundary estimate is not itself a test result. In particular, one should not interpret a zero estimate as proof that a random slope is unnecessary, nor use an ordinary symmetric uncertainty summary without checking whether the method is appropriate for a boundary parameter.

The normal random-effects distribution is a modeling assumption, and gene-specific estimates can be noisy, especially with few donors. A variance summarizes dispersion under that assumed distribution; it does not describe every feature of the donor responses. Random-effect variance estimates should be considered alongside the design, fixed-effect estimate, uncertainty, and fit behavior. They do not establish biological causes of heterogeneity.

Key takeaway: Interpret random-effect variances on the scale where they are defined. The intercept variance describes donor baseline heterogeneity, the slope variance describes donor variation in log condition ratios, and their covariance links these deviations. A boundary estimate is a constrained fit, not proof of no biological variation.

Check Your Understanding

Answer each question using the model and conventions introduced above.

  1. If \(\tau_{11,g}=0.25\), what is the random-slope standard deviation, and what does its unit mean?
  2. With \(\beta_{1g}=0.10\) and \(\tau_{11,g}=0.20\), calculate the geometric mean and arithmetic mean of donor-specific condition ratios.
  3. If \(\tau_{00,g}=0.16\), \(\tau_{11,g}=0.04\), and \(\tau_{01,g}=0.02\), calculate the donor-effect variance at the comparison condition.
  4. What does an estimated random-slope variance of zero establish, and what does it not establish?
  5. Why can a large number of cells from a small number of donors fail to provide strong evidence about between-donor slope variation?

Solutions. (1) The standard deviation is \(\sqrt{0.25}=0.50\) log units of condition ratio; it measures donor-to-donor spread in the random log condition effect. (2) The geometric mean is \(\exp(0.10)=1.105\); the arithmetic mean is \(\exp(0.10+0.20/2)=\exp(0.20)=1.221\). (3) The variance is \(0.16+2(0.02)+0.04=0.24\). (4) It establishes that the fitted estimate is at the nonnegative boundary; it does not prove the true slope variance is zero. (5) Slope variation is variation across donors. Cells within a donor share donor-level effects, so adding cells does not create the same independent information about the donor population as adding donors.

Clinical Biostats