Why the Independent-Group Model Is Different
In a two-condition study with independent donors, each donor contributes a pseudobulk count profile for the cell type being analyzed. The scientific comparison is between donor groups, not between individual cells: cells from the same donor share biological and technical features, so treating them as independent replicates would overstate the information in the data. The independent-group analysis therefore models one count per donor, gene, and condition.
For a gene, the response \(Y_i\) is the summed count for donor \(i\). The library size, or an effective library size that includes a normalization factor, accounts for differences in sequencing exposure. A condition coefficient then describes the difference in expected normalized expression between the two donor groups. It is an association between condition group and expression; by itself it does not establish a causal effect.
Model, Assumptions, and the Contrast
A standard gene-wise model is negative binomial (NB). Use the parameterization in which the conditional mean is \(\mu_i\) and the variance is \(\mu_i+\phi\mu_i^2\), where \(\phi\) is the dispersion. This allows the variance to exceed the mean, as is common for biological count data. Let \(x_i=0\) for the reference condition and \(x_i=1\) for the other condition.
The term \(\log(E_i)\) is an offset: its coefficient is fixed at one rather than estimated. The condition coefficient \(\beta_1\) is the log ratio of expected expression per unit of effective library size in the second condition relative to the reference, under this model. Thus \(\exp(\beta_1)\) is the normalized expression ratio, and \(100\{\exp(\beta_1)-1\}\%\) is the corresponding percent difference.
The comparison is usually framed as \(H_0:\beta_1=0\) against \(H_a:\beta_1\ne 0\). A prespecified one-sided alternative is possible when scientifically justified, but the direction must not be selected after inspecting the result. The contrast is \(c^\mathsf{T}\beta\), where \(\beta=(\beta_0,\beta_1)^\mathsf{T}\) and, for this comparison, \(c=(0,1)^\mathsf{T}\). Its estimated standard error is \(\sqrt{c^\mathsf{T}\widehat{\operatorname{Cov}}(\hat\beta)c}\). A Wald statistic divides the estimated contrast by that standard error and is compared with a standard normal reference distribution in a large-sample analysis.
The model relies on independent donors, a suitable log-linear mean structure, correctly specified exposures, and an adequate NB variance model. Counts are conditionally independent across donors given the model covariates; within-donor cells have already been aggregated and are not counted as independent replicates. The condition groups must not be confounded with unmodeled factors that explain the expression difference. Dispersion must be estimable or stabilized appropriately for the available donor count. With a small number of donors, asymptotic Wald p-values can be poorly calibrated; the earlier material on pseudobulk inference with few donors and calibration of gene-level test statistics is relevant to that limitation.
Estimation and a Short Justification of the Standard Error
The mean model and dispersion are fitted for each gene. In a simple method-of-moments illustration, a group-specific dispersion estimate is \((s^2-\bar{Y})/\bar{Y}^2\), where \(\bar{Y}\) and \(s^2\) are the group sample mean and sample variance. A negative value is incompatible with a nonnegative NB dispersion and is truncated at zero in this simple estimator. Production analyses generally estimate dispersion using a likelihood-based procedure, often stabilizing gene-wise estimates across genes; the moment calculation is useful for understanding what dispersion represents.
A useful large-sample approximation for the variance of a log group mean under the NB model follows directly from the variance function. For \(n_g\) independent donors in group \(g\), the variance of the sample mean is approximately \((\mu_g+\phi\mu_g^2)/n_g\). Applying the delta method to the logarithm gives:
For equal exposures and independent groups, the approximate variance of the log mean ratio is the sum of the group variances, so its standard error is the square root of that sum. With unequal exposures, the GLM uses the offsets when fitting the coefficient and its covariance; the calculation should not be replaced by a raw count ratio. This approximation is an explanatory calculation, not a substitute for the fitted GLM covariance in a general design.
Worked Example: A Two-Fold Difference With Equal Library Sizes
Suppose six hypothetical donors provide pseudobulk counts for one gene, with three independent donors per condition. Effective library sizes are equal. The reference-group counts are 80, 100, and 120; the second-group counts are 160, 200, and 240. Assume the NB model is adequate and use a simple group-moment dispersion estimate for illustration.
The group means are \(\bar{Y}_0=(80+100+120)/3=100\) and \(\bar{Y}_1=(160+200+240)/3=200\). The sample variances are \(s_0^2=400\) and \(s_1^2=1600\). The moment estimates are \(\hat\phi_0=(400-100)/100^2=0.0300\) and \(\hat\phi_1=(1600-200)/200^2=0.0350\). Their average, \(\hat\phi=0.0325\), is a simple common-dispersion estimate for this hand calculation.
With equal exposures, the estimated contrast is \(\hat\beta_1=\log(200/100)=\log(2)=0.6931\). The approximate standard error is:
The Wald statistic is \(z=0.6931/0.1633=4.24\), giving a two-sided normal-approximation p-value of about \(2.2\times10^{-5}\). A 95% confidence interval for the log ratio is \(0.6931\pm1.96(0.1633)=[0.373,1.013]\). Exponentiating gives an estimated normalized expression ratio of 2.00, with interval \([\exp(0.373),\exp(1.013)]=[1.452,2.754]\). Under the model and approximation, the data provide evidence that expression is higher in the second group; the interval is for the normalized ratio, not an interval for a probability.
The hand-calculated dispersion is deliberately simple. With these few donors it is unstable, and a fitted gene-wise NB model may use likelihood estimation and information from other genes. The worked arithmetic illustrates the role of dispersion and the contrast; it does not imply that averaging group moment estimates is the universal fitting procedure.
Worked Example: Why the Library-Size Offset Matters
Consider another hypothetical gene. Two reference donors have counts 80 and 100, each with effective library size 10,000. Two independent donors in the second condition have counts 160 and 200, each with effective library size 20,000. The raw count means are 90 and 180, but the second group also has twice the effective exposure.
The normalized rates are \(90/10{,}000=0.00900\) and \(180/20{,}000=0.00900\). Equivalently, the offset model compares \(\log(\bar{Y}_1/\bar{Y}_0)-\log(20{,}000/10{,}000)=\log(2)-\log(2)=0\). Thus \(\hat\beta_1=0\), and the estimated normalized expression ratio is \(\exp(0)=1.00\). A raw count comparison alone would misleadingly suggest a two-fold difference.
For illustration, the group sample variances are 200 and 800. The moment dispersion estimates are \((200-90)/90^2=0.01358\) and \((800-180)/180^2=0.01914\), with average \(\hat\phi=0.01636\). Using the approximate independent-group standard error:
The Wald statistic is \(0/0.1571=0\), so the two-sided p-value is 1.00. The estimated contrast is zero, but this does not prove the conditions are identical: the approximate 95% interval on the log scale is \(0\pm1.96(0.1571)=[-0.308,0.308]\), corresponding to a normalized ratio interval of approximately \([0.735,1.361]\). The offsets change the comparison from raw counts to expression per effective library exposure.
Defining and Reporting the Contrast
The contrast must match the scientific comparison and coding of the design. With reference coding, \(x_i=0\) for the reference and \(x_i=1\) for the second group, the contrast vector \((0,1)^\mathsf{T}\) selects the condition coefficient. Reversing the reference level changes the coefficient's sign and reciprocates its expression ratio, but it does not change the underlying comparison or a two-sided test.
A design may include prespecified nuisance covariates, such as a technical batch variable, when those covariates are estimable and not perfectly confounded with condition. In that case, \(\beta\) contains additional coefficients, but the condition comparison remains a specific linear contrast \(c^\mathsf{T}\beta\). Its variance must use the fitted coefficient covariance, including any covariance terms. The coefficient should not be interpreted in isolation if the contrast is not simply one coefficient.
Worked Example: Reversing the Reference Group
Suppose a hypothetical fitted model uses the first condition as reference and estimates \(\hat\beta_1=0.4055\) with \(SE=0.08165\). The defined contrast is \(c^\mathsf{T}\beta=\beta_1\), so the estimated normalized ratio for the second condition versus the first is \(\exp(0.4055)=1.500\).
The test statistic is \(z=0.4055/0.08165=4.97\), with a two-sided standard normal p-value of approximately \(6.7\times10^{-7}\). The log-scale 95% interval is \(0.4055\pm1.96(0.08165)=[0.2455,0.5655]\); exponentiation gives a ratio interval of approximately \([1.278,1.760]\).
If the reference is reversed, the contrast is \(-\beta_1\): its estimate is \(-0.4055\), its standard error remains \(0.08165\), and its ratio is \(\exp(-0.4055)=0.6667\). This is the first condition relative to the second. The absolute Wald statistic and two-sided p-value are unchanged; only the direction and ratio orientation differ.
Diagnostics, Alternatives, and Limitations
A defensible result requires checking whether the model's ingredients fit the data. Review donor-level sample identity, condition labels, cell-type definitions, and effective library sizes before interpreting coefficients. Examine fitted means and residual behavior across donors; a single influential donor can have a large effect when replication is limited. Check whether the observed mean-variance relationship is compatible with the fitted dispersions and whether there are extreme counts or excess zeros that the model does not capture. These checks complement, rather than replace, a valid design.
Warning signs include an estimated dispersion at a boundary for many genes, a few donors dominating the condition difference, systematic residual patterns, unstable estimates under small changes in normalization, or condition being completely aligned with batch. A model cannot recover a condition effect separately from a perfectly confounded batch effect. Likewise, offset adjustment cannot correct a misspecified cell type, poor sample annotation, or a lack of independent donors. When these failures occur, the correct response is to investigate the data and design, not simply to report a smaller p-value from another fitting option.
The paired pseudobulk approach is appropriate when the same donors are measured under both conditions; it uses within-donor comparisons and is not interchangeable with an independent-group model. A cell-level mixed model can represent cell-level observations and donor dependence directly, but has different assumptions and computational requirements. Treating all cells as independent is not a valid alternative. A Gaussian analysis of transformed or normalized expression may be useful under its own assumptions, but it does not retain the NB count mean-variance model and offset structure described here.
Finally, a small donor count limits precision and can make dispersion and Wald approximations unreliable even when there are many cells per donor. The effective replication for the condition comparison is the number of donors, not the number of cells. For genome-wide testing, per-gene p-values also require appropriate multiplicity control; a small unadjusted p-value alone is not a claim that a gene is differentially expressed with that probability.
Check Your Understanding
Try each problem, then compare your reasoning with the brief solutions.
- A study has four distinct donors in each of two conditions, with one pseudobulk profile per donor. What is the independent unit, and why are the cells not the replicate count?
- For a gene, the fitted condition coefficient is \(\hat\beta_1=0.20\). What is the estimated normalized expression ratio for the second condition relative to the reference?
- Two groups have mean counts 120 and 180, but their effective library sizes are 12,000 and 18,000. What is the offset-adjusted log ratio of the group rates?
- In the NB parameterization used here, what does \(\phi=0\) imply about the variance, and what happens as positive dispersion increases?
Solutions. (1) The donor is the independent unit: cells from one donor share donor-level features, so they do not provide independent replication. There are four donor replicates per group. (2) The ratio is \(\exp(0.20)=1.221\), about 22.1% higher normalized expression in the second condition. (3) The rates are \(120/12{,}000=0.0100\) and \(180/18{,}000=0.0100\), so the log ratio is \(\log(0.0100/0.0100)=0\). (4) At \(\phi=0\), the variance is \(\mu\), the Poisson variance; for positive \(\phi\), \(\mu+\phi\mu^2\) exceeds the mean, with the excess increasing as dispersion increases.