Tutorials › Multi-Omics Data Integration › Confounding Between Latent Factors And Covariates

Latent Factor Models and Their Interpretation · Tutorial 240 of 597

Confounding Between Latent Factors And Covariates

Learn to quantify covariate–factor alignment, examine its feature-level pattern, and interpret whether a factor represents covariate-associated or additional residual structure.

Advanced 11 min read

What You'll Learn

  • Define covariate alignment with a centered latent factor score.
  • Calculate a score–covariate slope and the fraction of score variation associated with the covariate.
  • Recognize when a covariate’s feature pattern can be represented as a factor loading pattern.
  • Diagnose whether apparent factor structure remains beyond a measured covariate.
  • Distinguish covariate association from evidence of a technical artifact or causal effect.
  • Identify limitations caused by confounding, weak overlap, factor estimation, and factor orientation.

Why Covariates Can Resemble Latent Factors

A latent factor summarizes coordinated variation across measurements. But coordination need not arise from an unmeasured biological process: it may track a measured covariate, such as age, treatment group, collection site, or assay batch. A factor that aligns with a covariate can still describe real variation in the data. The interpretive question is whether it captures variation associated with that covariate, whether additional structure remains beyond it, or both.

This distinction matters in multi-omics data because the same covariate may affect many features in one or more views. If the resulting pattern is strong and coordinated, a factor model may represent it with a score across samples and a loading pattern across features. That representation alone does not establish that the factor is a distinct biological process, a technical artifact, or a causal effect.

Definition: Let \(c\) be a measured covariate across \(n\) samples, centered by subtracting its sample mean, and let \(f\) be a centered score vector for one latent factor. The factor is aligned with the covariate when their sample-wise values are associated. In a one-covariate linear description, the score slope is \(\hat{\beta}=c^\mathsf{T}f/(c^\mathsf{T}c)\), and the fraction of centered score variation explained by the covariate is \(R^2=(c^\mathsf{T}f)^2/\{(c^\mathsf{T}c)(f^\mathsf{T}f)\}\), provided both vectors are nonzero.

These are descriptive quantities from an ordinary least-squares regression of \(f\) on \(c\) with an intercept. They require no normality assumption for their algebraic calculation. If they are used for formal inference, the sampling design and uncertainty introduced by estimating factor scores must also be addressed; treating estimated scores as fixed observations can understate uncertainty. Centering makes the intercept disappear from the formulas. The slope’s units are factor-score units per covariate unit, while \(R^2\) is dimensionless.

A factor’s sign and scale can be changed without changing the underlying factor representation. Consequently, the sign of \(\hat{\beta}\) depends on the chosen score sign. The absolute correlation, or \(R^2\), does not change under a sign reversal or nonzero rescaling of the score.

Deriving a Score–Covariate Diagnostic

Suppose the factor score is described by a linear trend with the covariate plus a remainder. The least-squares slope is the value that minimizes the squared residuals:

$$ \hat{\beta}=\arg\min_b (f-bc)^\mathsf{T}(f-bc) =\frac{c^\mathsf{T}f}{c^\mathsf{T}c}. $$

To see why, expand the quantity being minimized as \(f^\mathsf{T}f-2b c^\mathsf{T}f+b^2c^\mathsf{T}c\). Differentiating with respect to \(b\) gives \(-2c^\mathsf{T}f+2b c^\mathsf{T}c\); setting this equal to zero yields the stated slope. The fitted score is \(\hat{\beta}c\), and the residual is \(r=f-\hat{\beta}c\). By construction, \(c^\mathsf{T}r=0\), so the fitted and residual vectors are orthogonal. Therefore:

$$ f^\mathsf{T}f=(\hat{\beta}c)^\mathsf{T}(\hat{\beta}c)+r^\mathsf{T}r, \qquad R^2=\frac{\hat{\beta}^{\,2}c^\mathsf{T}c}{f^\mathsf{T}f}. $$

This decomposition gives a precise descriptive meaning to \(R^2\): the proportion of the centered score’s sum of squares accounted for by its linear projection onto the covariate. A large value indicates strong linear alignment, not proof that the covariate caused the factor or that the factor has no other interpretation.

Worked Example: Quantifying Alignment With a Covariate

Consider four hypothetical samples. Let \(c=(-1,1,-1,1)\) be a centered covariate code for two groups, and let \(u=(1,1,-1,-1)\) be a centered score component orthogonal to that code. Suppose the centered factor scores are \(f=0.6c+u\). Find the score slope and the fraction of score variation associated linearly with \(c\).

First, the vectors satisfy \(c^\mathsf{T}c=4\), \(u^\mathsf{T}u=4\), and \(c^\mathsf{T}u=0\). Coordinatewise, the scores are \(f=(0.4,1.6,-1.6,-0.4)\). Thus \(c^\mathsf{T}f=2.4\), and the fitted slope is:

$$ \hat{\beta}=\frac{c^\mathsf{T}f}{c^\mathsf{T}c} =\frac{2.4}{4}=0.6. $$

The fitted values are \(0.6c=(-0.6,0.6,-0.6,0.6)\), with sum of squares \(4(0.6^2)=1.44\). Since \(f=0.6c+u\) and \(c^\mathsf{T}u=0\), the total score sum of squares is \(1.44+4=5.44\). Consequently, \(R^2=1.44/5.44\approx0.2647\). In this hypothetical example, 26.47% of the centered score variation is accounted for by the linear projection onto the group code; the remainder is orthogonal to that code. The calculation describes alignment, not its cause.

Alignment Can Appear in the Loading Pattern

A common factor-model representation of a centered \(n\)-by-\(p\) data matrix \(X\) is \(X\approx FL^\mathsf{T}+E\), where rows correspond to samples, columns to measured features, \(F\) contains sample scores, \(L\) contains feature loadings, and \(E\) contains residual variation. Consider a single centered covariate \(c\). If its association with features has a linear pattern \(\gamma\), then a component of the data may be written \(c\gamma^\mathsf{T}\). This component is rank one (if both vectors are nonzero), so a one-factor representation can capture it exactly by taking its score proportional to \(c\) and its loading proportional to \(\gamma\).

This is a geometric statement about the representation, not a claim that every covariate effect is exactly rank one. Real data can include nonlinear effects, interactions, noise, multiple covariates, and biological variation. Still, a covariate-associated pattern that is shared across many features can readily resemble a latent factor.

Worked Example: A Covariate Pattern Represented as a Factor

Suppose a hypothetical three-sample dataset has two centered omics features, and \(c=(-1,0,1)\) records centered age in units of 10 years. Let the feature association pattern be \(\gamma=(2,-1)\), in feature units per 10-year age unit. The covariate-associated data component is:

$$ X=c\gamma^\mathsf{T} = \begin{pmatrix} -1\\ 0\\ 1 \end{pmatrix} \begin{pmatrix} 2&-1 \end{pmatrix} = \begin{pmatrix} -2&1\\ 0&0\\ 2&-1 \end{pmatrix}. $$

Each row gives the two-feature measurements for one sample. The matrix has the exact one-factor form \(FL^\mathsf{T}\) with score vector \(f=c\) and loading vector \(l=\gamma\). For example, the first sample’s measurements are \((-1)(2,-1)=(-2,1)\). The factor score is perfectly aligned with age in this constructed example, and its loading pattern is the feature-wise age association. With real data, noise or other sources of variation may weaken this alignment. Even when the pattern is exact, the factor is best described as representing age-associated variation in these data; the algebra alone does not say whether that association is biological, technical, or causal.

Diagnosing What Remains Beyond the Covariate

A useful diagnostic separates the score’s covariate projection from its residual, as in the derivation above. If the residual score \(r=f-\hat{\beta}c\) is negligible, then the observed score adds little sample-wise variation beyond the linear covariate trend. If \(r\) remains substantial and organized, the factor may also capture variation not explained by that trend. This does not establish that the remainder is a separate biological mechanism: unmeasured covariates, nonlinear relationships, measurement error, and model misspecification can all contribute.

Feature-level checks help connect score alignment to the data pattern. For each feature, inspect its association with the measured covariate and compare the resulting pattern across features with the factor’s loadings. If the covariate-associated feature pattern closely resembles the loading vector, that supports the interpretation that the factor captures covariate-associated variation. A mismatch suggests that the score–covariate association may be only partial, or that multiple sources of variation contribute to the factor. These comparisons are descriptive; feature-wise testing also raises multiplicity and uncertainty issues.

For several factors, one score at a time can be misleading. Factors may be correlated, and permissible rotations can redistribute associations among their scores and loadings. In that setting, inspect the association of the covariate with the span of the scores, as well as the individual score associations under the chosen factor solution. A conclusion that depends heavily on one arbitrary orientation is less robust than one that holds for the factor subspace. Factor sign and scale conventions do not, by themselves, resolve this issue.

1
Check the data and design.
Confirm which covariate was recorded, its units and coding, and whether there is adequate variation and overlap across its values. If a group and a technical batch are perfectly aligned, the observed data cannot distinguish their separate associations.
2
Measure score alignment.
Center the covariate and score consistently, then calculate the slope and \(R^2\), or use a plot to examine nonlinearity, outliers, and group-specific patterns that a single \(R^2\) would hide.
3
Inspect the feature pattern.
Compare the factor loadings with feature-wise covariate associations. Look for broad agreement, opposite-direction features, and differences across omics views.
4
Assess remaining structure cautiously.
Ask whether score variation or coordinated feature patterns remain beyond a simple covariate trend. Treat this as a diagnostic, not a causal test or proof of a distinct mechanism.

Worked Example: A Factor With Both Aligned and Residual Variation

For five hypothetical samples, let the centered covariate be \(c=(-2,-1,0,1,2)\), measured in dose units. Suppose the centered factor score is \(f=0.5c+v\), where \(v=(1,-2,0,2,-1)\) is a possible residual score component. Here \(c^\mathsf{T}c=10\), \(c^\mathsf{T}v=0\), and \(v^\mathsf{T}v=10\). The score vector is \(f=(0,-2.5,0,2.5,0)\), so \(c^\mathsf{T}f=5\).

The fitted slope is \(\hat{\beta}=5/10=0.5\) score units per dose unit. The fitted sum of squares is \(0.5^2(10)=2.5\), and the total score sum of squares is \(f^\mathsf{T}f=6.25+6.25=12.5\). Thus \(R^2=2.5/12.5=0.20\). In this constructed example, 20% of score variation is linearly associated with the covariate, while the orthogonal remainder has sum of squares \(12.5-2.5=10\). That remainder shows that the score is not just a linear rescaling of \(c\); determining its scientific meaning requires further evidence.

Assumptions, Alternatives, and Failure Modes

The score slope and \(R^2\) are well-defined descriptive summaries when the centered covariate and score are nonzero and observed on the same samples. Their linear interpretation is limited: a nonlinear relationship can be strong even when \(R^2\) is modest, and a few influential samples can dominate a slope. Plots and group-wise summaries can reveal patterns hidden by a single number. If sample membership or missingness differs across features, check that comparisons use an appropriate common set of samples.

Several approaches answer related but different questions. Direct feature-wise regression on a covariate asks how individual measurements vary with it; comparing those associations with loadings asks whether the factor pattern resembles that feature-level pattern. Stratified plots can show whether a factor varies within covariate groups or mainly between them, though small groups limit what can be learned. A covariate-adjusted factor model incorporates covariates in the model itself and is a different modeling approach. These approaches are not interchangeable: each makes distinct choices about which variation to represent and how to handle uncertainty.

A key limitation is lack of independent variation. If a biological condition always occurs in one batch and never in another, their effects cannot be separated from the observed data alone. Likewise, a factor’s association with a measured covariate does not establish that the covariate caused the score pattern. The covariate might be a proxy for another variable, or both might reflect a shared cause. These questions require study-design knowledge as well as statistical summaries.

  • Confusing alignment with nuisance. A strong correlation does not make a factor “only technical.” A measured covariate may describe meaningful biology.
  • Calling the residual independent biology. Variation orthogonal to one measured covariate may still reflect unmeasured or nonlinear effects.
  • Ignoring score orientation. A negative slope can become positive if the factor score sign is reversed; the absolute alignment is unchanged.
  • Relying only on a small p-value. A test can indicate evidence of association without showing how much score variation is associated or whether the pattern is scientifically important.
  • Overinterpreting a single factor in a multi-factor solution. Correlation or rotation among factors can make individual score associations depend on the chosen representation.
Key takeaway: Quantify score–covariate alignment, examine whether the covariate’s feature pattern resembles the loadings, and assess what remains beyond a simple covariate trend. These checks support interpretation, but they do not by themselves establish causality or distinguish perfectly confounded sources.

Check Your Understanding

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

  1. If \(c^\mathsf{T}c=8\) and \(c^\mathsf{T}f=4\), what is the fitted slope for the centered score on the centered covariate?
  2. A factor score has \(R^2=0.64\) with a measured covariate. What does this value describe, and what does it not establish?
  3. A covariate’s feature-wise association pattern closely matches a factor’s loadings. Give a reasonable interpretation and one conclusion that would be too strong.
  4. Suppose treatment group and assay batch are perfectly aligned in the observed samples. Can score–covariate diagnostics determine which one explains the factor? Why or why not?

Solutions. (1) The slope is \(\hat{\beta}=c^\mathsf{T}f/(c^\mathsf{T}c)=4/8=0.5\) score units per covariate unit. (2) Under the linear projection, 64% of the centered score’s sum of squares is associated with the covariate. This does not establish causality, rule out other sources, or show that the factor is unimportant. (3) It is reasonable to say that the factor may represent covariate-associated variation. It is too strong to conclude from the pattern alone that the covariate caused the factor or that the factor is exclusively a technical artifact. (4) No. With perfect alignment, the observed data do not provide independent variation that separates treatment from batch; the design cannot identify their separate associations.

Clinical Biostats