From Summary Statistics to a Cautious MR Result
A summary-data Mendelian randomization (MR) analysis combines genetic associations with an exposure and with an outcome to estimate the change in outcome associated with a change in exposure. Even a small analysis involves more than dividing one association by another: the associations must refer to the same allele, the instruments must be suitable, and the pattern across variants must be examined. This tutorial follows a hypothetical example from allele harmonization through inverse-variance weighting (IVW), heterogeneity assessment, and two pleiotropy-robust sensitivity estimates.
The outcome here is continuous. Each exposure association is measured in standard-deviation (SD) units of exposure per effect allele, and each outcome association is measured in SD units of outcome per effect allele. The target estimate is therefore in SD units of outcome per SD unit of exposure. The calculations illustrate an analysis, not evidence from a real study.
Assumptions and Harmonization
Before interpreting that ratio as a causal estimate, the analysis needs assumptions. First, relevance requires the variants to be associated with the exposure. Second, independence requires the variants to be independent of confounders of the exposure–outcome relationship; population structure or selection can threaten this assumption. Third, the exclusion restriction requires each variant to affect the outcome only through the exposure. A direct effect on the outcome or a pathway through another trait can violate it. These assumptions are not established merely by observing strong genetic associations.
Harmonization checks the effect and other allele reported by each association study. If the outcome association is reported per the allele that is the other allele in the exposure study, its sign must be reversed. For example, an outcome association of \(-0.02\) per T allele becomes \(+0.02\) per C allele when the exposure association is reported per C allele. Strand-ambiguous variants require particular care: if allele frequency information cannot resolve their orientation reliably, they should not be forced into an alignment.
Worked Example: Aligning Effect Alleles
Suppose a hypothetical instrument has exposure alleles C/T and an exposure association of \(0.08\) SD per C allele. The outcome study reports alleles T/C and an outcome association of \(-0.02\) SD per T allele. The studies use the same variant, but the reported effect alleles differ.
The outcome association per C allele is the sign-reversed value, \(-(-0.02)=0.02\) SD. The harmonized ratio is therefore \(0.02/0.08=0.25\) SD of outcome per SD of exposure. Dividing the unharmonized values would give \(-0.02/0.08=-0.25\), the wrong direction, because the numerator would describe the opposite allele.
This alignment solves an allele-coding problem; it does not show that the variant satisfies the exclusion restriction or that the ratio is free of bias. Those are causal assumptions, not bookkeeping checks.
IVW Estimation and Heterogeneity
For \(K\) independent variants, the standard first summary estimate is IVW. In the fixed-effect form used here, it is a weighted regression of outcome associations on exposure associations constrained to pass through zero. Let \(SE(\hat{\beta}_{Yj})\) be the standard error of the outcome association, and set \(w_j=1/SE(\hat{\beta}_{Yj})^2\). Treating the exposure associations as fixed gives:
These expressions use the usual approximation that uncertainty in the exposure associations is negligible relative to uncertainty in the outcome associations (often called the NOME approximation). They also rely on correctly aligned associations and, for the stated standard error, independent variants and the specified fixed-effect model. If variants are correlated, the covariance between their association estimates must be accounted for rather than treating the weights as independent.
The IVW estimate is a precision-weighted summary, not a guarantee that every variant is a valid instrument. A useful check is Cochran’s \(Q\), the weighted sum of squared residuals around the fitted IVW line. Under the common-slope model with independent variants and appropriate standard errors, \(Q\) is compared approximately with a chi-squared distribution with \(K-1\) degrees of freedom. A large value indicates that residual differences are greater than expected from the stated sampling errors alone. It does not identify their cause.
Worked Example: IVW Estimate, Interval, and Cochran’s Q
Consider four hypothetical, independent variants. The table gives harmonized associations; all outcome standard errors are \(0.02\) SD per allele.
| Variant | \(\hat{\beta}_{Xj}\) (SD) | \(\hat{\beta}_{Yj}\) (SD) | Outcome SE (SD) |
|---|---|---|---|
| A | 0.10 | 0.05 | 0.02 |
| B | 0.08 | 0.02 | 0.02 |
| C | 0.12 | 0.07 | 0.02 |
| D | 0.09 | 0.12 | 0.02 |
Each weight is \(1/0.02^2=2500\). Since the weights are equal, they cancel from the ratio:
The conventional standard error is \(1/\sqrt{2500(0.0389)}=0.1014\) SD of outcome per SD of exposure. A normal-approximation 95% interval is \(0.6632\pm1.96(0.1014)\), or approximately \(0.4645\) to \(0.8620\). Under the model used for this interval, the data are compatible with effects in this range; it is not a 95% probability statement about the fixed causal parameter.
For \(Q\), the fitted values are \(\hat{\theta}_{IVW}\hat{\beta}_{Xj}\), and \(Q=\sum_j[(\hat{\beta}_{Yj}-\hat{\theta}_{IVW}\hat{\beta}_{Xj})/0.02]^2\). The four residuals before division by \(0.02\) are approximately \(-0.01632\), \(-0.03306\), \(-0.009589\), and \(0.06031\). Thus, \(Q\approx[(-0.01632)^2+(-0.03306)^2+(-0.009589)^2+(0.06031)^2]/0.0004=12.72\). With \(df=4-1=3\), the chi-squared upper-tail p-value is approximately \(0.0053\). This is evidence of excess between-variant dispersion relative to the fixed-effect model, not proof that a particular variant is invalid.
Why IVW Has This Form
The IVW formula follows by minimizing the weighted residual sum of squares for a line constrained to pass through zero. Write that sum as \(S(\theta)=\sum_j w_j(\hat{\beta}_{Yj}-\theta\hat{\beta}_{Xj})^2\). Differentiating and setting the derivative to zero gives:
Because the second derivative is \(2\sum_jw_j\hat{\beta}_{Xj}^{\,2}>0\) when at least one exposure association is nonzero, this stationary point minimizes \(S(\theta)\). The same residual sum at the fitted value is \(Q\). Fitting one slope uses one degree of freedom, which gives \(K-1\) residual degrees of freedom under the common-slope model.
Pleiotropy-Robust Sensitivity Estimates
A sensitivity estimate changes the assumptions or the way information is combined; it does not make the causal problem disappear. The weighted median and MR-Egger illustrate two different approaches. Their estimates can help diagnose dependence on the IVW assumptions, but each has its own conditions.
Worked Example: Comparing Sensitivity Estimates
Use the four harmonized variants above. Their ratio estimates are \(0.05/0.10=0.500\), \(0.02/0.08=0.250\), \(0.07/0.12=0.5833\), and \(0.12/0.09=1.333\). With equal outcome standard errors, approximate inverse-variance weights for these ratios are proportional to \(\hat{\beta}_{Xj}^{\,2}\), giving weights \(25,\ 16,\ 36,\ 20.25\) after division by the common factor \(0.02^2\). The total is \(97.25\); half is \(48.625\).
In ascending ratio order, the cumulative weights are \(16\) at \(0.250\), \(41\) at \(0.500\), and \(77\) at \(0.5833\). The weighted median is therefore \(0.5833\), because the cumulative weight first passes half the total at that ratio. This estimate is less sensitive than IVW to a minority of invalid weight, but its protection depends on the more-than-half-valid-weight condition.
For MR-Egger with the same equal outcome standard errors, the weighted line is ordinary least squares with an intercept. The means are \(\bar{\beta}_X=0.0975\) and \(\bar{\beta}_Y=0.0650\). The centered sums are \(S_{XX}=0.000875\) and \(S_{XY}=0.000450\), so the slope is \(S_{XY}/S_{XX}=0.5143\). The intercept is \(0.0650-0.5143(0.0975)=0.01486\) SD of outcome per allele. There are only four variants, so the Egger slope is highly imprecise; under the fixed outcome-SE calculation its standard error is \(0.02/\sqrt{0.000875}=0.676\). The point estimate alone should not be treated as a precise correction for pleiotropy.
The IVW estimate \(0.6632\), weighted-median estimate \(0.5833\), and MR-Egger slope \(0.5143\) are not identical, while \(Q\) is large. Together these results flag sensitivity to instrument-level differences. They do not establish which estimate is closest to a causal effect: in particular, the median’s validity condition and Egger’s InSIDE assumption cannot be verified from these four summary estimates alone.
Diagnostics, Alternatives, and Limits
A sensible analysis checks data and assumptions alongside the point estimates. Confirm that effect alleles are aligned, units and phenotype scales match, and variants are independent or that their covariance is handled. Examine instrument strength and uncertainty in \(\hat{\beta}_{Xj}\); if exposure-association uncertainty is consequential, the simple IVW formula can be biased or too optimistic. Check heterogeneity and consider whether an influential variant drives the result. A large \(Q\), a large change after removing an influential variant, or substantial disagreement among estimators should prompt investigation rather than selection of whichever number is most appealing.
| Approach | Strength | Key limitation |
|---|---|---|
| IVW | Efficient when the common causal-effect model and instrument assumptions are appropriate. | Can be biased if instrument direct effects violate the model; heterogeneity does not reveal its source. |
| Weighted median | Can remain consistent when invalid instruments contribute less than half the total weight. | Fails if the valid instruments do not supply more than half the weight. |
| MR-Egger | Allows an average directional pleiotropic component through an intercept. | Often imprecise and relies on InSIDE; a nonzero or nonsignificant intercept does not settle validity. |
These approaches are not interchangeable votes. The weighted median and MR-Egger answer under different assumptions, and neither is guaranteed to correct a poorly harmonized data set, weak instruments, correlated variants treated as independent, or violations of independence. In this example, the IVW interval is a conventional model-based interval; excess heterogeneity and possible pleiotropy mean it should not be read as if the causal assumptions had been demonstrated. If the outcome were binary, interpretation would also depend on the outcome scale and link function; the present calculations are for a continuous outcome.
Common Mistake
The practical conclusion is conditional: under the stated assumptions, IVW estimates an increase of about \(0.66\) SD in outcome per SD increase in exposure, but the substantial heterogeneity and differing sensitivity estimates make the causal interpretation uncertain. A responsible reading keeps the estimate, its uncertainty, the diagnostics, and the assumptions together.
Check Your Understanding
Answer each question, then compare with the worked solutions below.
- If an outcome association is \(-0.03\) per the opposite allele to the exposure effect allele, what harmonized association should be used?
- Why does the fixed-effect IVW heterogeneity statistic have \(K-1\) degrees of freedom?
- For the four variants in the example, which variant has the largest ratio estimate, and what does the large \(Q\) tell you?
- State the condition that protects the weighted-median estimate against some invalid instruments.
- Why is the MR-Egger slope in the example not strong evidence for a specific causal effect?
Solutions. (1) Use \(+0.03\), because reversing the effect allele reverses the sign. (2) There are \(K\) residual contributions and one fitted common slope, leaving \(K-1\) degrees of freedom under the model. (3) Variant D has ratio \(0.12/0.09=1.333\), the largest. \(Q\approx12.72\) with \(df=3\) signals excess dispersion relative to the fixed-effect common-slope model, but does not identify its cause or a particular invalid variant. (4) More than 50% of the total ratio-estimate weight must come from valid instruments. (5) With only four variants, the slope’s standard error is about \(0.676\), large relative to its estimate, and consistency also depends on assumptions such as InSIDE.