MendelianRandomizationEngine: Two-Sample MR with IVW, MR-Egger, Weighted Median, and Pleiotropy Detection
Introduction
Mendelian randomization exploits the random assortment of alleles at conception as a natural experiment. Genetic variants (SNPs) associated with an exposure serve as instrumental variables (IVs) if they satisfy: (1) relevance (associated with exposure), (2) independence (not associated with confounders), and (3) exclusion restriction (affect outcome only through exposure). Two-sample MR uses summary statistics from separate GWAS for exposure and outcome.
Methods
IVW Estimator
β_IVW = Σ(β_Y,j × β_X,j / σ²_Y,j) / Σ(β²_X,j / σ²_Y,j)
MR-Egger
Regresses β_Y on β_X with intercept; non-zero intercept indicates directional pleiotropy.
Weighted Median
Median of IV-specific causal estimates weighted by precision; valid when ≥50% of weight comes from valid IVs.
Heterogeneity
Cochran's Q statistic tests for heterogeneity among IV-specific estimates.
Results
28/30 significant IVW effects. 1/30 pleiotropic pairs. IVW-Egger r=0.9996. Mean F-statistic=26.2.
Code Availability
https://github.com/BioTender-max/MendelianRandomizationEngine
Key Results
- 30 exposure-outcome pairs, 50 SNPs each
- Significant IVW: 28/30
- Pleiotropic: 1/30
- IVW-Egger r=0.9996
- Mean F-stat: 26.2
Discussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.