Tutorials › High-Dimensional Genomic Data Analysis › Inverse-Variance Weighting With Correlated Variants

Mendelian Randomization · Tutorial 666 of 795

Inverse-Variance Weighting With Correlated Variants

You will learn to incorporate linkage-disequilibrium covariance into IVW estimation, calculate uncertainty, and recognize when treating correlated variants as independent misstates the evidence.

Advanced 12 min read

What You'll Learn

  • Write the summary-association model for IVW with correlated variants.
  • Derive the generalized least-squares estimator and its standard error.
  • Construct an outcome-association covariance matrix from standard errors and signed LD correlations.
  • Compare LD-aware inference with the incorrect independence calculation.
  • Recognize covariance-matrix problems and distinguish LD adjustment from instrument-validity assumptions.

Why Correlated Variants Change IVW

Inverse-variance weighted (IVW) Mendelian randomization combines variant-specific information about an exposure and an outcome. The usual independent-variant calculation treats each outcome-association estimate as providing separate information. But variants in linkage disequilibrium (LD) are correlated: their association estimates may move together, so they do not provide as much independent information as the same number of unrelated variants. Ignoring that dependence can change both the estimated causal effect and its reported uncertainty.

The remedy is to use generalized least squares (GLS), which weights the association estimates by their full covariance matrix rather than by their individual variances alone. The calculation adjusts for dependence; it does not make invalid instruments valid. The instrumental-variable assumptions and the choice and harmonization of variants remain essential.

Model and Assumptions

Suppose \(K\) variants have harmonized exposure-association estimates collected in the vector \(\hat{\boldsymbol{\beta}}_X\) and outcome-association estimates collected in \(\hat{\boldsymbol{\beta}}_Y\). Let \(\theta\) be the causal effect of the exposure on the outcome, on the scales used for the associations. In the first-order IVW model, treat the exposure estimates as fixed and write

$$ \hat{\boldsymbol{\beta}}_Y = \theta\hat{\boldsymbol{\beta}}_X+\boldsymbol{\varepsilon}, \qquad \boldsymbol{\varepsilon}\sim N(\boldsymbol{0},\boldsymbol{\Sigma}_Y). $$

Here \(\boldsymbol{\Sigma}_Y\) is the \(K\times K\) covariance matrix of the outcome-association estimates. Its diagonal entries are the squared standard errors; its off-diagonal entries describe their dependence. The first-order approximation ignores uncertainty in the exposure-association estimates. It is most defensible when those estimates are sufficiently precise; it is not a substitute for assessing instrument strength.

Definition: The LD-aware IVW estimator is the GLS estimate of the slope \(\theta\) in the model above, with no intercept: $$ \hat{\theta}_{\mathrm{GLS}} = \frac{\hat{\boldsymbol{\beta}}_X^{\,T} \boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_Y} {\hat{\boldsymbol{\beta}}_X^{\,T} \boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X}. $$ If \(\boldsymbol{\Sigma}_Y\) is treated as known and the model holds, its standard error is $$ SE(\hat{\theta}_{\mathrm{GLS}}) = \left( \hat{\boldsymbol{\beta}}_X^{\,T} \boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X \right)^{-1/2}. $$

For a Wald test of \(H_0:\theta=0\), the statistic is \(Z=\hat{\theta}_{\mathrm{GLS}}/SE(\hat{\theta}_{\mathrm{GLS}})\), compared with a standard normal distribution under the model. A two-sided confidence interval is \(\hat{\theta}_{\mathrm{GLS}}\pm 1.96SE(\hat{\theta}_{\mathrm{GLS}})\) for an approximate 95% interval. The effect and interval are in outcome-association units per exposure-association unit; their exact interpretation depends on how the exposure and outcome were measured or scaled.

The calculation requires a correctly aligned, positive-definite covariance matrix (or a justified treatment if it is singular), approximately normal outcome-association errors, and an appropriate linear summary-association model. The variants must also satisfy the instrumental-variable assumptions for a causal interpretation. In particular, accounting for LD addresses dependence between estimates; it does not address instrument-exposure confounding or horizontal pleiotropy.

Deriving the GLS Estimate

Under the model, the part of the negative log-likelihood that depends on \(\theta\) is one half of the covariance-weighted residual sum of squares:

$$ Q(\theta)= (\hat{\boldsymbol{\beta}}_Y-\theta\hat{\boldsymbol{\beta}}_X)^T \boldsymbol{\Sigma}_Y^{-1} (\hat{\boldsymbol{\beta}}_Y-\theta\hat{\boldsymbol{\beta}}_X). $$

Differentiate with respect to \(\theta\), set the derivative to zero, and solve. Since the covariance matrix is symmetric, the two cross-product terms in the derivative are equal.

$$ \begin{aligned} \frac{dQ(\theta)}{d\theta} &=-2\hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1} (\hat{\boldsymbol{\beta}}_Y-\theta\hat{\boldsymbol{\beta}}_X),\\ 0 &=\hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_Y -\hat{\theta}_{\mathrm{GLS}} \hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X,\\ \hat{\theta}_{\mathrm{GLS}} &= \frac{\hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_Y} {\hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X}. \end{aligned} $$

The denominator is positive when \(\boldsymbol{\Sigma}_Y\) is positive definite and the exposure-association vector is nonzero. For the standard error, the estimator can be written as a linear combination of the outcome estimates, with coefficient vector \[ \frac{\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X} {\hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X}. \] Its variance is that coefficient vector transposed, multiplied by \(\boldsymbol{\Sigma}_Y\), then by the coefficient vector. Cancelling the inverse matrices gives the reciprocal of the denominator, yielding the stated standard error.

Worked Examples

Worked Example: Correlation Changes the Significance

Consider two hypothetical variants with exposure associations \(\hat{\boldsymbol{\beta}}_X=(0.10,0.08)^T\), outcome associations \(\hat{\boldsymbol{\beta}}_Y=(0.05,0.02)^T\), and outcome standard errors of \(0.02\) for each variant. Suppose their signed LD correlation is \(0.50\). The corresponding outcome-association covariance matrix is \[ \boldsymbol{\Sigma}_Y=0.0004 \begin{pmatrix}1&0.50\\0.50&1\end{pmatrix}. \]

Its inverse is \(\frac{1}{0.0004(1-0.50^2)} \begin{pmatrix}1&-0.50\\-0.50&1\end{pmatrix}\). The common factor cancels in the estimate. The numerator's unscaled cross-product is \[ 0.10(0.05)+0.08(0.02)-0.50\{0.10(0.02)+0.08(0.05)\} =0.0066-0.0030=0.0036. \] The corresponding denominator cross-product is \[ 0.10^2+0.08^2-0.50\{2(0.10)(0.08)\} =0.0164-0.0080=0.0084. \] Thus \(\hat{\theta}_{\mathrm{GLS}}=0.0036/0.0084=0.4286\). Including the covariance scale, the precision is \[ \hat{\boldsymbol{\beta}}_X^T\boldsymbol{\Sigma}_Y^{-1}\hat{\boldsymbol{\beta}}_X =\frac{0.0084}{0.0004(0.75)}=28.00, \] so \(SE=1/\sqrt{28.00}=0.1890\). The Wald statistic is \(Z=0.4286/0.1890=2.268\), giving a two-sided normal \(p\)-value of approximately \(0.02335\). The approximate 95% interval is \(0.4286\pm1.96(0.1890)=(0.0582,0.7990)\), in outcome-association units per exposure-association unit.

If the correlation were incorrectly set to zero, the estimate would instead be \(0.0066/0.0164=0.4024\), with standard error \(\sqrt{0.0004/0.0164}=0.1562\). The corresponding statistic is about \(2.577\) and the two-sided \(p\)-value is about \(0.00996\). Here, ignoring positive correlation makes the evidence look more precise and more statistically significant than the LD-aware calculation. It also changes the point estimate.

Worked Example: Building Covariance From Signed LD

Suppose two hypothetical outcome-association estimates have standard errors \(0.02\) and \(0.03\), and the signed correlation between their harmonized variants is \(-0.50\). Under the usual same-outcome-sample approximation, set \[ \boldsymbol{\Sigma}_Y= \begin{pmatrix} 0.02^2 & -0.50(0.02)(0.03)\\ -0.50(0.02)(0.03) & 0.03^2 \end{pmatrix} = \begin{pmatrix} 0.0004&-0.0003\\ -0.0003&0.0009 \end{pmatrix}. \] Take exposure associations \((0.10,0.08)^T\) and outcome associations \((0.05,0.04)^T\). The latter equal \(0.50\) times the former, so the GLS estimate is \(0.50\), provided the denominator is nonzero.

For a numerical check, the determinant is \(0.0004(0.0009)-(-0.0003)^2=0.00000027\). Therefore, \[ \boldsymbol{\Sigma}_Y^{-1} =\frac{1}{0.00000027} \begin{pmatrix}0.0009&0.0003\\0.0003&0.0004\end{pmatrix}. \] The exposure-vector quadratic form has numerator \[ 0.0009(0.10^2)+2(0.0003)(0.10)(0.08)+0.0004(0.08^2) =0.00001636. \] Its value is \(0.00001636/0.00000027=60.59\), giving \(SE=1/\sqrt{60.59}=0.1285\). This example shows how the signed off-diagonal covariance enters the calculation. The covariance is negative because the aligned association errors are negatively correlated; replacing the signed LD correlation with its absolute value would use a different, incorrect matrix.

Worked Example: Near-Redundant Variants Provide Less Information

Consider two hypothetical variants with equal outcome standard errors of \(0.02\), LD correlation \(0.99\), exposure associations \((0.10,0.10)^T\), and outcome associations \((0.05,0.05)^T\). Their covariance matrix is \[ \boldsymbol{\Sigma}_Y=0.0004 \begin{pmatrix}1&0.99\\0.99&1\end{pmatrix}. \] The outcome vector is \(0.50\) times the exposure vector, so the GLS estimate is \(0.50\).

The exposure vector lies in the common direction \((1,1)^T\), which is an eigenvector of this covariance matrix with eigenvalue \(0.0004(1+0.99)=0.000796\). Its squared length is \(0.10^2+0.10^2=0.0200\), so the GLS precision is \(0.0200/0.000796=25.13\) and \(SE=1/\sqrt{25.13}=0.1995\). Treating the variants as independent would give precision \(0.0200/0.0004=50.00\) and \(SE=0.1414\). The near-duplicate variants therefore provide much less information than two independent variants would. A covariance matrix can be mathematically invertible yet close to singular, making its inverse and resulting estimates sensitive to small errors in the estimated LD.

Constructing and Checking the Covariance Matrix

When outcome associations are estimated in the same sample, a common approximation for the covariance between estimates for variants \(j\) and \(k\) is \[ \operatorname{Cov}(\hat{\beta}_{Yj},\hat{\beta}_{Yk}) \approx r_{jk}\,SE(\hat{\beta}_{Yj})\,SE(\hat{\beta}_{Yk}), \] where \(r_{jk}\) is their signed LD correlation in a suitable reference population. In matrix form, this is \(\boldsymbol{\Sigma}_Y\approx D R D\), where \(D\) is diagonal with the outcome standard errors and \(R\) is the signed LD correlation matrix. The approximation depends on compatible allele coding, ancestry, and analysis samples. Differences in ancestry, imputation, sample overlap, or association-analysis procedures can make a reference LD matrix a poor representation of the actual covariance.

Before fitting, verify that the variants use the same effect-allele orientation in the association estimates and the LD matrix. Check that the diagonal entries match squared outcome standard errors, the matrix is symmetric, its correlations are in the allowable range, and it is positive definite enough to invert stably. A non-positive-definite or nearly singular matrix can indicate incompatible inputs, numerical problems, or highly redundant variants. Do not silently force an invalid matrix to be invertible: investigate allele alignment and reference compatibility first. Any regularization or variant removal changes the analysis and should be reported.

Alternatives, Limitations, and Common Pitfalls

Clumping or pruning aims to retain a set of variants with sufficiently low LD, after which an independent-variant IVW calculation may be reasonable. It is simpler and can reduce numerical instability, but it discards correlated variants and may discard useful information. LD-aware GLS instead keeps the selected variants and models their dependence; it can be preferable when a reliable covariance matrix is available. Neither approach fixes invalid instruments. Multiplicative random-effects IVW, covered in the earlier material on fixed-effect and multiplicative random-effects IVW, allows extra dispersion around the fitted relationship; it does not, by itself, replace the covariance matrix needed for correlated variants.

A common mistake is to use the correlated variants in an ordinary independent-variant IVW calculation and then interpret the resulting standard error as though each variant supplied independent evidence. The correction is not merely to change the standard error after fitting: the covariance matrix belongs in the GLS estimate itself and can change the point estimate as well. Another mistake is to infer that a small LD-aware standard error proves the instruments are valid. Precision, instrument strength, and causal validity are distinct questions. Finally, uncertainty in the covariance matrix and in the exposure associations is not fully represented by the simple standard error formula; the first-order GLS calculation treats those inputs as fixed.

Key takeaway: For correlated variants, replace diagonal inverse-variance weights with the inverse of the full outcome-association covariance matrix. Check that the covariance structure is correctly aligned and numerically usable, and interpret the result only alongside the usual instrumental-variable assumptions.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. In the GLS model, what does an off-diagonal entry of \(\boldsymbol{\Sigma}_Y\) represent?
  2. Two variants have outcome standard errors \(0.03\) and \(0.04\), with signed LD correlation \(0.25\). What is the approximate covariance between their outcome-association estimates?
  3. For a two-sided Wald test, an estimate is \(0.30\) with standard error \(0.15\). Calculate \(Z\) and state the approximate two-sided normal \(p\)-value.
  4. Does using an LD covariance matrix establish the instrumental-variable assumptions? Explain.

Solutions. (1) It is the covariance between the two outcome-association estimates; nonzero covariance means their errors are not independent. (2) \(0.25(0.03)(0.04)=0.000300\), in squared outcome-association units. (3) \(Z=0.30/0.15=2.00\), giving a two-sided normal \(p\)-value of approximately \(0.0455\). (4) No. The matrix accounts for dependence between association estimates, not confounding of the instruments, exclusion restriction violations, or other failures of instrument validity.

Clinical Biostats