Why Correlated Phenotypes Change the Regression Calculation
In a quantitative-trait genome-wide association study, individuals can be related, so their phenotypes may share genetic contributions. A regression that treats every phenotype as independent can then assign the wrong relative weight to observations and misstate the uncertainty in estimated effects. Generalized least squares (GLS) addresses this by using the phenotype covariance matrix in the regression calculation.
The starting point is the covariance decomposition in a GWAS linear mixed model: a random genetic contribution has covariance determined by the genomic relationship matrix, and an independent residual contribution adds residual variance. Here the focus is what follows from that covariance: how to derive the GLS coefficient estimator and its variance, conditional on the covariance being specified.
Model and Assumptions
Here \(K\) is the genomic relationship matrix, \(I\) is the \(n \times n\) identity matrix, and \(\sigma_g^2\) and \(\sigma_e^2\) are the genetic and residual variance components. For the GLS formula, treat \(V\) as known and positive definite. A positive-semidefinite \(K\) and \(\sigma_e^2>0\) are sufficient for positive definiteness in this model. Also require that \(X\) have full column rank, so its \(q\) columns are linearly independent.
The fixed-effects columns may include an intercept and a genotype dosage column. For example, coding the number of effect alleles as 0, 1, or 2 gives a coefficient in phenotype units per additional effect allele, conditional on the other columns in \(X\). The GLS derivation itself does not require the errors to be normally distributed: the mean and covariance assumptions suffice for unbiasedness and the covariance formula. If \(y\) is multivariate normal, then the GLS estimator is normally distributed as well.
Deriving the GLS Estimator
When errors are independent with equal variance, ordinary least squares minimizes the sum of squared residuals. With correlated errors, residuals in directions of high variance should count less than residuals in directions of low variance. GLS therefore minimizes the residual quadratic form weighted by \(V^{-1}\).
Because \(V\) is positive definite, \(V^{-1}\) exists and is positive definite. Differentiate \(Q(b)\) with respect to \(b\), set the derivative equal to zero, and solve the resulting normal equations:
Full column rank of \(X\) makes \(X^\mathsf{T}V^{-1}X\) positive definite and invertible. Thus the unique minimizer is:
This is a linear transformation of the phenotype vector. Its expectation and covariance follow directly from the model assumptions.
For the covariance result, write \(A=(X^\mathsf{T}V^{-1}X)^{-1}X^\mathsf{T}V^{-1}\), so \(\hat{\beta}_{GLS}=Ay\). Then \(AVA^\mathsf{T}=(X^\mathsf{T}V^{-1}X)^{-1}\), using symmetry of \(V\). A coefficient contrast \(c^\mathsf{T}\hat{\beta}_{GLS}\) consequently has variance \(c^\mathsf{T}(X^\mathsf{T}V^{-1}X)^{-1}c\). The square root of a coefficient’s variance is its standard error, in the same units as that coefficient.
Worked Example: GLS for a Shared Mean
Suppose two hypothetical phenotype measurements have mean \(\mu\) and covariance matrix \(V=\begin{pmatrix}4&1\\1&9\end{pmatrix}\). Their observed values are \(y=(2,5)^\mathsf{T}\). The model is \(y=\mathbf{1}\mu+\varepsilon\), where \(\mathbf{1}=(1,1)^\mathsf{T}\). The diagonal variances are positive and the determinant of \(V\) is \(36-1=35>0\), so \(V\) is positive definite. The design matrix \(\mathbf{1}\) has full column rank.
First calculate the inverse covariance and the quantities in the GLS formula:
Therefore, \(\hat{\mu}_{GLS}=(31/35)/(11/35)=31/11=2.818\) phenotype units. Its variance is the reciprocal of \(\mathbf{1}^\mathsf{T}V^{-1}\mathbf{1}\), namely \(35/11=3.182\) phenotype units squared; its standard error is \(\sqrt{35/11}=1.784\) phenotype units. The arithmetic mean, \(3.5\), gives the two observations equal weight, whereas GLS gives greater relative weight to the observation with the smaller variance.
GLS in a Genotype Regression
For a genotype association model, \(X\) can contain an intercept and genotype dosage. The following calculation shows how a non-diagonal covariance affects both coefficients and their covariance. As in the preceding example, all data and covariance values here are hypothetical.
Worked Example: Intercept and Genotype Dosage with Correlated Errors
Let the three dosages be \(0,1,2\), let the observed phenotypes be \(y=(1,3,4)^\mathsf{T}\), and let \(X=\begin{pmatrix}1&0\\1&1\\1&2\end{pmatrix}\). Suppose the specified covariance is \(V=\begin{pmatrix}2&1&0\\1&2&0\\0&0&1\end{pmatrix}\). Its first \(2 \times 2\) block has positive eigenvalues 1 and 3, and its final diagonal entry is 1, so \(V\) is positive definite. The intercept and dosage columns are linearly independent, as required.
The inverse is \(V^{-1}=\begin{pmatrix}2/3&-1/3&0\\-1/3&2/3&0\\0&0&1\end{pmatrix}\). Multiplying gives \(V^{-1}y=(-1/3,5/3,4)^\mathsf{T}\). The GLS normal-equation matrix and right-hand side are:
The inverse of the first matrix is \(\begin{pmatrix}2&-1\\-1&5/7\end{pmatrix}\). Hence:
The estimated intercept is 1 phenotype unit, and the estimated dosage coefficient is \(11/7=1.571\) phenotype units per additional effect allele. Under the specified, treated-as-known covariance, the coefficient covariance matrix is \(\begin{pmatrix}2&-1\\-1&5/7\end{pmatrix}\). Thus the dosage coefficient has variance \(5/7=0.7143\) phenotype units squared and standard error \(\sqrt{5/7}=0.8452\) phenotype units per allele.
Why GLS Is Efficient, and What Its Assumptions Buy
Among linear unbiased estimators, GLS has the smallest covariance in the positive-semidefinite ordering when \(V\) is the true covariance. This is the generalized least-squares form of the Gauss–Markov result. To see the justification, let \(B=(X^\mathsf{T}V^{-1}X)^{-1}X^\mathsf{T}V^{-1}\) be the GLS coefficient matrix, and let \(A y\) be any other linear unbiased estimator. Unbiasedness for every \(\beta\) requires \(AX=I_q\), and \(BX=I_q\). Set \(D=A-B\); then \(DX=0\). Expanding the covariance difference gives:
The cross terms vanish because \(VB^\mathsf{T}=X(X^\mathsf{T}V^{-1}X)^{-1}\), so \(DVB^\mathsf{T}=DX(X^\mathsf{T}V^{-1}X)^{-1}=0\); the transpose term is zero as well. Finally, \(DVD^\mathsf{T}\) is positive semidefinite because \(V\) is positive definite. This establishes the covariance comparison without requiring normality.
When \(V=\sigma^2I\), the GLS formula reduces to ordinary least squares, \((X^\mathsf{T}X)^{-1}X^\mathsf{T}y\). If errors are correlated, ordinary least squares can still be unbiased under the stated mean model, but its usual independent-error covariance formula is generally wrong and it does not exploit the covariance structure. Diagonal weighted least squares is appropriate when observations are uncorrelated but have different variances; it does not account for off-diagonal covariance. GLS handles both unequal variances and correlations.
A Mixed-Model Covariance Calculation
Worked Example: From a Relationship Matrix to a GLS Standard Error
Consider two hypothetical individuals with \(K=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}\), \(\sigma_g^2=2\) phenotype units squared, and \(\sigma_e^2=1\) phenotype units squared. The matrix \(K\) has eigenvalues 0.5 and 1.5, so it is positive definite. With independent residual errors, the mixed-model covariance is:
Let dosage be \(x=(0,1)^\mathsf{T}\), let \(X=\begin{pmatrix}1&0\\1&1\end{pmatrix}\), and let \(y=(2,5)^\mathsf{T}\). The determinant of \(X\) is 1, so \(X\) has full rank. Here there are two observations and two coefficients; the illustration treats the variance components as known rather than estimating them from these observations. Since \(X\) is square and invertible, the fitted coefficients are exactly the line through the two observations: intercept \(2\) phenotype units and dosage coefficient \(3\) phenotype units per allele.
Their covariance still depends on \(V\). Direct multiplication gives \(X^\mathsf{T}V^{-1}X=\begin{pmatrix}1/2&1/4\\1/4&3/8\end{pmatrix}\), whose inverse is \(\begin{pmatrix}3&-2\\-2&4\end{pmatrix}\). The dosage coefficient variance is therefore \(4\) phenotype units squared, and its standard error is \(2\) phenotype units per allele. The coefficient estimate is determined by the two points in this saturated example, but its uncertainty calculation still reflects the specified covariance.
Diagnostics, Limitations, and a Common Pitfall
GLS is only as appropriate as its mean and covariance assumptions. In a mixed-model GWAS, the covariance depends on the relationship matrix and the variance components. If the specified \(V\) poorly describes the dependence or variability in the phenotypes, the GLS weights and the resulting coefficient covariance can be unreliable. Residual diagnostics from quantitative-trait GWAS can help identify patterns inconsistent with the fitted model; a covariance matrix should also be checked for symmetry and positive definiteness before it is used.
The formulas above condition on \(V\) being known. In practice, variance components are estimated, so replacing \(V\) by an estimate gives a feasible GLS calculation. The displayed covariance formula then treats that estimate as fixed; it does not, by itself, account for uncertainty from estimating the variance components. Estimating those components is a separate part of mixed-model fitting.
- Rank failure: If a column of \(X\) is redundant, then \(X^\mathsf{T}V^{-1}X\) is singular and the stated unique estimator does not exist. Remove or reparameterize redundant columns.
- Invalid covariance: A non-positive-definite \(V\) cannot be used in this GLS formula. Check the covariance construction and parameters rather than attempting to interpret an invalid inverse.
- Numerical instability: Explicitly forming \(V^{-1}\) is often less stable than solving linear systems using a factorization of \(V\). The mathematical estimator is unchanged by using stable linear algebra.
- Overstated certainty: A standard error computed with estimated variance components is not automatically a complete accounting of all uncertainty. State whether the covariance was treated as known or estimated.
Common mistake: “The phenotype correlation is positive, so GLS must increase the standard error of every coefficient.” That conclusion does not follow. GLS changes the weighting and the covariance of all fitted coefficients; the effect on a particular coefficient’s variance depends on \(X\) and the full matrix \(V\). Compare the relevant diagonal entry of \((X^\mathsf{T}V^{-1}X)^{-1}\), rather than inferring its direction from one correlation alone.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Why must \(X\) have full column rank for the stated GLS estimator?
- If \(V=\sigma^2I\), what familiar estimator does GLS reduce to?
- In a two-coefficient model, the dosage coefficient has variance \(0.36\) phenotype units squared. What is its standard error and, if dosage counts alleles, what are its units?
- Does a positive off-diagonal entry in \(V\) alone prove that GLS will increase the variance of every fitted coefficient? Explain.
Solutions. (1) Full column rank makes \(X^\mathsf{T}V^{-1}X\) invertible, giving a unique coefficient vector. (2) It reduces to ordinary least squares, \((X^\mathsf{T}X)^{-1}X^\mathsf{T}y\). (3) The standard error is \(\sqrt{0.36}=0.6\) phenotype units per allele. (4) No. Each coefficient variance depends on the design matrix and the entire covariance matrix, so the relevant entry of \((X^\mathsf{T}V^{-1}X)^{-1}\) must be calculated.