Written and maintained by CASRAI Editorial Board
Published
On this page
TwoSampleMR is an open-source R package developed by the MRC Integrative Epidemiology Unit at the University of Bristol to perform two-sample Mendelian randomization using summarized data from genome-wide association studies (GWAS). It enables researchers to estimate the causal effect of an exposure on a disease or health outcome without requiring individual-level participant data, interfacing directly with the IEU OpenGWAS database to extract instruments, harmonise effect alleles, execute robust causal estimators, and evaluate horizontal pleiotropy.
What TwoSampleMR Is Used for in Research
In observational epidemiology, discovering whether an association reflects a true cause-and-effect relationship is frequently hindered by confounding factors and reverse causality. Mendelian randomization (MR) addresses these obstacles by employing functional genetic variants—predominantly single nucleotide polymorphisms (SNPs)—as instrumental variables for phenotypic exposures. Because inherited alleles are randomly assorted during meiosis and fixed at conception, genetic variants precede disease onset and are generally distributed independently of postnatal lifestyle and socioeconomic confounders.
TwoSampleMR implements the two-sample design of Mendelian randomization. In classical one-sample MR, individual genotypes, intermediate biomarkers, and clinical outcomes must be measured within the same participant cohort. While statistically intuitive, one-sample studies frequently face limited sample sizes, and any weak instrument bias tends to shift causal estimates toward the confounded observational estimate. By contrast, two-sample MR leverages GWAS summary statistics derived from two independent study cohorts: one cohort in which the genetic variants were tested against the exposure (e.g., circulating lipid levels or blood pressure in the UK Biobank), and a second distinct cohort in which those same variants were tested against the disease outcome (e.g., myocardial infarction in the CARDIoGRAMplusC4D consortium). Crucially, in two-sample MR, weak instrument bias attenuates effect estimates toward the null rather than toward observational bias, providing a conservative safeguard against false-positive causal inference.
The statistical validity of any analysis conducted in TwoSampleMR rests upon three foundational instrumental variable assumptions:
- The Relevance Assumption: The instrumental genetic variants must be strongly associated with the exposure of interest. In TwoSampleMR, this is enforced by selecting variants that surpass the standard genome-wide significance threshold (p < 5 × 10⁻⁸) and exhibit an F-statistic substantially exceeding the conventional threshold of 10.
- The Independence Assumption: The genetic instruments must be independent of all unmeasured or measured confounders that influence the relationship between the exposure and the outcome.
- The Exclusion Restriction: The genetic variants must influence the outcome strictly through their effect on the specified exposure, with no direct or alternative biological pathways (absence of horizontal pleiotropy).
Within biomedical research and computational biology, TwoSampleMR is widely applied to validate pharmacological drug targets, identify modifiable risk factors for complex polygenic diseases, and prioritize therapeutic candidates before initiating costly clinical trials. For instance, researchers utilize genetic variants situated within the HMGCR or PCSK9 gene regions as lifelong genetic proxies for statin or PCSK9-inhibitor therapies, validating their efficacy in lowering coronary disease risk. When reporting findings derived from the package, investigators frequently adhere to formal methodological frameworks, integrating causal graph validation from the DoWhy causal inference library and documenting analytical pipelines according to the STROBE-MR reporting guidelines.
Install and Access TwoSampleMR
TwoSampleMR is actively maintained by the MRC Integrative Epidemiology Unit (IEU) and is distributed primarily through GitHub and the MRC IEU R-Universe repository. It is not currently hosted on CRAN because of its specialized dependencies and tight coupling with live genomic API services.
Official Installation Methods
For researchers operating on macOS or Windows, installing pre-compiled binary packages via the MRC IEU R-Universe is strongly recommended. This approach avoids local C++ and Fortran compilation hurdles associated with genomic libraries:
install.packages("TwoSampleMR", repos = c("https://mrcieu.r-universe.dev", "https://cloud.r-project.org"))
For Linux environments, high-performance computing (HPC) clusters, or containerized Docker pipelines, installation from GitHub via the remotes package provides direct access to release branches and development builds:
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_github("MRCIEU/TwoSampleMR")
To support programmatic data wrangling, genomic variant clumping, and visualization, researchers should also ensure that companion libraries are installed, including ieugwasr (for underlying OpenGWAS REST API calls), ggplot2 (for custom rendering of diagnostic plots), and dplyr (for tabular operations):
install.packages(c("dplyr", "ggplot2", "data.table"))
remotes::install_github("MRCIEU/ieugwasr")
Configuring OpenGWAS API Authentication
A critical operational requirement for modern TwoSampleMR workflows is authentication with the IEU OpenGWAS database. The OpenGWAS infrastructure requires programmatic queries to supply a JSON Web Token (JWT) to monitor API quotas, prevent denial-of-service spikes, and track database utilization. Queries executed without a registered JWT will trigger HTTP 401 Unauthorized or HTTP 403 Forbidden errors.
To establish authentication, follow these precise configuration steps:
- Navigate to the official OpenGWAS profile portal at
https://api.opengwas.io/profile/and authenticate using your GitHub or Google account. - Locate the API token section and generate a personal JWT token string.
- Open your user-level R environment file by running
usethis::edit_r_environ()in your R console, or manually edit~/.Renvironin your home directory. - Add a single entry defining the token variable:
OPENGWAS_JWT=your_generated_jwt_token_string_here - Save the file and completely restart your R session.
- Verify that the authentication token is recognized by executing:
ieugwasr::get_opengwas_jwt() ieugwasr::user()
If ieugwasr::user() prints your registered account profile details without error, your computational environment is authenticated and ready to query hundreds of thousands of curated GWAS summary datasets.
Step-by-Step Two-Sample MR Analysis Workflow
Performing a complete Mendelian randomization analysis in TwoSampleMR follows a structured, six-stage workflow: extracting exposure instruments, obtaining corresponding outcome statistics, harmonising effect alleles across datasets, computing causal estimates, executing sensitivity analyses, and generating publication-ready diagnostic graphics.
Step 1: Extract Genetic Instruments for the Exposure
Instruments can be queried programmatically from the OpenGWAS catalog using study identifiers, or loaded from local GWAS summary statistic files. When querying OpenGWAS, specify the exposure study identifier (for example, ieu-a-2 representing low-density lipoprotein cholesterol from the Global Lipids Genetics Consortium), set the significance threshold, and enable linkage disequilibrium (LD) clumping:
library(TwoSampleMR)
# Query exposure instruments from OpenGWAS
exposure_dat <- extract_instruments(
outcomes = "ieu-a-2",
p1 = 5e-8,
clump = TRUE,
r2 = 0.001,
kb = 10000
)
The clump = TRUE parameter performs LD clumping using the European 1000 Genomes reference panel, ensuring that only mutually independent genetic variants (pairwise r² < 0.001 within a 10 megabase window) are retained as instrumental variables.
If you are analyzing local in-house GWAS files, use read_exposure_data() or format_data() to map your tabular column headers into the standardized TwoSampleMR format:
exposure_dat <- read_exposure_data(
filename = "exposure_gwas_summary.txt",
sep = "t",
snp_col = "SNP",
beta_col = "BETA",
se_col = "SE",
effect_allele_col = "EFFECT_ALLELE",
other_allele_col = "OTHER_ALLELE",
eaf_col = "EAF",
pval_col = "PVALUE"
)
Step 2: Extract Corresponding Outcome Data
Next, retrieve summary statistics for the exact instrumental variants identified in Step 1 from an independent outcome GWAS (for example, ieu-a-7 representing coronary heart disease from CARDIoGRAMplusC4D):
outcome_dat <- extract_outcome_data(
snps = exposure_dat$SNP,
outcomes = "ieu-a-7",
proxies = TRUE,
rsq = 0.8,
align_alleles = 1,
palindromes = 1,
maf_threshold = 0.3
)
Setting proxies = TRUE instructs the function to search for high-LD proxy variants (r² ≥ 0.8) in the 1000 Genomes reference population if any requested exposure SNP was not directly genotyped or imputed in the outcome study.
Step 3: Harmonise Exposure and Outcome Summary Statistics
Because GWAS studies may report effects with respect to opposite DNA strands or contrasting reference alleles, harmonisation is vital to align the effect allele across both datasets before estimating causal effects:
dat <- harmonise_data(
exposure_dat = exposure_dat,
outcome_dat = outcome_dat,
action = 2
)
The action parameter dictates how ambiguous palindromic variants (SNPs with A/T or C/G alleles) are treated:
action = 1: Assumes all alleles are already oriented on the positive forward strand, performing allele flipping without checking minor allele frequency.action = 2(recommended): Infers strand orientation for palindromic SNPs based on effect allele frequency (EAF). If the minor allele frequency is sufficiently distinct from 0.5 (e.g., 0.58), strand direction is inferred; if the frequency is ambiguous (near 0.5), the SNP is safely dropped.action = 3: Strictly removes all palindromic variants from the harmonised dataset regardless of frequency.
Step 4: Execute Primary Mendelian Randomization Estimators
Once the dataset is harmonised, calculate causal effect estimates across multiple statistical models simultaneously using the mr() function:
mr_results <- mr(
dat,
method_list = c(
"mr_wald_ratio",
"mr_ivw",
"mr_egger_regression",
"mr_weighted_median",
"mr_weighted_mode"
)
)
print(mr_results)
Using multiple complementary estimators is essential: while the Inverse Variance Weighted (IVW) method provides maximum statistical power under the assumption of balanced pleiotropy, median and mode estimators maintain consistency even when a proportion of instruments are invalid.
Step 5: Perform Robust Sensitivity and Diagnostic Tests
Evaluating potential violations of the exclusion restriction assumption requires quantitative sensitivity testing:
# Test for instrument heterogeneity (Cochran's Q and Rucker's Q)
heterogeneity <- mr_heterogeneity(dat)
# Test for directional horizontal pleiotropy (MR-Egger intercept)
pleiotropy <- mr_pleiotropy_test(dat)
# Leave-one-out sensitivity analysis
loo_results <- mr_leaveoneout(dat)
# Single SNP causal estimates
single_snp <- mr_singlesnp(dat)
Step 6: Render Diagnostic Visualizations
TwoSampleMR provides built-in plotting routines that produce publication-quality ggplot2 objects:
# Scatter plot comparing exposure effects against outcome effects
p_scatter <- mr_scatter_plot(mr_results, dat)
# Forest plot of individual variant effect estimates
p_forest <- mr_forest_plot(single_snp)
# Funnel plot to detect directional pleiotropy through visual asymmetry
p_funnel <- mr_funnel_plot(single_snp)
# Leave-one-out sensitivity plot
p_loo <- mr_leaveoneout_plot(loo_results)
Output and How to Read It
Interpreting TwoSampleMR output correctly requires understanding the structure of each resulting data frame, the mathematical units of the causal estimates, and the diagnostic implications of sensitivity tests.
The Primary MR Results Table
The primary data frame returned by mr() contains the following key columns:
id.exposureandid.outcome: The catalog identifiers for the exposure and outcome datasets.exposureandoutcome: Descriptive trait names corresponding to the analyzed phenotypes.method: The statistical estimator utilized (e.g., “Inverse variance weighted”, “MR Egger”, “Weighted median”, “Weighted mode”).nsnp: The total number of instrumental genetic variants retained after clumping and harmonisation.b: The estimated causal effect coefficient (slope).se: The standard error of the causal coefficient.pval: The two-sided p-value testing the null hypothesis that b = 0.
Translating Effect Estimates into Clinical Metrics
When the outcome is continuous (such as systolic blood pressure or body mass index), the coefficient b represents the expected change in the outcome (in its native measurement units or standard deviations) per one-unit increase in the exposure. When the outcome is binary (such as type 2 diabetes or stroke), the coefficient b represents the log-odds ratio of disease risk per unit increase in the exposure.
To transform log-odds coefficients into easily interpretable Odds Ratios (OR) and 95% confidence intervals, apply the exponential transformation in R:
mr_results$or <- exp(mr_results$b)
mr_results$or_lci95 <- exp(mr_results$b - 1.96 * mr_results$se)
mr_results$or_uci95 <- exp(mr_results$b + 1.96 * mr_results$se)
# View formatted results
subset(mr_results, select = c(method, nsnp, b, se, pval, or, or_lci95, or_uci95))
Interpreting Heterogeneity Statistics
The mr_heterogeneity() function produces Cochran’s Q statistic for the IVW and MR-Egger models. Cochran’s Q quantifies whether the individual Wald ratios calculated for each separate SNP differ more than expected by chance:
- If Cochran’s Q yields p ≥ 0.05, there is little evidence of instrument heterogeneity, indicating that individual variants agree on the causal effect magnitude. In this scenario, fixed-effects IVW is statistically efficient.
- If Cochran’s Q yields p < 0.05, significant heterogeneity exists across variants. Heterogeneity frequently signals the presence of horizontal pleiotropy, differing variant mechanisms, or population stratification. When significant heterogeneity is detected, researchers should report the multiplicative random-effects IVW estimate (which inflates standard errors appropriately to account for dispersion) and investigate pleiotropy using median, mode, and outlier-removal methods.
Interpreting the MR-Egger Intercept Test
The mr_pleiotropy_test() output displays the intercept from the MR-Egger regression model alongside its standard error and p-value:
- Under the InSIDE (Instrument Strength Independent of Direct Effect) assumption, the MR-Egger intercept captures the average directional pleiotropic effect across all instrumental variants.
- An intercept that does not differ significantly from zero (p ≥ 0.05) suggests that directional horizontal pleiotropy is negligible, affirming that the standard IVW causal estimate is unbiased.
- An intercept that differs significantly from zero (p < 0.05) indicates the presence of directional pleiotropy. In this event, the standard IVW estimate is systematically biased, and the MR-Egger slope (
b) provides a pleiotropy-corrected causal estimate, albeit with wider confidence intervals.
Interpreting Leave-One-Out Sensitivity Plots
In the leave-one-out plot generated by mr_leaveoneout_plot(), each row displays the recalculated IVW causal effect after excluding one single SNP from the instrument set. The final bottom row shows the overall IVW estimate incorporating all instruments. If the confidence intervals remain overlapping and consistent in magnitude across all iterations, the causal inference is structurally robust. If omitting a single variant causes the causal estimate to shift across the null line or drop substantially in significance, that variant represents a high-leverage outlier that must be investigated for direct pleiotropic associations.
Troubleshooting Common Issues
Applying TwoSampleMR to complex biological data sets often surfaces technical and analytical warnings. Below are systematic troubleshooting solutions for the most frequent challenges:
1. API Authentication Failures and Connection Timeouts
Symptom: Calls to extract_instruments() or extract_outcome_data() fail with Error in api_query: Unauthorized (HTTP 401) or HTTP 403 Forbidden.
Cause: The OpenGWAS API token is either missing from the R environment, incorrectly formatted, or expired (tokens typically require renewal every few months).
Fix: Log in to https://api.opengwas.io/profile/, generate a fresh JWT token, execute usethis::edit_r_environ(), update the OPENGWAS_JWT variable, and restart R. Verify the connection with ieugwasr::user() before executing downstream queries.
2. Excessive Instrument Attrition During Data Harmonisation
Symptom: A large fraction of exposure instruments are dropped during harmonise_data(), substantially reducing statistical power.
Cause: Dropping occurs when variants are palindromic (A/T or C/G) and exhibit intermediate effect allele frequencies (EAF between 0.42 and 0.58), where strand orientation cannot be established reliably without introducing strand errors.
Fix: Check whether your exposure and outcome GWAS files include accurate effect allele frequencies. If EAF columns are missing or mislabeled, TwoSampleMR cannot deduce strand alignment and must drop palindromes. If the source GWAS files are guaranteed to be aligned to the positive strand of the same genome build (e.g., GRCh37/hg19), you can inspect results using action = 1 as an exploratory comparison, but default to action = 2 for peer-reviewed reporting.
3. Zero Instruments Returned After Clumping
Symptom: extract_instruments() returns zero rows or very few variants.
Cause: For underpowered exposures or small discovery GWAS samples, no variants achieve genome-wide significance (p < 5 × 10⁻⁸), or all significant variants reside within a single genomic locus and are collapsed into one SNP during LD clumping.
Fix: Verify the sample size and power of the exposure GWAS. In exploratory research where no variants reach 5 × 10⁻⁸, researchers occasionally relax the threshold to p < 1 × 10⁻⁶ or p 10).
4. Missing Variants in the Outcome GWAS
Symptom: Many exposure SNPs are missing from the outcome GWAS summary statistics.
Cause: The outcome GWAS may have used an older imputation reference panel (such as HapMap 2 instead of the Haplotype Reference Consortium or 1000 Genomes), or variant identifiers may follow different naming conventions (e.g., chromosome:position strings instead of rsIDs).
Fix: Ensure that proxies = TRUE is passed to extract_outcome_data() with an appropriate threshold (such as rsq = 0.8). If analyzing local flat files, harmonize variant identifiers prior to loading by converting chromosome and base pair positions into standard dbSNP rsIDs using Bioconductor annotation packages such as SNPlocs.Hsapiens.dbSNP144.GRCh37.
5. Discordant Causal Estimates Between IVW and MR-Egger
Symptom: The IVW estimator shows a statistically significant causal effect, whereas the MR-Egger slope is non-significant or displays an opposite sign.
Cause: MR-Egger regression possesses inherently lower statistical power than IVW and is susceptible to extreme influence by outliers or violations of the NOME (no measurement error) assumption, quantified by the I²GX statistic.
Fix: Do not rely solely on MR-Egger to judge the presence of a causal effect. Inspect the weighted median and weighted mode estimators. If the weighted median and weighted mode estimates align closely with the IVW estimate in magnitude and direction, and the MR-Egger intercept is not significantly different from zero, the causal relationship is supported. If the MR-Egger intercept is significant (p < 0.05), investigate outlier variants using leave-one-out diagnostics or radial MR regression.
Free Alternatives to TwoSampleMR
While TwoSampleMR provides the most extensive programmatic integration with large-scale GWAS repositories, several free, open-source alternatives cater to specialized modeling requirements, exact matrix computations, or standalone command-line environments.
The table below summarizes leading software packages used in computational biology and genetic epidemiology for Mendelian randomization:
| Package / Tool | Environment | Primary Focus | Key Strengths | Limitations |
|---|---|---|---|---|
| TwoSampleMR | R | Two-sample MR pipeline | Direct OpenGWAS API access, automated LD clumping and harmonisation, comprehensive plotting | Requires API token configuration; tightly coupled to IEU database formats |
| MendelianRandomization | R (CRAN) | Methodological MR modeling | Exact matrix calculations, robust penalized regression, multivariable MR, contamination mixture models | Does not provide built-in API queries or automated genomic data harmonisation |
| MR-PRESSO | R | Pleiotropy outlier detection | Global test of horizontal pleiotropy, automated identification and removal of outlier variants | Computationally intensive permutation framework; sensitive to sample size |
| RadialMR | R | Outlier diagnostics and plotting | Radial IVW and MR-Egger formulations, Galbraith radial plots, second-order weighting | Focuses on outlier detection rather than comprehensive end-to-end GWAS retrieval |
| CAUSE | R | Bayesian causal inference | Disentangles correlated pleiotropy from true causality using genome-wide empirical priors | Requires genome-wide summary statistics; higher computational demands |
| GSMR (GCTA) | C++ / R | Summary-data MR | High-speed C++ implementation, accounts for LD between instruments (HEIDI-outlier filtering) | Requires local binary installation of GCTA and local reference LD genotype matrices |
Choosing among these packages depends primarily on your research workflow and analytical goals. In institutional settings comparing R vs. Stata for statistical analysis, the R ecosystem is overwhelmingly preferred for Mendelian randomization because modern genomic packages like TwoSampleMR and MendelianRandomization are native to R, whereas Stata relies on user-contributed community scripts with limited genomic API connectivity. Furthermore, as the intersection of biostatistics and epidemiology continues to expand, researchers frequently utilize TwoSampleMR for data extraction, clumping, and primary harmonisation, while exporting the harmonised data frames to packages like MRPRESSO or RadialMR for advanced pleiotropy filtering.
The data table below compares the statistical assumptions, minimum instrument requirements, and pleiotropy tolerance thresholds across the core Mendelian randomization estimators available in TwoSampleMR.
Frequently asked questions
What is the difference between one-sample and two-sample Mendelian randomization?
One-sample Mendelian randomization measures genetic instruments, the phenotypic exposure, and the clinical outcome within the same individual participants of a single study cohort. Two-sample Mendelian randomization uses summary association statistics from two separate, independent cohorts: one discovery GWAS for the exposure and another GWAS for the outcome. Two-sample MR enables researchers to leverage massive sample sizes from international consortia without accessing individual-level genotype files, and any weak instrument bias attenuates effect estimates conservatively toward the null rather than toward observational confounding.
Can TwoSampleMR analyze local GWAS summary statistics without querying OpenGWAS?
Yes. TwoSampleMR provides dedicated functions, including read_exposure_data(), read_outcome_data(), and format_data(), specifically designed to parse local tabular text files. Researchers can supply custom summary statistic files by mapping their column names (such as SNP rsID, effect allele, other allele, beta coefficient, standard error, effect allele frequency, and p-value) into the package’s standardized format without transmitting data to external servers.
How does TwoSampleMR handle palindromic SNPs during data harmonisation?
Palindromic SNPs possess alleles that are complementary on opposite DNA strands (specifically A/T or C/G pairs). During harmonisation, TwoSampleMR uses the action parameter to determine strand alignment. Under action = 2 (the default and recommended setting), the software compares the reported effect allele frequency against reference population frequencies. If the minor allele frequency is sufficiently far from 0.5, strand orientation is deduced and aligned; if the frequency is close to 0.5 (intermediate frequency), the variant is dropped from the analysis to prevent strand misalignment bias.
What should researchers do if the MR-Egger intercept test shows significant horizontal pleiotropy?
If the MR-Egger intercept test yields a p-value below 0.05, the standard Inverse Variance Weighted (IVW) estimate is biased by directional horizontal pleiotropy. In this scenario, researchers should report the MR-Egger slope as a pleiotropy-corrected causal estimate, provided the InSIDE assumption holds. Additionally, investigators should evaluate outlier-robust methods, including the weighted median estimator, the weighted mode estimator, and outlier detection packages such as MR-PRESSO or RadialMR, to verify that findings remain concordant.
How do you convert TwoSampleMR effect sizes into odds ratios for binary health outcomes?
For binary disease outcomes analyzed via logistic regression GWAS, the causal coefficient b returned by mr() represents the change in log-odds of the disease per unit increase in the exposure. To convert this value into an Odds Ratio (OR), exponentiate the coefficient: exp(b). Calculate the 95% confidence intervals using the standard error: exp(b - 1.96 * se) for the lower bound and exp(b + 1.96 * se) for the upper bound.
Is an OpenGWAS API token required to use TwoSampleMR?
An API token is strictly required whenever querying or downloading summary statistics directly from the IEU OpenGWAS database via functions like extract_instruments() or extract_outcome_data(). Without setting the OPENGWAS_JWT environment variable in your ~/.Renviron file, programmatic database requests will fail with HTTP 401 or 403 status codes. However, an API token is not required if you are analyzing entirely local summary statistic files using format_data().
Sources
- Hemani, G., Zheng, J., Elsworth, B., Wade, K. H., Haberland, V., Baird, D., Laurin, C., Burgess, S., Bowden, J., Langdon, R., Tan, V. Y., Yarmolinsky, J., Shihab, H. A., Timpson, N. J., Evans, D. M., Relton, C., Martin, R. M., Davey Smith, G., Gaunt, T. R., and Haycock, P. C. (2018). The MR-Base platform supports systematic causal inference across the human phenome. eLife, 7, e34408. https://doi.org/10.7554/eLife.34408 (Accessed 2026-11-16)
- MRC Integrative Epidemiology Unit. (2024). TwoSampleMR: R package for two-sample Mendelian randomization. University of Bristol. https://mrcieu.github.io/TwoSampleMR/ (Accessed 2026-11-16)
- MRC Integrative Epidemiology Unit. (2024). ieugwasr: R client for the IEU OpenGWAS API. University of Bristol. https://mrcieu.github.io/ieugwasr/ (Accessed 2026-11-16)
- Bowden, J., Davey Smith, G., and Burgess, S. (2015). Mendelian randomization with invalid instruments: effect estimation and bias detection through Egger regression. International Journal of Epidemiology, 44(2), 512–525. https://doi.org/10.1093/ije/dyv080 (Accessed 2026-11-16)
- Bowden, J., Davey Smith, G., Haycock, P. C., and Burgess, S. (2016). Consistent Estimation in Mendelian Randomization with Some Invalid Instruments Using a Weighted Median Estimator. Genetic Epidemiology, 40(4), 304–314. https://doi.org/10.1002/gepi.21965 (Accessed 2026-11-16)
- Burgess, S., Butterworth, A., and Thompson, S. G. (2013). Mendelian randomization analysis with multiple genetic variants using summarized data. Genetic Epidemiology, 37(7), 658–665. https://doi.org/10.1002/gepi.21758 (Accessed 2026-11-16)
- Hartwig, F. P., Davey Smith, G., and Bowden, J. (2017). Robust inference in summary data Mendelian randomization via the zero modal pleiotropy assumption. International Journal of Epidemiology, 46(6), 1985–1998. https://doi.org/10.1093/ije/dyx102 (Accessed 2026-11-16)
- Verbanck, M., Chen, C. Y., Neale, B., and Do, R. (2018). Detection of widespread horizontal pleiotropy in causal relationships using MR-PRESSO. Nature Genetics, 50(5), 693–698. https://doi.org/10.1038/s41588-018-0099-7 (Accessed 2026-11-16)
Data: TwoSampleMR Estimation Methods and Model Assumptions
Comparative specifications of Mendelian randomization statistical estimation methods implemented in the TwoSampleMR R package, detailing instrumental variable assumptions, minimum instrument counts, breakdown thresholds, and primary methodological citations.
| Method Name | TwoSampleMR Function | Minimum Instruments (SNPs) | InSIDE Required | Breakdown Threshold (%) | Primary Reference |
|---|---|---|---|---|---|
| Wald Ratio | mr_wald_ratio | 1 | No (single instrument) | 0 | Burgess et al. (2013) |
| Inverse Variance Weighted (Fixed Effects) | mr_ivw_fe | 2 | Yes (zero pleiotropy) | 0 | Burgess et al. (2013) |
| Inverse Variance Weighted (Multiplicative Random Effects) | mr_ivw_mre | 2 | Yes (balanced pleiotropy) | 0 | Burgess et al. (2013) |
| MR-Egger Regression | mr_egger_regression | 3 | Yes (directional pleiotropy allowed) | 0 | Bowden et al. (2015) |
| Weighted Median Estimator | mr_weighted_median | 3 | No | 50 | Bowden et al. (2016) |
| Simple Median Estimator | mr_simple_median | 3 | No | 50 | Bowden et al. (2016) |
| Weighted Mode Estimator | mr_weighted_mode | 3 | No | 50 | Hartwig et al. (2017) |
| Simple Mode Estimator | mr_simple_mode | 3 | No | 50 | Hartwig et al. (2017) |
Sources
- The MR-Base platform supports systematic causal inference across the human phenome (accessed 2026-11-16)
- TwoSampleMR Package Reference: mr() Function (accessed 2026-11-16)
- Mendelian randomization with invalid instruments: effect estimation and bias detection through Egger regression (accessed 2026-11-16)
- Consistent Estimation in Mendelian Randomization with Some Invalid Instruments Using a Weighted Median Estimator (accessed 2026-11-16)
- Mendelian randomization analysis with multiple genetic variants using summarized data (accessed 2026-11-16)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







