Tutorials › Multi-Omics Data Integration › Stability Of Subject Scores Under Resampling

Latent Factor Models and Their Interpretation · Tutorial 246 of 597

Stability Of Subject Scores Under Resampling

Use aligned resampled fits to distinguish stable subject rankings and positions from apparent precision that depends on a particular sample.

Advanced 12 min read

What You'll Learn

  • Define a common set of subjects and score scale for comparing resampled fits.
  • Summarize rank stability with rank correlations and top-rank frequencies.
  • Quantify score variability and pairwise ordering consistency across resamples.
  • Choose a resampling and scoring strategy that matches the target interpretation.
  • Diagnose instability and explain what it does—and does not—allow you to conclude.

Why Subject-Score Stability Matters

A fitted factor model assigns each subject a score on each factor. A score can place a subject high or low relative to others, but that position is estimated from data and may change when the subjects used to fit the model change. A clear-looking score from one fit is not, by itself, evidence that the subject’s position is reproducible.

This tutorial assesses subject-score stability under resampling: whether subjects retain similar scores, ranks, and relative ordering across fits to perturbed samples of subjects. The emphasis is on the subjects, not on re-evaluating which features define a factor. Stability is always relative to a specified factor, score scale, resampling scheme, and set of subjects being compared.

Definition: Let \(n\) subjects be the comparison set and \(K\) the number of matched factors. In resampled fit \(b\), let \(\hat{z}_{ik}^{(b)}\) be the estimated score for subject \(i\) on factor \(k\), after factor alignment and score-scale harmonization. A subject’s score stability describes how much \(\hat{z}_{ik}^{(b)}\) varies across \(B\) resampled fits. Rank stability describes how consistently subjects retain their relative ordering on that factor.

Set Up a Meaningful Comparison

Resampling changes the data used to estimate a factor model. Therefore, compare scores only after making their meanings comparable across fits. Factor labels can switch, and a factor’s sign can reverse without changing the underlying solution. Use the factor-matching and sign-alignment procedures introduced earlier in the course; apply the corresponding transformations to the scores as well as to the loadings. If a model allows more general rotations, compare coordinates only after a suitable common orientation has been established.

Scores also need a common scale. Use a model parameterization that fixes the score scale, or express scores in a consistent reference scale across fits. A numerical change caused only by one fit using a different scale is not evidence that a subject moved biologically. Do not choose an alignment or scale transformation to make the subjects’ rankings agree: that would build the desired stability into the comparison.

A direct strategy is to define a fixed set of anchor subjects and score them under every resampled fit. One way is to resample subjects to fit the model, then estimate the anchor subjects’ scores under that fitted model using the same scoring rule each time. Anchors not included in a particular training resample can be scored out of sample, when the model supports this. Scoring a fixed set makes the across-fit comparison explicit; using only the subjects present in each resample can leave different fits with different comparison sets.

Assumptions and scope: A resampling assessment is most interpretable when subjects are sampled independently from a common target population, or when the resampling scheme preserves the actual dependence and sampling design. The factor model, number of factors, feature set, preprocessing, and scoring rule should be held fixed if the goal is to isolate subject-sample variation. Fits must converge, and corresponding factors must be alignable. If these conditions fail, apparent score variability can reflect design mismatch, nonconvergence, or factor ambiguity rather than ordinary sampling variation.

For clustered or repeated-measures data, resample the independent sampling units or clusters rather than treating dependent rows as independent. For stratified sampling, preserve the strata. The resampling scheme should mimic how new data would vary under the target design; otherwise the resulting stability summaries answer the wrong question.

Summaries of Score and Rank Stability

For a fixed subject \(i\) and factor \(k\), calculate the resampling mean and sample standard deviation:

$$ \bar{z}_{ik}^{\,*}=\frac{1}{B}\sum_{b=1}^{B}\hat{z}_{ik}^{(b)}, \qquad s_{ik}^{\,*}=\sqrt{\frac{1}{B-1}\sum_{b=1}^{B}\left(\hat{z}_{ik}^{(b)}-\bar{z}_{ik}^{\,*}\right)^2}. $$

These summarize the center and spread of that subject’s scores across the specified resampling procedure, in the chosen score units. They are not automatically a standard error or a confidence interval for a biological quantity. Under suitable sampling and regularity conditions, bootstrap quantiles can approximate sampling uncertainty; that interpretation still depends on a valid model, resampling design, and scoring procedure.

For rankings, define rank 1 as the highest score and use midranks for ties. A useful summary is the rank correlation between a reference fit’s ranks and the ranks from each resampled fit. Spearman’s rank correlation measures similarity in ordering; it does not require score differences to be linear or equally spaced. Also report summaries that answer a concrete question, such as how often a subject ranks first or how often it falls in the top 10%. These are proportions across the resampled fits, not probabilities that a subject has a true rank.

For two subjects \(i\) and \(j\), the empirical pairwise ordering frequency is

$$ \hat{q}_{ij,k}=\frac{1}{B}\sum_{b=1}^{B} I\!\left(\hat{z}_{ik}^{(b)}>\hat{z}_{jk}^{(b)}\right), $$

where \(I(\cdot)\) equals 1 when the stated ordering holds and 0 otherwise. If ties matter, state how they are handled rather than silently counting them as one direction. A value near 1 indicates that \(i\) tends to score above \(j\) in these resampled fits; a value near 0.5 indicates that their ordering often changes.

Why Spearman’s Rank Summary Has This Form

When there are no tied ranks, let \(r_i\) and \(s_i\) be the ranks of subject \(i\) in two fits, and let \(d_i=r_i-s_i\). Both rank lists are permutations of \(1,\ldots,n\), so each has mean \((n+1)/2\) and centered sum of squares \(S=n(n^2-1)/12\). The identity

$$ \sum_{i=1}^{n}(r_i-s_i)^2 =\sum_{i=1}^{n}(r_i-\bar{r})^2+\sum_{i=1}^{n}(s_i-\bar{s})^2 -2\sum_{i=1}^{n}(r_i-\bar{r})(s_i-\bar{s}) $$

follows by expanding the square; the centered sums are unchanged because both rank lists have the same mean. The Pearson correlation of the two rank lists is their centered cross-product divided by \(S\). Substituting the identity, with both centered sums equal to \(S\), gives

$$ \rho_S=1-\frac{\sum_{i=1}^{n}d_i^2}{2S} =1-\frac{6\sum_{i=1}^{n}d_i^2}{n(n^2-1)}. $$

Thus identical ranks give \(\rho_S=1\), while larger squared rank changes reduce the correlation. With tied ranks, calculate the Pearson correlation of the midranks directly; the displayed shortcut need not apply.

Worked Example: Do the Top-Ranked Subjects Stay on Top?

Suppose five hypothetical anchor subjects, A through E, have reference ranks 1 through 5 on an aligned factor. In one resampled fit their ranks are A: 1, B: 3, C: 2, D: 4, E: 5. The factor has been aligned to the reference fit and the same five subjects were scored, so the rank comparison is defined.

The rank differences in A-to-E order are \(0,-1,1,0,0\), so \(\sum d_i^2=2\). The Spearman correlation is

$$ \rho_S=1-\frac{6(2)}{5(5^2-1)} =1-\frac{12}{120}=0.900. $$

The ordering is broadly similar, but B and C have exchanged positions. Now suppose four resampled fits give these rank lists, in A-to-E order: (1, 3, 2, 4, 5), (2, 1, 3, 4, 5), (1, 2, 4, 3, 5), and (1, 2, 3, 5, 4). A is ranked first in three of four fits, so its observed top-rank frequency is \(3/4=0.750\). This small demonstration illustrates the calculation, not a precise population estimate: many more resamples would be needed for a stable assessment.

Worked Example: Quantifying One Subject’s Score Variation

Across five hypothetical aligned resampled fits, subject D’s scores on a factor are 0.42, 0.35, 0.50, 0.28, and 0.45 standardized score units. The fits share a score scale, so the variation is not a simple scale mismatch. The mean is

$$ \bar{z}_{Dk}^{\,*}=\frac{0.42+0.35+0.50+0.28+0.45}{5} =\frac{2.00}{5}=0.400. $$

The squared deviations from 0.400 sum to \(0.0004+0.0025+0.0100+0.0144+0.0025=0.0298\). Therefore,

$$ s_{Dk}^{\,*}=\sqrt{\frac{0.0298}{5-1}} =\sqrt{0.00745}=0.0863 $$

standardized score units. This subject’s score is centered at 0.400 in these fits, with a resampling standard deviation of about 0.0863. The observed minimum and maximum are 0.28 and 0.50, respectively, but five values do not support a reliable percentile interval. A much larger set of valid resamples would be needed to estimate quantiles, and even then the result should be described as resampling uncertainty under the stated procedure—not as a probability that a fixed biological value lies in an interval.

Worked Example: Are Two Subjects Reliably Ordered?

For two hypothetical anchor subjects, M and N, suppose 10 aligned fits yield \(\hat{z}_{Mk}^{(b)}>\hat{z}_{Nk}^{(b)}\) in seven fits and the reverse ordering in the other three, with no ties. Then

$$ \hat{q}_{MN,k}=\frac{7}{10}=0.700. $$

M scores above N in 70% of these resampled fits. This indicates some tendency for that ordering, but it is not a strong guarantee that their order will persist: it reverses in three of the ten fits. The 10-fit calculation is illustrative; in practice, use enough resamples to make the frequency itself stable and report the resampling design and score alignment.

Diagnostics, Comparisons, and Limits

Before interpreting a stability summary, check that every fit converged, that the same factor was matched across fits, and that the scores use a common scale. Examine the distribution of scores and ranks across fits rather than relying only on an average. A few extreme fits may inflate the score standard deviation; repeated rank reversals may be hidden by an apparently reasonable mean score. If a fit cannot be matched unambiguously, report that ambiguity rather than forcing a correspondence.

The main summaries answer different questions. Rank correlation assesses overall ordering; top-rank frequency assesses persistence at an extreme; score standard deviation measures variability in the score scale; and pairwise ordering frequency focuses on a particular comparison. None alone establishes that a factor is biologically meaningful. Loading-profile stability concerns which features define a factor, whereas subject-score stability concerns where subjects lie on a matched factor. Strong loading stability can coexist with unstable subject positions, for example when subjects have similar scores.

A posterior distribution for scores is an alternative uncertainty summary when the fitted model provides one. It represents uncertainty conditional on that model and its priors; resampling instead examines variation under repeated perturbations of the sampled subjects and refitting procedure. Neither approach removes model misspecification, confounding, measurement error, or an inappropriate sampling design. A single-fit score or model-based standard error may be simpler, but does not by itself reveal whether refitting on changed subjects alters rankings.

The resampling conclusions are conditional on what was held fixed. If features, preprocessing, priors, or model complexity are also changed, score instability mixes those sources with subject-sample variation. Conversely, fixing them means this assessment cannot establish robustness to those other choices. A large resampling spread also does not show that any one subject is incorrectly measured; it shows that the estimated position is sensitive to the specified resampling process.

Common mistake: “The reference fit ranks subject A first, so A is the highest-scoring subject.” That conclusion ignores estimation variability. Check how often A remains first, how its score varies, and whether its pairwise orderings with relevant subjects persist. If those summaries show frequent reversals, describe A’s high score as fit-dependent rather than as a stable subject-level distinction.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Why must factor alignment and score-scale harmonization precede comparison of subject ranks and scores?
  2. Four resampled fits give a subject ranks 1, 2, 1, and 3. What is its top-rank frequency, and what does that frequency mean?
  3. Two subjects have pairwise ordering frequency 0.50 across many fits. What is the appropriate interpretation?
  4. Why may an ordinary row-wise bootstrap be inappropriate for repeated measurements from the same subject?
  5. Can stable loading profiles guarantee stable subject rankings? Explain briefly.

Solutions. (1) Factor labels and signs may differ across fits, and differing score scales can create numerical changes that do not represent changed subject positions. Align factors and use a common scale before interpreting score or rank differences. (2) The frequency is \(2/4=0.500\). The subject ranked first in half of these fits; this is a resampling frequency, not the probability that the subject is truly first. (3) The two subjects’ ordering is not persistent: either tends to score above the other about equally often under the specified resampling procedure. (4) Repeated measurements within a subject are dependent. Resampling rows independently breaks that dependence and misrepresents the sampling design; resample subjects or the appropriate independent clusters. (5) No. Similar or sensitive subject scores can change rank even when the feature profiles defining the factor are stable.

Clinical Biostats