WHY MATHEMATICS?
Why Mathematics? | Surrogate Variable Analysis: Hidden Confounders, Latent Factors, Differential Expression and Honest Inference
How surrogate variable analysis estimates hidden sources of systematic heterogeneity and adds them to statistical models so measured effects can be tested with clearer scope.
Why mathematics is important becomes easier to see when a real decision depends on it. This guide follows the mechanism from definitions and dimensions to a worked calculation, validation, practical learning and responsible use. It keeps factual evidence separate from interpretation and treats every illustrative scenario as an example rather than a promise of results.
Choose a reading route
- Define the primary model and hidden heterogeneity
- Estimate surrogate variables from high-dimensional data
- Include latent factors in gene-wise inference
- Validate adjustment, power and reproducibility
Chapter map
- 1. Why measured covariates are incomplete
- 2. The full biological model
- 3. The null or reduced model
- 4. Residual expression structure
- 5. A rank-one hidden factor example
- 6. Estimating surrogate variables
- 7. Adding surrogates to regression
- 8. Number of surrogate variables
- 9. Confounding with the primary effect
- 10. Power and false discoveries
- 11. Surrogate interpretation
- 12. Prediction versus inference
- 13. Sensitivity and reproducibility
- 14. Comparing RUV-2 and ComBat
- 15. A student hidden-factor project
- 16. Responsible inference and careers
Visit the How Mathematics Works hub for the wider series and its connections to education, reasoning, science, computing, design and careers.
1. Why measured covariates are incomplete
A small example makes the mechanism visible. Gene expression reflects genetics, environment, demographics and technical conditions, many of which are unknown or unmeasured.
A concrete situation
Sample degradation can vary without a recorded quality score.
What the mathematics does not license
Unmeasured does not mean irrelevant or purely technical. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
List plausible hidden sources before modelling. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
2. The full biological model
This is where modelling choices begin to affect evidence. The full model contains the primary variables and measured covariates whose effects should be estimated or protected.
A concrete situation
Disease status and age can be explicit columns.
What the mathematics does not license
A misspecified primary model changes what appears hidden. Keeping this boundary clear makes the result easier to audit and transfer.
Try it, check it, transfer it
Write the design matrix and contrasts. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
3. The null or reduced model
The central mathematical idea is concrete. A reduced model omits the primary effect while retaining nuisance covariates, helping distinguish variation associated with the variable of interest.
A concrete situation
Age may remain while disease is removed.
What the mathematics does not license
Null-model choice is part of the method definition. A trustworthy workflow records the choice before seeing the final test result.
Try it, check it, transfer it
Compare full and reduced fitted spaces. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
4. Residual expression structure
Here the geometry becomes operational. After accounting for measured variables, systematic patterns can remain across many genes. Low-rank factors summarise them.
A concrete situation
A latent laboratory effect shifts a subset of genes.
What the mathematics does not license
Residual factors can mix several causes. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
Compute an SVD of a toy residual matrix. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
5. A rank-one hidden factor example
This step deserves a careful pause. Let hidden score h=(1,-1,1,-1) affect genes with loadings (2,1,-1). The outer product hγᵀ creates coordinated heterogeneity.
A concrete situation
Including h in regression can protect the primary coefficient when h confounds it.
What the mathematics does not license
Estimated h may also overlap biology. Keeping this boundary clear makes the result easier to audit and transfer.
Try it, check it, transfer it
Calculate the 4×3 outer product. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
6. Estimating surrogate variables
The useful question is not only how to calculate, but what the calculation assumes. SVA identifies features associated with residual heterogeneity and estimates latent sample variables from that structure.
A concrete situation
A surrogate may align with processing date discovered later.
What the mathematics does not license
The algorithm estimates a factor, not a causal label. A trustworthy workflow records the choice before seeing the final test result.
Try it, check it, transfer it
Compare surrogate scores with known metadata after fitting. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
7. Adding surrogates to regression
A small example makes the mechanism visible. Surrogate variables enter gene-wise models as additional covariates alongside the primary variables.
A concrete situation
Adjusted disease effects can have less residual confounding.
What the mathematics does not license
Extra covariates cost degrees of freedom and can reduce power. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
Write adjusted and unadjusted models side by side. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
8. Number of surrogate variables
This is where modelling choices begin to affect evidence. Too few leave hidden dependence; too many can absorb signal or destabilise small studies.
A concrete situation
Two strong factors may be supported while a third is uncertain.
What the mathematics does not license
Training fit cannot decide the scientific trade-off alone. Keeping this boundary clear makes the result easier to audit and transfer.
Try it, check it, transfer it
Inspect stability, controls and external replication across counts. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
9. Confounding with the primary effect
The central mathematical idea is concrete. When hidden factors closely align with the primary variable, separation becomes difficult and relies on design and estimation assumptions.
A concrete situation
Most cases processed on one day create overlap.
What the mathematics does not license
Latent adjustment cannot solve complete confounding. A trustworthy workflow records the choice before seeing the final test result.
Try it, check it, transfer it
Cross-tabulate known proxies and primary groups. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
10. Power and false discoveries
Here the geometry becomes operational. Unmodelled heterogeneity can inflate variance, induce dependence and create spurious associations. Suitable surrogates can improve calibration and power.
A concrete situation
Known null genes may show fewer false positives.
What the mathematics does not license
Improved p-values do not verify every discovery. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
Use simulations, controls and replication. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
11. Surrogate interpretation
This step deserves a careful pause. Correlate surrogate variables with batch, quality, cell composition and demographics while avoiding single-cause certainty.
A concrete situation
One surrogate may track both site and RNA quality.
What the mathematics does not license
Confounded metadata make causal naming unsafe. Keeping this boundary clear makes the result easier to audit and transfer.
Try it, check it, transfer it
Report several plausible associations and tests. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
12. Prediction versus inference
The useful question is not only how to calculate, but what the calculation assumes. SVA was developed for expression-study inference. A predictive pipeline must estimate surrogates without seeing held-out outcomes or samples improperly.
A concrete situation
Global factor estimation before cross-validation can leak test structure.
What the mathematics does not license
An inference workflow does not automatically become a deployment transform. A trustworthy workflow records the choice before seeing the final test result.
Try it, check it, transfer it
Define how one new sample receives surrogate values. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
13. Sensitivity and reproducibility
A small example makes the mechanism visible. Vary feature filters, sample exclusions and surrogate counts, then test an independent cohort.
A concrete situation
Stable effect directions across analyses strengthen evidence.
What the mathematics does not license
Repeated analysis choices can select a favourite result. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
Predeclare primary settings and log alternatives. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
14. Comparing RUV-2 and ComBat
This is where modelling choices begin to affect evidence. RUV-2 uses negative controls; ComBat uses known batches; SVA estimates unmeasured heterogeneity from the broader expression structure.
A concrete situation
Available design information guides the choice.
What the mathematics does not license
Combining methods blindly can overcorrect. Keeping this boundary clear makes the result easier to audit and transfer.
Try it, check it, transfer it
Compare transparent alternatives on common evidence. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
15. A student hidden-factor project
The central mathematical idea is concrete. Simulate one measured effect and one hidden factor, fit regressions with and without the factor, and compare bias.
A concrete situation
Known truth makes confounding visible.
What the mathematics does not license
Real data do not reveal the true factor. A trustworthy workflow records the choice before seeing the final test result.
Try it, check it, transfer it
Change factor-primary correlation and sample size. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
16. Responsible inference and careers
Here the geometry becomes operational. Version designs, features, surrogate estimates and adjusted results. Genomics requires statistics, laboratory context and writing.
A concrete situation
Students can practise matrices, regression and evidence boundaries.
What the mathematics does not license
SVA guarantees no diagnosis, salary or causal truth. Evidence becomes stronger when the limitation is tested instead of hidden.
Try it, check it, transfer it
Require independent reproduction and cautious language. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
A seven-day practice lab
- Day 1: define the decision, observation unit, X variables and Y or reference condition.
- Day 2: reproduce the smallest worked example and check every dimension, unit and sign.
- Day 3: build a transparent baseline and write what it assumes.
- Day 4: fit the main method inside a training-only pipeline; record every parameter.
- Day 5: challenge one assumption with a deliberately difficult dataset or operating regime.
- Day 6: compare validation metrics with the practical workload created by errors.
- Day 7: present one supported conclusion, one unresolved uncertainty and one safe next experiment.
Questions for a student, parent or mentor
- Which part of the model is a mathematical definition, and which part is a choice?
- What small calculation would catch a sign, scale or dimension error?
- What evidence comes from training, validation and the untouched test?
- What benign condition could look like a fault or prediction failure?
- How would the answer change for another response, asset, school project or time period?
- What should a human review before acting on the score?
A method-specific audit before deployment
A surrogate variable analysis audit states the primary variables of interest before estimating hidden factors. SVA seeks latent sources of systematic heterogeneity that are not fully represented by the measured design and includes surrogate variables in the analysis. The method can improve power and reduce spurious association, but it cannot decide causal meaning on its own.
Save the full and null design matrices, feature filtering, number of surrogate variables, estimation algorithm and adjusted regression results. Check whether surrogate variables align with known batch, demographic or technical metadata without assuming those labels explain everything. Test sensitivity to feature sets, sample removal and surrogate count.
Inference must respect how surrogate variables were estimated. Reusing the complete dataset inside a predictive cross-validation loop leaks information. In differential-expression work, report both adjusted and unadjusted results, positive and negative controls and external replication. A hidden factor can protect inference only within the assumptions and evidence of the study.
Frequently asked questions
What is a surrogate variable?
It is an estimated latent covariate representing systematic heterogeneity not fully captured by the measured design.
What problem does SVA address?
It addresses hidden or unmeasured sources of variation that can induce spurious associations, reduce power or distort dependence across features.
Does a surrogate variable identify its cause?
No. It is a statistical factor; metadata and experiments are required to interpret its cause.
Can SVA remove biology?
Yes, if the latent structure overlaps the primary effect or the estimation and design do not protect the variable of interest.
How many surrogate variables are needed?
The number is estimated or selected using method-specific procedures and should be tested for stability and sensitivity.
How is SVA validated?
Compare adjusted and unadjusted inference, controls, known metadata, replication, p-value behaviour and leakage-safe prediction when applicable.
Primary source and fact-check note
Jeffrey T. Leek and John D. Storey, “Capturing heterogeneity in gene expression studies by surrogate variable analysis,” PLOS Genetics 3(9), e161 (2007), DOI 10.1371/journal.pgen.0030161. Definitions and core claims in this article were checked against this primary publication. Calculations shown here were independently recomputed. Examples are educational illustrations; they are not reported industrial performance results.
Useful next reading
Keep the options open. Mathematics education supports clearer questions, transferable problem-solving skills and informed choices across science, engineering, computing, AI, statistics, design and many other careers. It does not guarantee intelligence, income, admission or employment; those outcomes depend on far more than one subject or model.
Extended laboratory: validation, transfer and responsible use
Design-first rule
Write the full and null models before estimating surrogates. The variable of interest must be protected deliberately. Changing the design after inspecting results creates a new analysis. Archive coded matrices so another analyst can see exactly which effects were preserved, omitted or tested.
Feature-selection boundary
SVA may use features selected for association with residual heterogeneity. Fit selection without final-test leakage and record thresholds. A filter influenced by the primary outcome can change what the surrogate represents. Sensitivity to feature filters is part of the inference, not a nuisance to hide.
Surrogate-number check
Compare estimated surrogate counts across bootstrap samples, feature sets and algorithms. If the count is unstable, report a range and test conclusions across it. More surrogates always improve residual fit but can consume power and absorb the primary signal. Stability and replication decide usefulness.
Alignment with metadata
Correlate surrogate variables with recorded batch, site, quality, composition and demographics. Use multiple regression when metadata overlap. A high correlation suggests an explanation but does not prove a single cause. Preserve residual associations and alternative interpretations.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Effect-estimate focus
Compare primary effect sizes and standard errors before and after SVA, not only the number of significant genes. Large sign reversals deserve investigation. Improved p-value calibration can coexist with unstable effect estimates. External replication and known controls help decide which model is more credible.
Dependence across genes
Hidden factors can induce broad correlation among gene-level statistics, affecting multiple testing. Inspect residual correlation and null behaviour after adjustment. A surrogate that reduces dependence may improve inference, but complete independence is neither expected nor required. State the multiple-testing method used.
Small-sample caution
Estimating latent factors and gene-wise effects with few independent samples is difficult. Thousands of genes do not create thousands of subjects. Use simulations matched to the design, conservative claims and external data. Report independent sample size prominently beside feature count.
Prediction leakage
For predictive use, surrogate estimation must be learned inside training data and applicable to a single future sample. Standard SVA workflows may depend on the whole expression matrix. Do not report cross-validated accuracy from globally estimated surrogates. Build and validate a prospective transform or keep the claim inferential.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Comparison with controls
When strong negative controls exist, compare SVA with RUV-2. When batches are known, compare direct covariate adjustment or ComBat. The best choice depends on available information and the scientific target. Agreement across approaches is evidence; disagreement is a reason to investigate.
External replication
Freeze the design and surrogate strategy before a new cohort. Compare effect directions, enriched pathways and calibration. Surrogate variables need not have identical labels across cohorts, but the adjusted scientific conclusion should recur. Differences may reveal population or platform boundaries.
Student hidden-factor lab
Create a matrix from one measured effect and one hidden factor with different loadings. Fit the primary regression alone and with the true or estimated hidden score. Change their correlation to see when adjustment helps, costs power or becomes unidentified.
Release checklist
Verify the PLOS source, full and null designs, feature selection, surrogate count, estimation algorithm, adjusted models, controls, multiple testing and replication. Recalculate the outer-product example, test anchors and present adjusted and unadjusted results with careful scope.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Deep dive: how to stress-test the mathematical claim
Deep dive 1
Study the relationship between surrogate variables and the primary design. Near-collinearity inflates uncertainty and makes separation sensitive to small changes. Report correlations and condition numbers. A mathematically fitted model can still have weak identification for the coefficient people care about.
Deep dive 2
Use residual plots and gene-set summaries to see which features drive each surrogate. A factor supported by a narrow technical region differs from one spread across pathways. Interpretation remains provisional, but the loading pattern guides quality checks and replication plans.
Deep dive 3
Estimate surrogate counts with a documented algorithm and random seed when relevant. Compare nearby counts. If the primary conclusion changes, present that dependence as uncertainty. Hiding the alternatives turns method choice into unreported researcher degrees of freedom.
Deep dive 4
For time-course data, hidden factors can have temporal structure. Standard sample factors may mix trend, batch and subject effects. Preserve repeated-measure grouping and compare models that represent time explicitly. More surrogates are not a substitute for the correct longitudinal design.
Deep dive 5
When cell composition affects bulk expression, a surrogate may represent real population biology as well as technical heterogeneity. Removing it can change the estimand. State whether the goal is total association, cell-intrinsic effect or another target. Adjustment choices follow the question.
Deep dive 6
Check p-value histograms by negative-control sets and simulated null contrasts. Uniformity is informative only where the null is credible. An overall histogram can look acceptable while a subgroup or pathway remains confounded. Combine diagnostics with effect sizes and replication.
Deep dive 7
Compare ordinary, measured-covariate and SVA-adjusted models. This reveals what the surrogate adds beyond recorded metadata. If measured quality variables explain the same factor, the simpler explicit model may be easier to govern and interpret.
Deep dive 8
Do not use surrogate variables as evidence that a named hidden cause exists. They summarise dependence. Experimental validation or direct measurement is needed to name the mechanism. Neutral labels preserve flexibility as new metadata become available.
Deep dive 9
For prediction, assess whether surrogate estimation can be frozen and applied to one sample. If it requires the test cohort jointly, the method is transductive. State that limitation and avoid claims of real-time deployment without a validated prospective transform.
Deep dive 10
Independent review should reconstruct full and null projectors, surrogate estimates and one gene-wise model. Confirm sample order and feature filters. This audit often catches errors that significance tables cannot reveal because wrong surrogates can still produce plausible p-values.
Worked evidence notebook
Design ledger
Archive full and null matrices with column meanings, coding and ranks. Add the feature filter and sample exclusions used to estimate surrogates. This ledger makes clear what the method protects and what remains eligible to become a surrogate. It also catches accidental collinearity or missing intercepts.
Surrogate ledger
For each surrogate, save sample scores, feature weights, metadata associations and stability across resamples. Use neutral labels until evidence supports interpretation. A factor correlated with batch and cell composition should not be named after only one. The ledger preserves alternative explanations.
Effect comparison
Place unadjusted, measured-covariate and SVA-adjusted effect estimates side by side for controls and important genes. Focus on direction, magnitude and uncertainty. This reveals whether surrogates improve precision, reverse conclusions or absorb the primary signal. Report disagreements rather than selecting one table silently.
Null calibration
Use credible negative controls, permutations respecting the design and simulations matched to residual structure. Evaluate false-positive behaviour and dependence. Uniform-looking global p-values are insufficient if nulls are uncertain or one subgroup remains confounded. Calibration evidence should be local to the actual question.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
External contract
Freeze design, surrogate count method and reporting before replication. A second cohort can have different hidden factors, but adjusted biological conclusions should recur. Report changes in sample composition and platform. Replication tests the claim, not whether every surrogate receives the same label.
Reader checkpoint
A trustworthy SVA analysis identifies the primary variable, full and null designs, surrogate estimation, count, adjusted inference, sensitivity and replication. It says that surrogates summarise hidden heterogeneity rather than proving a hidden cause. Those boundaries let the mathematics improve inference without overstating certainty.
A final worked scenario
A final hidden-factor scenario
Imagine a gene-expression study in which disease status is measured, but RNA quality and cell composition are only partly recorded. The full and null models are fixed before analysis. SVA estimates two surrogate variables; one correlates with quality and the other with both site and composition. Including them reduces residual dependence and improves replication of disease-effect directions in another cohort. Several genes reverse sign, so the team inspects raw values, measured covariates and sensitivity to surrogate count rather than celebrating a larger significance list. The second cohort has different surrogate patterns, yet the adjusted pathway conclusion recurs. The report therefore distinguishes statistical and causal claims: surrogate variables capture systematic heterogeneity, but they do not prove which hidden causes generated it. This is why mathematics is important. Latent factors can protect an estimate from patterns the original design missed, while clear models, controls and replication prevent those factors from becoming an unsupported story about biology.
Method checklist and conclusion boundary
A compact reproducibility checklist
Freeze the primary variable, full model, null model, feature filter and sample exclusions before estimating surrogates. Check matrix ranks and sample order, then save the surrogate-count rule, score matrix, feature weights and adjusted regression design. Compare unadjusted, measured-covariate and surrogate-adjusted effects. Repeat the analysis across defensible feature sets and surrogate counts, inspect associations with known metadata and test credible nulls. Finally, apply the prespecified workflow to an external cohort and compare scientific conclusions. These steps expose whether hidden-factor adjustment is stable or depends on one convenient configuration. Preserve every comparison so later reviewers can reconstruct why the chosen specification was considered credible.
What a careful conclusion sounds like
A careful conclusion says that surrogate variables captured systematic residual heterogeneity and that adjustment improved a defined calibration or replication result. It identifies genes or conclusions that remain sensitive and keeps causal explanations tentative. A surrogate can combine technical quality, cell composition, site and unmeasured biology, so a correlation with one recorded variable does not fully name it. This wording preserves the value of latent-factor mathematics while respecting its limits. Readers can distinguish a useful statistical summary from a discovered mechanism and can see which new measurement or experiment would clarify the hidden structure.
Final evidence checks
Final evidence checks 1
Archive both adjusted and unadjusted results. Hidden-factor modelling is a sensitivity analysis as well as a primary method. Future evidence may change which model is more credible.
Final evidence checks 2
Do not interpret surrogate labels too quickly. A factor can combine site, quality and composition. Neutral names preserve uncertainty and make later metadata integration honest.
Final evidence checks 3
If a future scoring system needs one-sample predictions, build and validate a prospective transform. A cohort-level inference method should not be presented as live deployment without that contract.
Final evidence checks 4
Use external replication to decide whether adjusted discoveries recur. Improved internal p-values are supportive but cannot establish biological truth alone.
Final evidence checks 5
For students, SVA connects regression, matrices, confounding and responsible inference. It illustrates how mathematics can reveal hidden structure while also showing that hidden structure does not explain itself.
Final evidence checks 6
Independent review should reproduce full and null models, surrogate count, one score and one adjusted gene regression. This audit catches sample-order and design errors that polished significance tables can conceal.