Why Put a Size Factor in the Model?
A count from a cell with greater sequencing depth may be larger even when its underlying relative expression is the same. Earlier material on library size factors and their estimation motivates representing this depth difference by a positive factor \(s_i\) for cell \(i\). The modeling question is how to adjust for that factor while retaining the original integer counts as the response.
An offset does this on the model’s linear-predictor scale. In a log-link count model, multiplying the expected count by \(s_i\) is equivalent to adding \(\log(s_i)\) to the linear predictor. The factor is supplied to the model with its coefficient fixed at one. The model estimates biological or design effects in addition to this specified exposure adjustment.
The key assumption encoded by this form is multiplicative: for the same modeled biological profile, a cell with size factor twice as large has twice the expected count. The factor is treated as known when fitting this model, even though in practice it was estimated from data. The model also requires an appropriate conditional count distribution and mean structure; an offset cannot repair a poor distributional fit, unmodeled design structure, or unreliable size factors.
Poisson and Negative-Binomial Models with Offsets
Under a Poisson model, the count conditional on the predictors and size factor has mean \(\mu_{gi}\) and variance \(\mu_{gi}\):
This model assumes conditionally independent observations for the likelihood being fitted, as well as the stated mean and Poisson variance. In single-cell data, extra variation beyond the Poisson variance is often important. A common alternative retains the same offset and mean but uses a negative-binomial distribution. With dispersion \(\alpha_g\geq 0\), its variance is \(\mu_{gi}+\alpha_g\mu_{gi}^2\). Thus the offset specifies the mean adjustment; it does not determine the distribution’s dispersion.
Both models keep \(Y_{gi}\), the observed count, as the response. In contrast, dividing \(Y_{gi}\) by \(s_i\) creates an adjusted value, which is generally not an integer count with the original Poisson or negative-binomial sampling distribution. Such values can be useful for summaries or other analyses, but they are not the response used in this count likelihood.
Worked Example: Fitted Means at Different Size Factors
Suppose a hypothetical gene has a fitted baseline rate of \(2\) counts per unit of size factor, with no additional predictors. For two cells, let \(s_1=0.5\) and \(s_2=1.5\). Under the offset model, \(\exp(\beta_{g0})=2\).
The expected counts are $$ \mu_{g1}=0.5(2)=1,\qquad \mu_{g2}=1.5(2)=3. $$ The second cell has three times the expected count because its size factor is three times as large, not because the model assigns it a higher baseline rate. Dividing the observed counts by their factors would instead produce adjusted values; it would not change the count likelihood or the fitted-mean calculation above.
What the Offset Fixes—and What the Coefficients Mean
For a binary condition indicator \(x_i\), an additive model without condition interactions can be written as
At a fixed size factor, changing \(x_i\) from 0 to 1 changes the log expected count by \(\beta_{g1}\). Exponentiating gives the ratio of expected counts: \(\exp(\beta_{g1})\). This interpretation is conditional on the model’s other predictors being held fixed and, specifically, assumes there is no interaction between condition and those predictors. If the model includes an interaction, the condition contrast must be evaluated at the specified value of the interacting predictor. For example, with \(\gamma x_i z_i\), the condition log ratio at \(z_i\) is \(\beta_{g1}+\gamma z_i\), not just \(\beta_{g1}\).
The fixed offset differs from estimating a coefficient for \(\log(s_i)\). An estimated coefficient would allow the data to determine how strongly the size factor relates to the mean. An offset instead imposes the multiplicative exposure assumption: increasing \(s_i\) by a factor \(c\) multiplies the expected count by \(c\), all else equal. This is a modeling choice, not a consequence of using a log link alone.
Worked Example: Estimating a Condition Rate Ratio
Consider hypothetical Poisson data for one gene. In the control group, three cells have size factors \(1,2,1\) and counts \(3,5,4\). In the treated group, the factors are \(1,1,2\) and the counts are \(4,3,9\). Fit the additive model \(\log(\mu_i)=\log(s_i)+\beta_0+\beta_1x_i\), where \(x_i=0\) for control and \(x_i=1\) for treated.
Within a group with rate \(r=\exp(\beta_0+\beta_1x)\), the mean for cell \(i\) is \(s_i r\). For independent Poisson counts, the part of the log likelihood involving \(r\) is \(Y_{\cdot}\log(r)-rS\), where \(Y_{\cdot}\) is the group’s total count and \(S\) is the sum of its size factors. Differentiating gives \(Y_{\cdot}/r-S=0\), so the maximum-likelihood rate is \(Y_{\cdot}/S\).
For controls, the total count is \(3+5+4=12\), and the factors sum to \(1+2+1=4\). Thus \(\widehat{\exp(\beta_0)}=12/4=3\). For treated cells, the count total is \(4+3+9=16\), and the factors also sum to \(4\), giving a treated rate of \(16/4=4\). Therefore, $$ \widehat{\beta_1}=\log(4)-\log(3)=\log(4/3)\approx 0.2877, \qquad \exp(\widehat{\beta_1})=4/3\approx 1.333. $$ Under this hypothetical model, the treated group’s expected count is estimated to be 1.333 times the control group’s at the same size factor. This is a model-based association, not a causal conclusion. The calculation assumes the Poisson mean model and independent observations; if counts are overdispersed, a negative-binomial model may be more appropriate for uncertainty quantification.
A Short Justification of the Offset Form
The offset follows directly from the assumed multiplicative mean. Suppose that, after accounting for the modeled predictors, the expected count is proportional to the cell’s size factor, with proportionality \(r_{gi}=\exp(\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}_g)\). Then \(\mu_{gi}=s_i r_{gi}\). Taking logs gives
This shows why the coefficient of \(\log(s_i)\) is one: it is the log-scale representation of multiplication by \(s_i\), not a parameter estimated from the gene’s counts. If the size factors are all multiplied by a common constant \(c>0\), the same fitted means can be represented by shifting the intercept:
Thus a common rescaling changes the intercept’s numerical value but not the fitted means or condition contrasts in this model. The scale of the factors matters for the intercept’s interpretation; their relative values determine the cell-to-cell exposure correction.
Worked Example: Negative-Binomial Mean and Variance
Suppose a hypothetical negative-binomial model has \(s_i=1.5\), baseline rate \(\exp(\beta_{g0})=2\), condition coefficient \(\beta_{g1}=0.4\), and dispersion \(\alpha_g=0.2\). The cell is in the condition group, so \(x_i=1\).
The fitted mean is $$ \widehat{\mu}_{gi}=1.5\exp(0.4)(2) =3\exp(0.4)\approx 4.475. $$ The condition rate ratio is \(\exp(0.4)\approx1.492\), and the expected count at this cell’s size factor is approximately \(4.475\). The model variance is $$ \operatorname{Var}(Y_{gi}\mid\mathbf{x}_i,s_i) =4.475+0.2(4.475)^2 \approx 4.475+4.005 =8.480. $$ The variance exceeds the mean because the negative-binomial dispersion is positive. The offset determines the mean’s size-factor contribution; the dispersion determines how much extra conditional variability the model allows.
Diagnostics, Alternatives, and Limitations
A well-formed offset model should be checked as a whole. The following issues are particularly relevant:
- Mean structure: Check whether fitted means track observed counts across cells and whether residual patterns remain by condition, batch, or depth. A systematic residual trend with size factor can indicate that the assumed proportional depth effect or the mean model is inadequate.
- Count variation: Compare observed variation with what the chosen distribution allows. If the Poisson model’s variance is too small, it can understate uncertainty. A negative-binomial model allows extra variance, but its dispersion and fit still require assessment.
- Factor quality: The model treats \(s_i\) as supplied. Unstable or inappropriate factors can distort fitted means and contrasts; an offset does not correct an unsuitable normalization target.
- Design and dependence: Include relevant predictors and interactions when needed, and account for the sampling structure. Conditional independence is an assumption of the simple likelihood, not a guarantee that multiple cells from the same biological sample are independent experimental replicates.
- Zeros: A zero count is a valid outcome under Poisson and negative-binomial models. A zero alone does not establish that a separate zero-generating process is needed; assess the chosen noise model and its predictive fit.
The main alternative for a quick descriptive comparison is to divide counts by size factors. This gives adjusted values on a common factor scale, but the values may be non-integer and their variability depends on the original count and factor. Fitting a count model with an offset instead preserves the count sampling distribution and estimates effects through its likelihood. Neither approach is universally best for every downstream purpose: the offset approach relies on a count model and a defensible multiplicative exposure correction, while divided values require an analysis appropriate to their transformed scale.
A common mistake is to divide the counts by \(s_i\) and then treat the resulting values as if they were original Poisson counts. For example, if \(Y_i=7\) and \(s_i=2\), the adjusted value \(3.5\) is not an integer Poisson observation with mean \(E(Y_i)/s_i\). The correction is to retain \(Y_i\) as the response when using a Poisson or negative-binomial likelihood, and include \(\log(s_i)\) as a fixed offset. Use divided values only when the subsequent method and interpretation are defined for those adjusted values.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A Poisson model has \(\log(\mu_i)=\log(s_i)+\beta_0+\beta_1x_i\), with no interactions. What is the expected-count ratio for \(x_i=1\) versus \(x_i=0\) at the same size factor?
- For a negative-binomial model with \(\mu=5\) and \(\alpha=0.1\), calculate the conditional variance.
- Why is the coefficient of \(\log(s_i)\) fixed at one in an offset model?
- If a model includes \(\beta_1x_i+\gamma x_i z_i\), what is the condition log ratio at a specified value \(z_i=z\)?
Solutions. (1) The log ratio is \(\beta_1\), so the expected-count ratio is \(\exp(\beta_1)\). (2) The variance is \(5+0.1(5)^2=7.5\). (3) The model assumes the mean is multiplied by \(s_i\); taking logs adds \(\log(s_i)\) with coefficient one. (4) The log ratio is \(\beta_1+\gamma z\), and the expected-count ratio is \(\exp(\beta_1+\gamma z)\).