Tutorials › High-Dimensional Genomic Data Analysis › Random Genetic Effects in Association Models

Mixed-Model GWAS, Relatedness and Inflation Diagnostics · Tutorial 243 of 795

Random Genetic Effects in Association Models

You will learn to distinguish a random polygenic background effect from a tested SNP’s fixed association effect and interpret the model’s covariance assumptions.

Advanced 10 min read

What You'll Learn

  • Write the random genetic effect and residual terms in a GWAS linear mixed model.
  • Explain how relatedness determines covariance among modeled background effects.
  • Distinguish the random genetic effect from a tested variant’s fixed effect.
  • Derive the phenotype covariance implied by the model.
  • Recognize assumptions and data problems that can make the random-effect representation misleading.
  • Compare the mixed-model representation with fixed covariates and ordinary regression.

Why Model a Random Genetic Background?

A single-variant association model asks whether a particular genotype is associated with a quantitative trait after accounting for specified covariates. But individuals in a GWAS may also share genetic background: close relatives, for example, tend to have more similar inherited genomes than unrelated individuals. If this background is associated with the phenotype, treating every individual’s unexplained component as independent can misrepresent the uncertainty in a SNP association analysis. The earlier material on why relatedness inflates naive GWAS evidence motivates representing this dependence explicitly.

A linear mixed model separates the effect of the tested variant from a latent, genome-wide background contribution. The tested SNP effect is a fixed coefficient: it describes the mean phenotype change per genotype unit, conditional on the model. The background contribution is a random vector: its values for the sampled individuals are modeled jointly, with dependence specified by a genomic relationship matrix supplied to the analysis.

Definition: For \(n\) individuals and one candidate variant, a GWAS linear mixed model can be written $$ y=C\beta+x_j\alpha_j+g+e. $$ Here \(y\) is the \(n\)-vector of phenotypes; \(C\) is the fixed-covariate design matrix; \(\beta\) is its coefficient vector; \(x_j\) is the genotype vector for variant \(j\); \(\alpha_j\) is the fixed effect per genotype unit; \(g\) is the random genetic background vector; and \(e\) is the residual vector. The model assumes $$ g\sim N_n(0,\sigma_g^2K),\qquad e\sim N_n(0,\sigma_e^2I), $$ with \(g\) and \(e\) independent. The matrix \(K\) is the supplied \(n\times n\) genomic relationship matrix, \(\sigma_g^2\) and \(\sigma_e^2\) are nonnegative variance parameters, and \(I\) is the identity matrix. The design matrices and genotype vector are treated as fixed when describing the model.

The random effect is called genetic because its covariance structure is intended to represent shared polygenic background. It is not a separate estimated causal effect for every SNP, nor does it assert that the analyst has identified which unobserved variants affect the trait. Rather, it is a statistical representation of aggregate background contributions whose values can be correlated across individuals.

The assumptions are substantive. The model specifies a mean-zero multivariate normal distribution for \(g\), with covariance proportional to \(K\); it also specifies independent residuals with common variance \(\sigma_e^2\). The mean structure \(C\beta+x_j\alpha_j\) must be adequate for the fixed effects included. The matrix \(K\) must have the correct individual ordering and be symmetric positive semidefinite, so that \(\sigma_g^2K\) can be a covariance matrix. These assumptions are modeling choices, not facts guaranteed by having genotype data.

What the Random Effect Represents

For individual \(i\), \(g_i\) is that individual’s latent deviation from the fixed mean attributable to the modeled polygenic background. Since \(E(g_i)=0\), it is not a systematic shift assigned to a genotype group. Its dependence with another individual’s background is governed by the corresponding entry of \(K\): if \(K_{ik}\) is larger, the model assigns greater covariance to \(g_i\) and \(g_k\), all else equal. The matrix is a description of the model’s dependence structure, not an observed phenotype.

A useful intuition is that many small, unobserved or unmodeled genetic contributions can collectively produce an individual-level background deviation. Individuals with more similar genetic backgrounds may have correlated deviations. The random-effect model compresses that dependence into \(g\) and \(K\), rather than including a separate fixed coefficient for each background contribution. This is a working approximation: it does not require every actual genetic effect to be small or every relevant variant to be known.

By contrast, \(\alpha_j\) is attached to the particular genotype vector \(x_j\) under study. It describes the modeled mean change associated with one unit of that genotype, with the other fixed terms held constant. The two pieces answer different questions: the candidate-variant coefficient concerns a specified SNP, while \(g\) represents correlated background variation across the sampled individuals.

Worked Example: Separating a Tested SNP Effect From Background

Suppose four hypothetical individuals have genotype dosages \(x_j=(0,1,1,2)^\mathsf{T}\) for a candidate SNP. Consider an intercept of 10 phenotype units, a fixed SNP coefficient \(\alpha_j=1.5\) phenotype units per dosage, and a possible random-background realization \(g=(0.4,0.2,0.1,-0.3)^\mathsf{T}\). Suppose the residual realization is \(e=(0,-0.1,0.1,0)^\mathsf{T}\). The model’s arithmetic gives $$ y_i=10+1.5x_{ij}+g_i+e_i, $$ so the four hypothetical phenotypes are $$ (10.4,\ 11.6,\ 11.7,\ 12.7)^\mathsf{T}. $$

For the first person, the dosage contribution is \(1.5(0)=0\), so the phenotype is \(10+0+0.4+0=10.4\). For the fourth person, it is \(10+1.5(2)-0.3+0=12.7\). The SNP coefficient is the same fixed slope for each person; the background and residual terms vary by person. The listed \(g\) values are only an illustrative possible realization, not estimates or evidence that the background caused any individual’s phenotype.

This example also shows why \(g_i\) should not be described as the effect of the tested SNP. Its role is to capture modeled background variation beyond the fixed mean terms, while \(x_{ij}\alpha_j\) represents the candidate SNP’s modeled contribution.

Covariance Implied by the Model

Although the random effects are not directly observed, their distribution implies a covariance structure for the phenotype vector. Conditional on the fixed design \(C\) and genotype vector \(x_j\), the model mean is \(C\beta+x_j\alpha_j\). Because both random components have mean zero, the expected phenotype vector is that fixed mean. To obtain the covariance, subtract the mean and use the model:

$$ y-E(y\mid C,x_j)=g+e. $$

Independence of \(g\) and \(e\) makes their cross-covariance terms zero. Therefore,

$$ \begin{aligned} \operatorname{Cov}(y\mid C,x_j) &=E\{(g+e)(g+e)^\mathsf{T}\}\\ &=E(gg^\mathsf{T})+E(ee^\mathsf{T})\\ &=\sigma_g^2K+\sigma_e^2I. \end{aligned} $$

The fixed mean structure affects phenotype means, not this conditional covariance. For distinct individuals \(i\) and \(k\), the model assigns covariance \(\sigma_g^2K_{ik}\). Their marginal variances are \(\sigma_g^2K_{ii}+\sigma_e^2\) and \(\sigma_g^2K_{kk}+\sigma_e^2\). Thus their phenotype correlation is $$ \frac{\sigma_g^2K_{ik}} {\sqrt{(\sigma_g^2K_{ii}+\sigma_e^2)(\sigma_g^2K_{kk}+\sigma_e^2)}}. $$ This formula makes clear why an entry of \(K\) is not automatically the phenotype correlation. Even if both diagonal entries of \(K\) equal one, the residual variance contributes to total phenotype variance.

Worked Example: Background Correlation Is Not Phenotype Correlation

For two hypothetical individuals, suppose the supplied relationship matrix is $$ K=\begin{pmatrix}1&0.40\\0.40&1\end{pmatrix}, $$ and suppose \(\sigma_g^2=0.60\) phenotype-units-squared and \(\sigma_e^2=0.40\) phenotype-units-squared. The genetic-background covariance matrix is $$ \sigma_g^2K= \begin{pmatrix}0.60&0.24\\0.24&0.60\end{pmatrix}, $$ because \(0.60(0.40)=0.24\). Since both background variances equal \(0.60\), the modeled correlation between their background effects is \(0.24/\sqrt{0.60(0.60)}=0.40\).

The phenotype covariance matrix adds the residual covariance: $$ \sigma_g^2K+\sigma_e^2I= \begin{pmatrix}1.00&0.24\\0.24&1.00\end{pmatrix}. $$ Each phenotype variance is \(0.60+0.40=1.00\), and the phenotype correlation is \(0.24/\sqrt{1.00(1.00)}=0.24\). Thus \(K_{12}=0.40\) is the modeled background-effect correlation in this example, while the phenotype correlation is \(0.24\). Conditional on the modeled design, the fixed means do not add covariance; they affect the expected phenotypes.

Key takeaway: The random genetic effect models latent, potentially correlated polygenic background deviations. Its covariance is \(\sigma_g^2K\); the conditional phenotype covariance is \(\sigma_g^2K+\sigma_e^2I\). A relationship-matrix entry is not, by itself, a phenotype correlation.

Checking the Representation and Comparing Alternatives

A random genetic effect is useful only to the extent that its assumptions are credible. Before interpreting a fitted model, check that the entries of \(K\) correspond to the same individuals, in the same order, as the phenotype and genotype vectors. Check that \(K\) is symmetric and positive semidefinite. A mismatch in individual order can assign one person another person’s background relationships; an invalid covariance matrix can make the stated random-effect distribution impossible.

Other warning signs concern the model’s statistical assumptions. Strong residual patterns may indicate that the fixed mean or residual model is inadequate. If the dependence in the data is not represented well by \(K\), the assumed covariance may not match the observed dependence. If major structure is omitted from the fixed mean, the random effect is not a universal correction for misspecified means. These checks complement the residual diagnostics and calibration checks used in association analyses; they do not establish that the genetic background model is correct.

The main alternatives target different features of the data. Ordinary linear regression treats unexplained observations as independent under its usual error model; it does not represent relatedness through a structured random effect. Adding fixed covariates, such as ancestry summaries, can adjust the mean for measured structure, but does not in general encode the full pairwise covariance specified by \(K\). Cluster-robust standard errors can adjust uncertainty for some grouped dependence structures, but they do not supply the same model for correlated genetic background. These approaches may be useful in suitable settings, but they are not interchangeable descriptions of the data.

The random-effect representation also has limitations. It summarizes background dependence rather than identifying causal variants, and its interpretation depends on how well \(K\) reflects the relevant genetic similarity. The Gaussian distribution and common residual variance are modeling assumptions; severe departures may affect the quality of the model. Finally, the model’s existence does not guarantee that every association estimate is unbiased or that every uncertainty estimate is well calibrated. Those conclusions depend on the mean and covariance assumptions, the data, and the analysis procedure.

A Short Derivation and Practical Reading

The covariance calculation above follows directly from the model assumptions. To see the role of independence explicitly, expand the centered outer product: $$ (g+e)(g+e)^\mathsf{T} =gg^\mathsf{T}+ee^\mathsf{T}+ge^\mathsf{T}+eg^\mathsf{T}. $$ Since \(g\) and \(e\) are independent and mean zero, \(E(ge^\mathsf{T})=E(g)E(e^\mathsf{T})=0\), and likewise \(E(eg^\mathsf{T})=0\). The two remaining expectations are their covariance matrices, \(\sigma_g^2K\) and \(\sigma_e^2I\). Their sum yields the claimed phenotype covariance. This argument also shows exactly where independence enters; if the two components were dependent, cross-covariance terms would have to be included.

When reading a model specification, interpret \(K\) as describing how the random background effects co-vary, \(\sigma_g^2\) as the multiplier of that structure, and \(\sigma_e^2\) as the residual variance under the stated model. Do not read \(g\) as a measured genotype, a fixed covariate, or the tested SNP’s coefficient. Keeping those roles distinct is the central step in understanding why the model can account for relatedness without replacing the candidate-variant effect.

Worked Example: Unequal Diagonal Entries Change the Correlation

For two hypothetical individuals, suppose $$ K=\begin{pmatrix}1&0.30\\0.30&2\end{pmatrix}, \qquad \sigma_g^2=0.50,\qquad \sigma_e^2=0.50. $$ This \(K\) is symmetric and positive definite: its determinant is \(2-(0.30)^2=1.91>0\), and its first diagonal entry is positive. The background covariance matrix is $$ \sigma_g^2K= \begin{pmatrix}0.50&0.15\\0.15&1.00\end{pmatrix}. $$ The phenotype covariance matrix is $$ \sigma_g^2K+\sigma_e^2I= \begin{pmatrix}1.00&0.15\\0.15&1.50\end{pmatrix}. $$ The phenotype correlation is therefore $$ \frac{0.15}{\sqrt{1.00(1.50)}}\approx 0.1225. $$ The off-diagonal entry \(K_{12}=0.30\) is not this correlation. In particular, the total variances differ because the diagonal entries of \(K\) differ, so the correlation must use both total variances in its denominator.

Common Mistakes

  • Equating a relationship entry with phenotype correlation. The reasoning “\(K_{ik}=0.40\), so the phenotypes have correlation \(0.40\)” ignores the variance components. Under the stated model, phenotype covariance is \(\sigma_g^2K+\sigma_e^2I\); correlation uses that covariance and the total variances.
  • Treating \(g\) as the tested SNP effect. The tested SNP is represented by \(x_j\alpha_j\). The random vector \(g\) represents modeled polygenic background.
  • Calling \(g\) an observed measurement. It is latent and specified through a probability distribution. A realization may be discussed conceptually, but it is not a directly recorded phenotype or genotype.
  • Assuming fixed covariates and a random effect do the same job. Fixed covariates model mean differences; the random effect specifies structured covariance among background deviations. One does not generally substitute for the other.
  • Assuming the model removes all confounding. The model adjusts according to its stated mean and covariance assumptions. A poorly aligned \(K\), omitted mean structure, or other misspecification can still matter.

Check Your Understanding

Answer each question using the model assumptions stated above. Solutions follow the questions.

  1. In one sentence each, distinguish the role of \(\alpha_j\) from the role of \(g\).
  2. If \(K_{ik}=0.25\), \(\sigma_g^2=0.80\), and \(i\ne k\), what is the modeled phenotype covariance between individuals \(i\) and \(k\)?
  3. With \(K_{ii}=K_{kk}=1\), \(\sigma_g^2=0.80\), and \(\sigma_e^2=0.20\), what is the phenotype correlation if \(K_{ik}=0.25\)?
  4. Why does adding fixed ancestry covariates not generally reproduce the random genetic effect’s covariance representation?

Solutions. (1) \(\alpha_j\) is the fixed mean effect per genotype unit for the candidate SNP, whereas \(g\) is a latent vector of correlated polygenic background deviations. (2) Because the individuals are distinct, the identity matrix contributes zero off the diagonal, so the covariance is \(\sigma_g^2K_{ik}=0.80(0.25)=0.20\) phenotype-units-squared. (3) Each phenotype variance is \(0.80+0.20=1.00\), and the covariance is \(0.20\), so the correlation is \(0.20/\sqrt{1.00(1.00)}=0.20\). (4) Fixed ancestry covariates adjust the modeled mean for those covariates, while the random effect specifies covariance among individuals through \(K\); mean adjustment does not generally encode that pairwise covariance.

Clinical Biostats