Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Adjusting Abundance Tests for Donor Covariates

Differential Abundance and Compositional Effects · Tutorial 538 of 700

Adjusting Abundance Tests for Donor Covariates

Use donor-level covariates to estimate condition effects on cell abundance while checking whether the data can support the adjustment.

Advanced 11 min read

What You'll Learn

  • Specify a donor-level abundance model with condition and donor covariates.
  • Interpret an adjusted condition coefficient as a conditional effect on the model’s abundance scale.
  • Calculate adjusted odds ratios and covariate-specific predicted proportions.
  • Recognize confounding, collinearity, and sparse-group separation.
  • Choose between adjustment, stratification, and an unadjusted comparison.
  • Check whether model assumptions and overlap support the intended interpretation.

Why Adjust for Donor Covariates?

Donors can differ in age, sex, medication use, or other characteristics that are also distributed differently across conditions. A comparison that ignores those differences may attribute a covariate-associated abundance pattern to condition. Adjustment puts condition and selected donor characteristics in the same model, so that the estimated condition contrast compares donors at the same modeled covariate values.

The analysis unit remains the donor, not the individual cell. For a single cell type versus all other cells, a donor contributes a target-cell count and a total-cell count. The denominator defines the abundance being modeled; adjustment does not change that choice. For joint compositions, covariates can enter an appropriate compositional model, as in the earlier material on multinomial regression with sample-level covariates. This tutorial concentrates on how to specify and interpret the covariate-adjusted condition contrast, and on when the available donors cannot identify it reliably.

Definition: A covariate-adjusted condition effect is the condition contrast estimated by a model that includes condition and specified donor-level covariates. In a logistic model for one cell type versus the rest, the condition coefficient is a difference in log odds between conditions at the same values of the included covariates. It is not automatically a causal effect.

A Donor-Level Model and Its Assumptions

Let \(Y_i\) be the number of cells of a target type for donor \(i\), and let \(N_i\) be the total number of cells in the chosen denominator for that donor. Write \(C_i=1\) for one condition and \(C_i=0\) for its reference condition. Let \(A_i\) be age, centered at a useful value, and let \(S_i\) indicate sex. A basic binomial logistic model is

$$ Y_i\mid N_i \sim \operatorname{Binomial}(N_i,p_i), \qquad \operatorname{logit}(p_i)=\beta_0+\beta_1C_i+\beta_2A_i+\beta_3S_i . $$

Here \(\operatorname{logit}(p)=\log\{p/(1-p)\}\), and \(p_i\) is the modeled target-cell proportion for donor \(i\). Centering age makes the intercept correspond to a donor of the reference sex in the reference condition at the centering age. Other covariates can be added when justified by the design and scientific question.

This model assumes independent donors and, conditional on the predictors and \(N_i\), a binomial count with a common probability \(p_i\) among the cells in each donor’s denominator. The binomial variance is \(N_ip_i(1-p_i)\). If donors have extra variation beyond that assumption, a plain binomial fit can produce overly small standard errors; a beta-binomial or another suitable overdispersed model may be more appropriate. A large cell count does not replace independent donor replication.

The predictor form also matters. The displayed model assumes a linear age effect on the log-odds scale and a constant condition effect across age and sex. If condition effects plausibly vary with age, an interaction such as \(C_iA_i\) is needed, and the condition contrast then depends on age. A nonlinear age relationship may require a flexible function rather than a straight line. Each added term uses information and can make estimation less stable, especially with few donors.

Interpretation: In the displayed model, \(\exp(\beta_1)\) is the condition odds ratio at fixed age and sex. It compares the odds \(p_i/(1-p_i)\) for condition \(C_i=1\) with the odds for \(C_i=0\), holding the modeled covariates constant. Because odds ratios are not generally collapsible, this conditional odds ratio need not equal a crude, unadjusted odds ratio even when there is no confounding.

What the Adjustment Estimates

Adjustment is useful only when the data contain comparisons that can support it. In practical terms, donors in the two conditions should have overlapping covariate values: if all older donors are in one condition and all younger donors are in the other, the fitted condition contrast relies heavily on model extrapolation. The model must also be identifiable: its predictor columns cannot be exact copies or exact combinations of one another.

A covariate should be selected for a scientific reason, not simply because it changes a p-value. For an associational comparison, adjustment describes the condition contrast at fixed modeled covariates. A causal interpretation requires additional assumptions, including appropriate control of relevant confounding, correct model specification, and adequate overlap. Adjusting for variables measured after condition, or for variables that create collider bias, can distort rather than clarify the comparison.

For a logistic model, the condition coefficient is a conditional contrast, not a difference in proportions. To report proportions, calculate predicted values for specified covariate profiles or average model predictions over a clearly defined donor covariate distribution. State which summary is being reported. In a compositional analysis, also retain the interpretation tied to the chosen denominator or reference; a change in one component is not an absolute change in cell number.

Worked Example: Interpreting an Adjusted Condition Coefficient

Suppose a hypothetical study includes independent donors in two conditions, with age and sex recorded for each donor. A binomial logistic model for one cell type versus the chosen denominator gives \(\hat{\beta}_1=0.693\) and \(SE=0.280\). Assume the model’s binomial and predictor assumptions are considered reasonable for this illustration.

The estimated adjusted odds ratio is

$$ \exp(\hat{\beta}_1)=\exp(0.693)=2.00 . $$

At the same modeled age and sex, the estimated odds of the target type are twice as high in the condition coded 1 as in the reference condition. This does not mean the proportion is doubled: odds and proportions are different quantities.

For a large-sample Wald calculation, \(z=\hat{\beta}_1/SE=0.693/0.280=2.475\). The two-sided p-value is approximately \(0.0133\). The 95% confidence interval on the log-odds scale is

$$ 0.693\pm1.96(0.280)=(0.144,\ 1.242). $$

Exponentiating the endpoints gives an adjusted odds-ratio interval of \((\exp(0.144),\exp(1.242))=(1.155,\ 3.463)\). Under the model and the large-sample approximation, this interval is compatible with adjusted odds ratios from about 1.16 to 3.46. The p-value is evidence against a zero condition coefficient under the model; it is not the probability that the null hypothesis is true.

Worked Example: Translating an Adjusted Effect Into Predicted Proportions

Consider a hypothetical fitted model with

$$ \operatorname{logit}(p_i)=-2.00+0.70C_i-0.025(A_i-50)+0.30S_i , $$

where age is in years and \(S_i=1\) denotes the indicated sex category. For a donor aged 40 in the reference sex category, the linear predictor in the reference condition is \(-2.00-0.025(40-50)=-1.75\). The predicted proportion is

$$ \hat p=\frac{\exp(-1.75)}{1+\exp(-1.75)}=0.148 . $$

For the same modeled age and sex in condition 1, the predictor is \(-1.75+0.70=-1.05\), giving \(\hat p=\exp(-1.05)/\{1+\exp(-1.05)\}=0.259\). The corresponding odds ratio is \(\exp(0.70)=2.014\), but the predicted proportions are about 0.148 and 0.259, not proportions in a ratio of 2.014.

For a donor aged 70 in the same sex category, the reference-condition predictor is \(-2.00-0.025(70-50)=-2.50\), so \(\hat p=0.0759\). In condition 1 it is \(-1.80\), so \(\hat p=0.142\). The condition odds ratio remains 2.014 because the model has no interaction, while the difference in predicted proportions changes with baseline risk. These are conditional predictions for stated covariate values, not population-average effects.

Diagnosing Confounding and Unstable Estimates

A fitted coefficient alone does not show that the condition contrast is well supported. Before interpreting it, inspect how covariates are distributed across conditions and how many independent donors contribute to each combination. Warning signs include little or no overlap, a condition represented by only a few donors at some ages, near-duplicate predictors, and a very large standard error or a coefficient that changes sharply when a small number of donors are removed.

Exact collinearity prevents separate estimation. Near-collinearity may leave a mathematical solution but make the estimate highly variable. Sparse data can also cause separation: for example, if every donor in one condition has zero target cells while the other condition has positive counts, ordinary logistic maximum likelihood may send the condition coefficient toward negative infinity. The resulting extreme estimate and unreliable standard error are not evidence of an infinitely strong biological effect.

Diagnostics should be tied to the model. Check covariate distributions and cross-tabulations by condition, inspect convergence warnings and coefficient standard errors, and compare fitted values with observed donor-level proportions. For a binomial model, look for extra variability relative to the binomial assumption. These checks identify potential problems; they do not prove a model correct. If a later choice of model is warranted, state the reason and check whether the substantive interpretation changes.

Worked Example: Exact Collinearity Blocks Separate Effects

Suppose a hypothetical study records condition \(C_i\) and sex indicator \(S_i\), but every donor in condition 1 has \(S_i=1\), and every donor in condition 0 has \(S_i=0\). Thus \(C_i=S_i\) for every donor. In the linear predictor, the two terms become

$$ \beta_1C_i+\beta_3S_i=(\beta_1+\beta_3)C_i . $$

The data can at most inform the sum \(\beta_1+\beta_3\), not the separate condition and sex effects. For example, \((\beta_1,\beta_3)=(0.4,0.6)\) and \((0.8,0.2)\) produce the same predictor for every donor. There is no unique adjusted condition coefficient, so reporting one as the effect “holding sex fixed” is not justified by this design.

If the variables are nearly, rather than exactly, aligned, the coefficients may technically be estimable but imprecise. As an illustration, a predictor with \(R^2=0.96\) when regressed on the other predictors has variance inflation factor \(1/(1-0.96)=25\) in the corresponding linear-design calculation. This indicates severe redundancy in the design, not a correction that can create missing comparisons. Better overlap or a more limited, scientifically justified model may be needed.

Worked Example: Recognizing Separation in a Sparse Group

In a hypothetical donor-level comparison, the reference condition has 3 target cells among 100 cells, while condition 1 has 0 among 20. In a two-group binomial logistic model, the reference estimate is \(\hat p_0=3/100=0.0300\), with estimated odds \(3/97=0.0309\). The condition-1 likelihood is maximized as its fitted probability approaches zero; its estimated log odds tend toward negative infinity. Consequently, the ordinary maximum-likelihood condition coefficient has no finite estimate in this separated example.

The tempting calculation \(0/20=0\), followed by an odds ratio of zero, is not a stable estimate of an underlying condition effect. There are few donors and no observed target cells in one group, so the data give weak information about how small the underlying probability is. A penalized or Bayesian method can sometimes return finite estimates, but its assumptions and sensitivity to the penalty or prior must be reported. More donors or a scientifically defensible aggregation may be preferable; adding arbitrary covariates will not resolve separation.

Choosing an Approach and Avoiding Common Mistakes

An unadjusted comparison is simple and may be reasonable when relevant donor characteristics are balanced and the unadjusted contrast answers the scientific question. A covariate-adjusted regression uses several predictors simultaneously and can account for measured imbalances, but relies on a specified outcome and predictor model. Stratification compares conditions within covariate groups and can make overlap visible, but many strata quickly become sparse and continuous covariates require grouping. None of these approaches repairs a lack of comparable donors.

ApproachStrengthMain caution
Unadjusted donor-level comparisonTransparent and parsimoniousMay mix condition differences with covariate imbalance
Covariate-adjusted regressionModels multiple covariates and gives a conditional contrastDepends on model form, overlap, and adequate donor information
Stratified comparisonShows within-group contrasts directlyCan be unstable when strata contain few donors or no overlap

A common mistake is to interpret “adjusted for age and sex” as proof that condition groups are comparable in every relevant way. The correction is to name the included covariates, inspect their overlap, and limit the conclusion to the model-based conditional contrast. A second mistake is to treat a small p-value as evidence that adjustment succeeded. Significance does not diagnose collinearity, separation, model misspecification, or unmeasured confounding.

Key takeaway: Adjustment is a model-based comparison among donors with the same modeled covariates. Interpret the coefficient on the model’s scale, check overlap and identifiability, and do not treat an adjusted association as causal without the additional assumptions that causal interpretation requires.

Check Your Understanding

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

  1. In a logistic abundance model, what does \(\exp(\beta_1)\) mean when condition is coded 0 or 1 and age is included?
  2. A fitted condition coefficient is \(0.405\). Calculate its adjusted odds ratio to three significant figures.
  3. Why can an exact match between condition and sex prevent separate adjustment for both?
  4. What is one warning sign that the binomial assumption may be inadequate for donor-level counts?

Solutions. (1) It is the condition-1 versus condition-0 odds ratio at the same modeled age and other included covariate values. (2) \(\exp(0.405)=1.50\), so the adjusted odds are estimated to be 1.50 times as high in condition 1. (3) If the indicators are identical, their coefficient terms combine into a single term, so the data cannot distinguish the separate effects. (4) Donor-level variation substantially larger than the binomial model predicts is a warning; a model allowing overdispersion may be needed.

Clinical Biostats