Why assess donor influence?
A pseudobulk analysis uses biological samples, rather than individual cells, as the units contributing to inference. A coefficient can therefore depend strongly on one donor, especially when the number of donors is small, the design is unbalanced, or a donor has an unusual combination of covariates. Influence diagnostics ask a specific question: how much would the fitted coefficient change if this donor's data were not included?
Two related checks help answer it. Leverage describes how unusual a sample's design position is relative to the other samples and the fitted model. A leave-one-donor-out (LODO) comparison directly compares the full-data estimate with the estimate after removing that donor. Leverage can flag samples worth examining, but a LODO refit measures the resulting change in the coefficient. Neither check, by itself, establishes that a donor is erroneous or should be excluded.
Model and definitions
For a gene, a common pseudobulk count model has sample counts \(Y_i\) with a negative-binomial distribution, conditional on the modeled design, and mean \(\mu_i\). With a log link, its linear predictor can be written \(\log(\mu_i)=o_i+x_i^\top\beta\), where \(o_i\) is a known offset, \(x_i\) is the row of the design matrix for sample \(i\), and \(\beta\) is the coefficient vector. The variance is often represented as \(\operatorname{Var}(Y_i)=\mu_i+\phi\mu_i^2\), with dispersion \(\phi\). The fitted model must have an identifiable design and suitable mean, variance, offset, and dependence structure for its coefficient estimates to be interpretable.
In repeated-sample designs, rows from the same donor are not automatically independent. The model must account for that dependence, for example through an appropriate mixed model or a design-based method. If the target is donor influence, remove all rows belonging to a donor together, not just one visit, unless the question is specifically about the influence of a single visit.
In a negative-binomial generalized linear model, working weights depend on the fitted mean and variance. For a log link, one common form is \(w_i=\mu_i/(1+\phi\mu_i)\). Thus a working leverage depends on both the design and the fitted model. It is a local diagnostic at the fitted solution, not generally an exact description of what happens after the model is fully refitted without that sample.
Exact deletion in weighted least squares
A useful derivation clarifies both the meaning and the limits of the leverage calculation. Suppose the model is weighted least squares with fixed positive weights, full-rank \(X\), and response vector \(y\). Its fitted coefficient is \(\hat\beta=A^{-1}X^\top Wy\). Let \(e_i=y_i-x_i^\top\hat\beta\) be the ordinary residual for row \(i\). After removing that row, the normal-equation matrix is \(A_{(-i)}=A-w_i x_i x_i^\top\). The deletion estimate exists only if \(A_{(-i)}\) is invertible.
To see the identity, the full-data normal equations give \(X^\top Wy=A\hat\beta\). The normal equations after deletion therefore have right-hand side \(A\hat\beta-x_iw_i y_i\). Substituting \(\hat\beta_{(-i)}=\hat\beta-d\) into those equations yields $$ (A-w_i x_i x_i^\top)d=x_iw_i(y_i-x_i^\top\hat\beta)=x_iw_i e_i. $$ For the invertible rank-one update, direct multiplication verifies $$ (A-w_i x_i x_i^\top)^{-1}x_i = \frac{A^{-1}x_i}{1-w_i x_i^\top A^{-1}x_i} = \frac{A^{-1}x_i}{1-h_{ii}}. $$ The denominator must be positive: \(A\) is positive definite, and the rank-one update remains positive definite precisely when \(1-h_{ii}>0\). Combining these equations gives the stated result. If \(h_{ii}=1\), the formula divides by zero because deletion has made the fit unidentifiable; it does not give a very large but valid deletion estimate.
Worked Example: A One-Row Deletion With an Identifiable Fit
Suppose a hypothetical weighted least-squares model has an intercept only, equal weights \(w_i=1\), and three donor-level responses \(2, 3,\) and \(7\) in arbitrary normalized-expression units. The design rows are all \(x_i=1\). The full-data estimate is the mean: $$ \hat\beta=\frac{2+3+7}{3}=4. $$
For the donor with response \(7\), \(A=X^\top X=3\), so \(A^{-1}=1/3\). Its leverage and residual are $$ h_{ii}=1\left(1\right)\left(\frac{1}{3}\right)(1)=\frac{1}{3}, \qquad e_i=7-4=3. $$ Deleting this row leaves two observations and an identifiable intercept-only model; indeed, \(A_{(-i)}=2>0\) and \(1-h_{ii}=2/3>0\). Therefore $$ \hat\beta-\hat\beta_{(-i)} = \frac{(1/3)(1)(3)}{2/3} =1.5. $$ Thus \(\hat\beta_{(-i)}=4-1.5=2.5\), which agrees with the remaining-data mean \((2+3)/2=2.5\). The donor affects the estimate because its response is far from the fitted mean, not because it has high leverage: all three leverages are \(1/3\).
Leave-one-donor-out comparisons
For a target coefficient, fit the prespecified model to all eligible donors and record the estimate \(\hat\beta_j\). Then, for each donor \(d\), remove all rows for that donor, refit the same model, and record \(\hat\beta_{j,(-d)}\). A simple signed influence summary is $$ \Delta_{j,d}=\hat\beta_j-\hat\beta_{j,(-d)}. $$ The sign shows the direction in which the full-data estimate differs from the deletion estimate; the magnitude is in the coefficient's units. For a log-link model, a coefficient contrast is commonly on the log-fold-change scale, so exponentiating it gives a fold-change scale. State which scale is being compared.
A fair comparison keeps the outcome definition, design terms, contrast, offsets, and fitting rules fixed. If the model is a generalized linear or mixed model, refit it after each deletion, including any model parameters that are ordinarily estimated. The exact weighted least-squares identity above does not replace this refit: in a generalized linear model, fitted means and working weights can change after deletion; in a mixed model, variance components can change as well.
Worked Example: How One Donor Changes a Group Contrast
Consider hypothetical transformed pseudobulk expression measurements from three independent control donors, \(1,2,3\), and three independent treated donors, \(3,4,10\), in normalized log-expression units. For illustration, use a Gaussian model with group-specific means, equal variance, and independent donor errors. The treatment coefficient is the treated mean minus the control mean. These assumptions make the group-mean calculation appropriate for this example; they are not a claim that a Gaussian model is suitable for every count analysis.
The full-data control mean is \((1+2+3)/3=2\), and the treated mean is \((3+4+10)/3=17/3\). Hence the treatment coefficient is $$ \hat\beta_{\mathrm{treat}}=\frac{17}{3}-2=\frac{11}{3}=3.667 $$ normalized log-expression units.
Now remove the treated donor with value \(10\). The remaining treated mean is \((3+4)/2=3.5\), while the control mean remains \(2\). The LODO treatment coefficient is \(3.5-2=1.5\), so $$ \Delta_{\mathrm{treat},d}=\frac{11}{3}-1.5=\frac{13}{6}=2.167 $$ normalized log-expression units. The full-data treatment contrast is therefore substantially larger than the contrast without this donor. This flags sensitivity; it does not prove the donor is invalid or establish that the deletion estimate is preferable.
For comparison, deleting the treated donor with value \(3\) leaves a treated mean of \((4+10)/2=7\) and a contrast of \(7-2=5\), giving \(\Delta=11/3-5=-4/3=-1.333\). The signed changes show that the two deletions move the contrast in opposite directions.
Donor-level leverage and multiple rows
In a design with one row per donor, inspect leverage alongside the LODO coefficient changes. A high-leverage donor occupies a comparatively unusual or well-weighted position in the design. It may be influential if it also has a response pattern that pulls the fitted coefficient. Conversely, a large residual in a low-leverage sample can have limited effect on the coefficient. For a generalized linear model, use working leverage to prioritize checks, then rely on refits to quantify the actual change.
When a donor contributes multiple rows, a single diagonal entry is not a donor-level summary. Let \(X_d\) and \(W_d\) be that donor's design and weight blocks. The corresponding weighted hat-matrix block is $$ H_d=W_d^{1/2}X_d(X^\top W X)^{-1}X_d^\top W_d^{1/2}. $$ The deletion normal-equation matrix is \(A-X_d^\top W_dX_d\). The donor-block deletion is identifiable only when this matrix is invertible; equivalently, \(I-H_d\) is invertible with positive eigenvalues. If it is not, the design after removing that donor cannot estimate all model coefficients. In practice, compute the LODO refit as a direct check rather than relying on a block formula alone.
Worked Example: Leverage in an Unequal-Weight Two-Group Fit
Suppose the working weighted least-squares design has an intercept and a treatment indicator, with three control donors and three treated donors. In this group-means parameterization, each control row is \((1,0)\), each treated row is \((1,1)\), and the working weights are \(1,2,1\) for controls and \(1,1,8\) for treated donors. These are hypothetical fitted working weights, not cell counts.
Because the model fits a separate weighted mean in each group, a donor's leverage is its weight divided by the total weight in its group. The control leverages are \(1/4,2/4,1/4\), and the treated leverages are \(1/10,1/10,8/10\). They sum to \(1\) in each group, or \(2\) overall, matching the two fitted coefficients. The treated donor with weight \(8\) has leverage \(0.8\), so its design contribution deserves attention; the remaining treated donors still ensure that deleting it leaves the treatment-group mean estimable.
For a concrete working-response calculation, take control responses \(0,0,0\) and treated responses \(1,1,3\). The weighted treated mean is $$ \frac{1(1)+1(1)+8(3)}{1+1+8}=\frac{26}{10}=2.6, $$ and the control mean is \(0\), so the fitted treatment contrast is \(2.6\). After removing the high-weight treated donor, the treated mean is \((1+1)/2=1\), and the contrast is \(1\). The coefficient changes by \(2.6-1=1.6\). This is an exact weighted least-squares working-data comparison. In a count-model refit, the weights and fitted means may change, so the corresponding LODO estimate must be recomputed from the count model.
Reading diagnostics without overinterpreting them
A useful assessment combines model fit, leverage, and coefficient changes. Review fitted residual diagnostics and the design when a donor has high leverage or a large LODO change. Also check data processing, sample quality, donor labels, offsets, covariates, and whether the model still fits after deletion. A deletion that causes rank deficiency, separation, convergence failure, or a singular fit is itself important: it means the coefficient is not estimable or stable under that reduced design. It is not a valid numerical comparison of two estimates.
There is no universal threshold at which a donor is automatically “influential.” One scale-dependent summary is \(|\Delta_{j,d}|/SE(\hat\beta_j)\), which expresses the coefficient shift in full-fit standard-error units; it is a descriptive stability measure, not a test statistic with a universal reference distribution. For a vector of coefficients, changes can be examined together using the fitted covariance matrix, but the interpretation still depends on the scale and design. With few donors, LODO estimates may be noisy, and deleting one donor can alter residual degrees of freedom or variance estimates sharply.
| Diagnostic | What it indicates | What it does not establish |
|---|---|---|
| High leverage | A sample has an unusual or strongly weighted design position | That its response is erroneous or that it changes the target coefficient substantially |
| Large residual | The observed response differs from the fitted value | That the sample has high leverage or dominates the coefficient |
| Large LODO coefficient change | The estimate is sensitive to inclusion of that donor under the chosen model | That exclusion is justified, or that the model is correctly specified |
| Failed deletion refit | The reduced data may not support the same model or estimand | A finite, interpretable deletion coefficient |
Cook's distance and related influence summaries combine residual size and leverage in linear models, while robust fitting methods change how strongly unusual observations affect estimates. These can be useful alternatives or supplements, but they answer somewhat different questions. For a specific pseudobulk contrast, direct LODO refitting is usually easier to interpret because it reports the change in that coefficient under the actual fitted model. Robust standard errors address uncertainty estimation, not whether one donor is driving a point estimate. No diagnostic substitutes for a defensible design and a correctly specified model.
Common mistakes and limitations
- Calling every high-leverage donor influential. Leverage describes the design; the response and coefficient of interest also matter. Check the LODO estimate.
- Deleting one row when the question concerns a donor. If a donor contributes repeated samples, remove the donor's full block and preserve the dependence structure in the refit.
- Using the one-row formula when deletion destroys identifiability. The formula requires \(A-w_i x_i x_i^\top\) to be invertible and \(1-h_{ii}>0\). Otherwise the deletion estimate is undefined.
- Treating a change as a reason to discard data. Investigate data quality and report sensitivity transparently; do not exclude a valid donor solely because the result changes.
- Assuming a local GLM diagnostic is an exact refit. IRLS leverage uses working weights at the fitted solution. A full LODO refit can change weights, dispersion, or random-effect estimates.
These diagnostics are conditional on the model, design, and preprocessing choices. A small number of donors limits how stable any deletion comparison can be, and a model that is not estimable after a deletion cannot answer the same coefficient question on that reduced data. A large change is evidence of sensitivity, not evidence of causation, an error, or a particular biological mechanism.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In weighted least squares, what condition must hold before using the one-row deletion formula?
- A sample has high leverage but a residual near zero. What does that say about its design position, and what further check is useful?
- A donor has two repeated pseudobulk samples. What should be removed for a donor-level LODO comparison?
- For the full treatment contrast \(3.667\) and the deletion contrast \(1.5\), calculate the signed LODO change and state its units.
Solutions. (1) The deleted normal-equation matrix \(A-w_i x_i x_i^\top\) must be invertible, which in this setting requires \(1-h_{ii}>0\). (2) The sample has an unusual or strongly weighted design position, but its near-zero residual suggests little response discrepancy in the fitted model; directly refit without it to assess coefficient change. (3) Remove both rows for that donor, then refit the same model with the intended within-donor dependence structure. (4) \(\Delta=3.667-1.5=2.167\), in the units of the treatment coefficient, here normalized log-expression units. This positive value means the full-data contrast exceeds the deletion contrast by 2.167 units.