Tutorials › Statistical Genetics › Choosing Principal Components for Confounding Control

Population Stratification Control · Tutorial 185 of 989

Choosing Principal Components for Confounding Control

Use complementary genomic and phenotype diagnostics to choose principal components for confounding control without tuning the adjustment to association-test significance.

Intermediate 10 min read

What You'll Learn

  • Interpret eigenvalue patterns and ancestry plots when deciding how many principal components to consider.
  • Identify when a principal component may represent ancestry variation relevant to confounding.
  • Use phenotype and covariate diagnostics to assess candidate adjustment sets.
  • Apply a confounding-bias calculation to understand why omitting a component can matter.
  • Explain why choosing the number of components from association significance alone is unreliable.

Why the Number of Components Is a Modeling Choice

Principal-component adjustment can reduce confounding by ancestry, but it requires a choice: how many components should enter the association regression? Too few may leave relevant ancestry variation uncontrolled; adding components without a reason can use degrees of freedom, reduce precision, or adjust for variation that is not a confounder. There is no universal number that is correct for every cohort and phenotype.

A defensible choice combines information about the genotype data’s structure with diagnostics about the phenotype and the association model. Eigenvalues and ancestry plots help identify important genetic variation. Phenotype and covariate diagnostics help assess whether that variation could matter for confounding. The association p-value of a target genetic variant should not, by itself, determine the number of components.

What the Components Summarize

Principal components are calculated from genetic data, commonly after quality control and linkage-disequilibrium pruning. In a standard setup, genotypes are centered and scaled at each variant, and PCA finds directions that summarize variation across the sampled individuals. The score of an individual on a component is a coordinate along one of these directions. Its eigenvalue measures the amount of genotype variation captured by that direction relative to the others.

Definition: A principal component (PC) is a data-derived direction of variation in the genotype matrix. Individuals’ scores on a PC are called PC scores. The ordered eigenvalues quantify the genotype variation represented by the corresponding components; a larger eigenvalue means that the component captures more variation in the analyzed data. Neither a PC nor its eigenvalue, by itself, establishes that the variation is ancestry-related or confounding the phenotype.

For a quantitative phenotype, a typical adjusted association model for one variant is

$$ Y_i = \beta_0 + \beta_G G_i + \sum_{j=1}^{K}\gamma_j PC_{ij} + \varepsilon_i . $$

Here \(Y_i\) is the phenotype for individual \(i\), \(G_i\) is the variant genotype coded as an allele count, \(PC_{ij}\) is individual \(i\)’s score on component \(j\), and \(K\) is the number of included components. The coefficient \(\beta_G\) is the association estimate conditional on the included PCs and any other model covariates. This linear model presumes that its mean structure is appropriate, errors have mean zero conditional on the predictors, and the observations are handled in a way consistent with the model. Choosing \(K\) does not repair violations of those assumptions.

The same selection logic applies when the phenotype model is not linear: the PCs are candidate adjustment variables, but the regression form and assumptions must fit the outcome. The focus here is deciding which components to consider, not choosing a model for every phenotype type.

Three Sources of Evidence

Start with a candidate range of components, then assess whether each additional component contributes a plausible, relevant dimension of population structure.

  • Eigenvalue pattern. Inspect a scree plot or the ordered eigenvalues. A sharp drop followed by a flatter tail can indicate a small set of dominant directions. A gradual decline provides less support for a single cutoff. Eigenvalues are clues about genotype variation, not a formal test that identifies the “true” number of ancestry groups.
  • Ancestry plots. Plot PC scores, often PC1 against PC2 and then other leading pairs. Look for broad clusters, gradients, or separation that is interpretable in the cohort’s sampling context. A plot can reveal structure spread across more than the first two PCs. Conversely, visible clusters do not prove that every component separating them confounds the association.
  • Confounding diagnostics. Ask whether candidate PCs relate to the phenotype or its important predictors, and whether the genotype of interest is associated with those PCs. A component related to both genotype and phenotype can contribute to confounding. Consider changes in the genetic effect estimate and its uncertainty across reasonable adjustment sets, not only whether a coefficient crosses a significance threshold.

These checks should be interpreted together. A component can have a modest eigenvalue yet represent variation relevant to the phenotype. Another can have a large eigenvalue but be unrelated to the phenotype and the genetic association being studied. Prior knowledge about recruitment sites or ancestry can inform interpretation, but should not be used to label a component with certainty when the data do not support that interpretation.

Why Omitting a Relevant Component Can Bias an Estimate

The basic omitted-variable calculation explains why the phenotype diagnostics matter. Suppose, for illustration, that the relevant model has one PC \(C\):

$$ Y_i = \beta_0 + \beta_G G_i + \gamma C_i + \varepsilon_i, \qquad E(\varepsilon_i\mid G_i,C_i)=0. $$

If \(C\) is omitted and \(Y\) is regressed on \(G\) alone, the population slope is

$$ \frac{\operatorname{Cov}(G,Y)}{\operatorname{Var}(G)} = \beta_G + \gamma\frac{\operatorname{Cov}(G,C)}{\operatorname{Var}(G)}. $$

To see this, substitute the model for \(Y\) into its covariance with \(G\). The intercept contributes zero covariance, and the conditional mean-zero error contributes zero covariance under the stated assumption. The remaining terms are \(\beta_G\operatorname{Var}(G)+\gamma\operatorname{Cov}(G,C)\); division by \(\operatorname{Var}(G)\) gives the expression. Thus, omission shifts the slope when \(C\) predicts the phenotype (\(\gamma\ne0\)) and is associated with genotype (\(\operatorname{Cov}(G,C)\ne0\)). This is a justification for checking both relationships, not a rule that every PC must be included.

Worked Example: Reading an Eigenvalue Pattern and an Ancestry Plot

Suppose a hypothetical cohort has eight leading eigenvalues, in arbitrary but consistent units, of 8.2, 4.1, 1.7, 1.5, 1.3, 1.2, 1.1, and 0.9. Their sum is 20.0. A PC1-versus-PC2 plot shows two broad groups, while a PC2-versus-PC3 plot shows that PC3 separates a smaller gradient within one group. What would be a reasonable initial choice?

The first two components account for \((8.2+4.1)/20.0=0.615\), or 61.5%, of the displayed eigenvalue sum. The first three account for \((8.2+4.1+1.7)/20.0=0.700\), or 70.0%. The decrease from 4.1 to 1.7 is substantial, and the remaining values form a comparatively shallow tail. This pattern suggests that the first few components deserve attention, but it does not prove that two is the correct adjustment count.

The plot adds information: PC3 represents a visible gradient not captured by the two-group separation in the first plot. A defensible next step is to compare candidate adjustment sets including the first two and the first three PCs, then check whether PC3 is related to the phenotype or relevant predictors and whether genotype associations with that component are plausible. If those checks suggest confounding relevance, three PCs may be more defensible. The plots alone do not justify a final choice, and the eigenvalue percentages are relative to these eight displayed values, not necessarily to all genotype variation.

Worked Example: Quantifying the Possible Omission Bias

In a hypothetical quantitative-trait analysis, a target genotype \(G\) has variance 0.80, and a candidate ancestry score \(C\) has covariance with \(G\) equal to 0.17. Suppose the PC-adjusted model estimates \(\beta_G=0.25\) trait units per allele and \(\gamma=0.80\) trait units per PC-score unit. Under the one-PC model and assumptions above, calculate the slope expected if \(C\) is omitted.

The omitted-variable shift is

$$ \gamma\frac{\operatorname{Cov}(G,C)}{\operatorname{Var}(G)} = 0.80\frac{0.17}{0.80} = 0.17. $$

Therefore the unadjusted population slope in this illustration is \(0.25+0.17=0.42\) trait units per allele. The calculation shows why a component can matter when it is associated with both genotype and phenotype. It is not a guarantee that a fitted estimate will move by exactly 0.17: the quantities are hypothetical population relationships, and real analyses have sampling variability and may involve several covariates and PCs.

A Practical Selection Workflow

A useful workflow separates the decision about population structure from the search for a favorable association result. It records why a component set was chosen and checks whether the conclusion is sensitive to reasonable alternatives.

1
Prepare and inspect the PCA inputs.
Use a documented genotype set and preprocessing scheme appropriate for estimating broad structure. Record which individuals and variants contributed, since changing them can change PC scores and eigenvalues.
2
Review eigenvalues and plots.
Identify dominant eigenvalue drops, if present, and plot leading score pairs. Note whether the structure looks like separated groups, a gradient, or a more complex pattern, without treating a visual impression as proof.
3
Check candidate PCs for relevance to confounding.
Examine their relationships with phenotype and relevant design covariates, and their relationships with the genotype or genetic predictors under study. Interpret these checks in context and account for the scale and form of the variables.
4
Compare a small set of justified models.
Fit the planned model with defensible candidate values of \(K\). Compare effect estimates, standard errors, and uncertainty, not just p-values. Choose and report a count with its rationale; describe sensitivity if conclusions differ across candidates.

The number of PCs should generally be set by a cohort-level strategy rather than chosen separately for every tested variant to make its result more significant. A prespecified strategy can use the structure plots and phenotype diagnostics to set a primary adjustment, with a small number of alternative counts used as sensitivity checks. The relevant outcome is whether the estimated association and its interpretation are robust, not whether one model happens to produce the smallest p-value.

Worked Example: Choosing Between Two Candidate Counts

A hypothetical analysis has four candidate leading PCs. The first two eigenvalues are 6.0 and 3.5; the next two are 2.8 and 2.6, followed by values near 2.4. A plot shows broad separation on PC1 and a gradient on PC2. The phenotype’s group means differ along PC1, while PC2 is also associated with a recruitment-site covariate. For a target variant, the estimated effect is 0.31 trait units per allele with two PCs and 0.30 with four PCs. What is a defensible decision?

The eigenvalues do not show a sharp cutoff after PC2: the next values, 2.8 and 2.6, are not negligible relative to 3.5. The phenotype and site diagnostics make the first two components plausible confounding controls. They do not, on their own, establish that PCs 3 and 4 are necessary; their plots and relationships to phenotype, site, and genotype should also be examined.

The target effect changes by \(0.30-0.31=-0.01\) trait units per allele when moving from two to four PCs. That is a small change in this example, although uncertainty and the study’s scientific scale still matter. If PCs 3 and 4 show no additional relevant structure, choosing two as the primary adjustment with four as a sensitivity analysis is defensible. If further diagnostics show that either captures phenotype-related ancestry associated with the genotype, including it may be preferable. The decision is based on structure and confounding evidence, not on which count yields a more favorable p-value.

Common Mistakes and Interpretation

  • Using a fixed number as a universal rule. “Always include ten PCs” ignores cohort size, structure, phenotype, and study design. A conventional count can be a starting point, not a substitute for diagnostics.
  • Choosing \(K\) to minimize a target SNP’s p-value. This makes the adjustment outcome-dependent and can encourage a chance finding. Use a rationale based on the structure and confounding question, and report sensitivity to reasonable choices.
  • Treating every large eigenvalue as a confounder. Large eigenvalues show substantial genotype variation, not that the component is related to the phenotype or the genetic predictor in a confounding pattern.
  • Assuming a small eigenvalue is irrelevant. A lower-variance component can still matter for a particular phenotype or sampling design. Assess its context rather than imposing a cutoff based only on size.
  • Interpreting stability as proof of no confounding. Similar estimates across two candidate counts are reassuring about that comparison, but do not establish that all population structure has been controlled.

In the final report, state how the PCA inputs were prepared, which diagnostics informed the count, how many PCs were included, and whether conclusions changed under reasonable alternatives. This makes the adjustment understandable and reproducible. It also keeps the interpretation appropriately limited: PC adjustment can address some broad ancestry-related structure, but it does not by itself prove that an association is causal or eliminate every source of bias.

Key takeaway: Choose the number of PCs by combining eigenvalue patterns, ancestry plots, and evidence that candidate components relate to phenotype and genetic predictors. Use association estimates and uncertainty to assess sensitivity, but do not select \(K\) solely to obtain a desired significance result.

Check Your Understanding

Answer each question using the distinction between genotype structure and confounding relevance.

  1. A scree plot has a gradual decline with no obvious elbow. What other evidence would help you choose a candidate number of PCs?
  2. In the omitted-variable expression, what two relationships must hold for omission of a PC to shift the genotype slope under the stated model?
  3. Why can a component with a modest eigenvalue still be worth evaluating for adjustment?
  4. A target variant becomes statistically significant only after increasing \(K\) from two to eight. Why is selecting eight solely for that reason problematic?
  5. What should a report include so readers can assess the rationale and sensitivity of the chosen PC count?
Clinical Biostats