Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

Bayesian estimation of IVW and MR-Egger models for two-sample Mendelian randomization studies

View ORCID ProfileOkezie Uche-Ikonne, View ORCID ProfileFrank Dondelinger, View ORCID ProfileTom Palmer
doi: https://doi.org/10.1101/19005868
Okezie Uche-Ikonne
*Department of Mathematics and Statistics, Lancaster University, Lancaster, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Okezie Uche-Ikonne
Frank Dondelinger
†Faculty of Health and Medicine, Lancaster University, Lancaster, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Frank Dondelinger
Tom Palmer
*Department of Mathematics and Statistics, Lancaster University, Lancaster, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Tom Palmer
  • For correspondence: tom.palmer{at}lancaster.ac.uk
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Supplementary material
  • Data/Code
  • Preview PDF
Loading

Abstract

We present our package, mrbayes, for the open source software environment R. The package implements Bayesian estimation of IVW and MR-Egger models, including the radial MR-Egger model, for summary-level data Mendelian randomization analyses. We have implemented a choice of prior distributions for the model parameters, namely; weakly informative, non-informative, a joint prior for the MR-Egger model slope and intercept, and a pseudo-horseshoe prior, or the user can specify their own prior. We show how to use the package through an applied example investigating the causal effect of BMI on insulin resistance. In future work, we plan to provide functions for alternative MCMC estimation software such as Stan and OpenBugs.

Availability The package is freely available, under the MIT license, on GitHub here https://github.com/okezie94/mrbayes.

It can be installed in R using the following commands.

Figure
  • Download figure
  • Open in new tab

There is a website of the package helpfiles at https://okezie94.github.io/mrbayes/.

Introduction

Observational epidemiology is limited by possible bias due to unmeasured confounding, reverse causation, and other issues. Mendelian randomization (MR) is a method of testing and estimating causal effects for the aetiology of diseases.1 MR uses genetic variants as instrumental variables related to a modifiable phenotype to estimate a causal effect of the phenotype on a disease outcome.

By including multiple instruments, we can increase power for hypothesis testing. Genome wide association studies (GWAS) provide many potential instruments, and we can obtain summary-level datasets for MR analyses. For two-sample MR, instrument-phenotype associations and instrument-outcome associations are obtained from different samples. The trade-off with this approach is the risk of violating the second and third instrumental variable assumptions due to pleiotropy.

The inverse variance weighted (IVW) model estimates the causal effect for multiple independent instruments in summary data. However, in the presence of pleiotropy its estimates are biased. Methods have been derived which estimate causal effects that are robust to pleiotropy; such as the MR-Egger model.2 The MR-Egger model relies on its InSIDE (Instrument strength is independent of direct effect) assumption. The MR-Egger model has recently been adapted with its radial formulation which has the advantage that IVW is its sub-model.3

This paper introduces our mrbayes R package that implements Bayesian estimation of the IVW, MR-Egger, and Radial MR-Egger models. The Bayesian analysis is performed via the rjags package which provides an interface to the JAGS software, which performs Markov chain Monte Carlo estimation (MCMC), through R.4. Our package includes some specified prior distributions; non-informative, weakly informative, a shrinkage prior on the causal effect estimate (Pseudo-Horseshoe prior), and a joint prior on the intercept and causal effect estimate in the MR-Egger and radial MR-Egger models. The package also allows users to specify their own prior distributions.

The next section introduces the features of our mrbayes package, we then show how to use the package through an applied example. The supplementary material includes the methodology and additional examples.

Implementation

Our mrbayes package provides the following functions:

  • mr_format, a function for setting up the summary-level dataset for analysis;

  • mr_ivw_rjags, a function for estimating causal effects using the Bayesian IVW model, with a choice of prior distributions;

  • mr_egger_rjags, a function for estimating causal effects through the Bayesian MR-Egger mode, with a choice of prior distributions;

  • mr_radialegger_rjags, a function for performing Bayesian analysis under the radial formulation of MR-Egger.

The package allows users:

  • to specify custom prior distributions for the estimate of the causal effect (betaprior) and optionally for the residual standard error (sigmaprior) for the MR-Egger models (original and radial). The prior distributions are written in the JAGS syntax. For more information on how to specify prior distributions see page 34 of JAGS manual;5

  • to choose a random seed for reproducible results and to choose the number of chains for MCMC, each chain should have a different seed;

  • to set parameter rho, the correlation coefficient between the average pleiotropic effect and causal estimate. This option is only relevant when using the joint prior method;

  • to plot the posterior density and investigate the MCMC diagnostics.

The package also includes two summary-level datasets containing:

  • 185 SNPs with multiple instrument-phenotype associations for low-density lipoprotein cholesterol (LDL-c), high-density lipoprotein (HDL-c) and triglycerides (trig) while the instrument-outcome associations for coronary heart disease (CHD);6

  • 14 SNPs with instrument-phenotype associations of body mass index (BMI) and instrument-outcome associations of insulin resistance.7

The next section shows an applied example with step-by-step instructions on how to use the package.

Example: Investigating the effect of BMI on insulin resistance

We demonstrate the package using an investigation of the role of increased adiposity on insulin resistance in an MR study.7 We compare frequentist estimates with Bayesian estimates using weakly informative and pseudo-horseshoe prior distributions.

Firstly, we load the package into our R session (See the Availability section for installation instructions).

Figure
  • Download figure
  • Open in new tab

The next stage involves the setting up the dataset by using the mr_format() function;

Figure
  • Download figure
  • Open in new tab
Figure
  • Download figure
  • Open in new tab

The R syntax to use the weakly informative prior distributions is shown below.

Figure
  • Download figure
  • Open in new tab

Table 1 shows that the frequentist and these Bayesian estimates are similar. The intercept estimate for the frequentist and Bayesian MR-Egger models is indicative of negative horizontal pleiotropy. Whereas, the radial MR-Egger model confidence and credible intervals provide stronger evidence of horizontal pleiotropy.

View this table:
  • View inline
  • View popup
  • Download powerpoint
Table 1:

Comparing estimates of frequentist method and weakly informative prior distribution.

We compare the results with estimates derived using shrinkage prior distributions. The syntax for the pseudo horseshoe prior is given below.

Figure
  • Download figure
  • Open in new tab

The estimates from Table 2, compared to the estimates in Table 1, show the shrinkage of the intercept and slope for both the Bayesian MR-Egger and Radial MR-Egger models. The shrinkage prior has minimal effect on Bayesian IVW mean estimate.

View this table:
  • View inline
  • View popup
  • Download powerpoint
Table 2:

Estimates from MR models using pseudo-horseshoe prior distributions.

Figure
  • Download figure
  • Open in new tab

Figure 1 shows density plots for model estimates using three sets of priors; weakly informative, joint, and pseudo-horseshoe. The joint prior distributions are described in the Supplmentary material. The estimates using the joint prior distribution are similar to those from the weakly informative prior distribution. The estimates using the pseudo-horseshoe prior distribution are shrunk towards the null, which is arguably desirable in this example where we have evidence of pleiotropy.

Figure 1:
  • Download figure
  • Open in new tab
Figure 1:

Density plots for MR-Egger model estimates using weakly informative, joint, and pseudo-horseshoe prior distributions.

Conclusion

We present an R package, mrbayes, to perform Bayesian estimation of the IVW and MR-Egger estimators implemented through the JAGS software. In our example we demonstrated the use of several different prior distributions to estimate the causal and average pleiotropic effects from these models.

Extending MR analysis with Bayesian estimation allows for the introduction of prior distributions on the model parameters. Several authors have considered Bayesian estimation of MR models including assessing different model parameterisations and Bayesian model averaging.8,9 And the use of weakly informative prior distributions in the MR-Egger model has been shown to have good properties.10

There are several R packages providing functions for MR analyses. The MendelianRandomization and TwoSampleMR packages implement various two-sample MR methods.11,12 The RadialMR R package implements the radial MR models and visualization of instruments through radial plots.3,13 Our package complements these packages by offering the choice of four prior distributions for the causal effect; non-informative, weakly informative, pseudo-horseshoe, and a joint prior distribution for the MR-Egger model’s intercept and slope.

In future work, we plan to provide functions for alternative MCMC estimation software such as Stan and OpenBugs.14,15

Data Availability

Publicly available summary level data

References

  1. 1.↵
    Davey Smith G, Ebrahim S. ‘Mendelian randomization’: can genetic epidemiology contribute to under-standing environmental determinants of disease? International Journal of Epidemiology. Oxford University Press; 2003;32(1):1–22.
    OpenUrlCrossRefPubMedWeb of Science
  2. 2.↵
    Bowden J, Davey Smith G, Burgess S. Mendelian randomization with invalid instruments: effect estimation and bias detection through Egger regression. International Journal of Epidemiology [Internet]. 2015 Jun;44(2):512–525. Available from: https://dx.doi.org/10.1093/ije/dyv080
    OpenUrl
  3. 3.↵
    Bowden J, Spiller W, Del Greco M F, et al. Improving the visualization, interpretation and analysis of two-sample summary data Mendelian randomization via the Radial plot and Radial regression. International Journal of Epidemiology [Internet]. 2018 Jun;47(4):1264–1278. Available from: https://doi.org/10.1093/ije/dyy101
    OpenUrl
  4. 4.↵
    Plummer M. Rjags: Bayesian graphical models using mcmc [Internet]. 2018. Available from: https://CRAN.R-project.org/package=rjags
  5. 5.↵
    Plummer M. JAGS Version 3.3.0 user manual. Lyon, France: International Agency for Research on Cancer; 2012.
  6. 6.↵
    Do R, Willer CJ, Schmidt EM, et al. Common variants associated with plasma triglycerides and risk for coronary artery disease. Nature Genetics. Nature Publishing Group; 2013;45(11):1345.
    OpenUrl
  7. 7.↵
    Richmond R, Wade K, Corbin L, et al. Investigating the role of insulin in increased adiposity: Bi-directional Mendelian randomization study. bioRxiv [Internet]. Cold Spring Harbor Laboratory; 2017;155739. Available from: https://www.biorxiv.org/content/early/2017/06/28/155739
  8. 8.↵
    Jones E, Thompson J, Didelez V, Sheehan N. On the choice of parameterisation and priors for the Bayesian analyses of Mendelian randomisation studies. Statistics in Medicine. Wiley Online Library; 2012;31(14):1483–1501.
    OpenUrl
  9. 9.↵
    Burgess S, Thompson SG. Improving bias and coverage in instrumental variable analysis with weak instruments for continuous and binary outcomes. Statistics in Medicine. Wiley Online Library; 2012;31(15):1582–1600.
    OpenUrl
  10. 10.↵
    Schmidt A, Dudbridge F. Mendelian randomization with Egger pleiotropy correction and weakly informative Bayesian priors. International Journal of Epidemiology. Oxford University Press; 2017;47(4):1217–1228.
    OpenUrl
  11. 11.↵
    Yavorska OO, Burgess S. MendelianRandomization: an R package for performing Mendelian randomization analyses using summarized data. International Journal of Epidemiology. Oxford University Press; 2017;46(6):1734–1739.
    OpenUrl
  12. 12.↵
    Hemani G, Zheng J, Elsworth B, et al. The MR-Base platform supports systematic causal inference across the human phenome. Elife. eLife Sciences Publications Limited; 2018;7:e34408.
    OpenUrl
  13. 13.↵
    Spiller W, Bowden J. RadialMR: A package for implementing radial inverse variance weighted and MR-Egger methods. [Internet]. 2019. Available from: https://github.com/WSpiller/RadialMR
  14. 14.↵
    Stan Development Team. RStan: the R interface to Stan [Internet]. 2018. Available from: http://mc-stan.org/
  15. 15.↵
    Thomas A, O’Hara B, Ligges U, Sturtz S. Making bugs open. R News. 2006;6(1):12–17.
    OpenUrl
Back to top
PreviousNext
Posted September 21, 2019.
Download PDF

Supplementary Material

Data/Code
Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
Bayesian estimation of IVW and MR-Egger models for two-sample Mendelian randomization studies
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
Bayesian estimation of IVW and MR-Egger models for two-sample Mendelian randomization studies
Okezie Uche-Ikonne, Frank Dondelinger, Tom Palmer
medRxiv 19005868; doi: https://doi.org/10.1101/19005868
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
Bayesian estimation of IVW and MR-Egger models for two-sample Mendelian randomization studies
Okezie Uche-Ikonne, Frank Dondelinger, Tom Palmer
medRxiv 19005868; doi: https://doi.org/10.1101/19005868

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Epidemiology
Subject Areas
All Articles
  • Addiction Medicine (349)
  • Allergy and Immunology (668)
  • Allergy and Immunology (668)
  • Anesthesia (181)
  • Cardiovascular Medicine (2648)
  • Dentistry and Oral Medicine (316)
  • Dermatology (223)
  • Emergency Medicine (399)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (942)
  • Epidemiology (12228)
  • Forensic Medicine (10)
  • Gastroenterology (759)
  • Genetic and Genomic Medicine (4103)
  • Geriatric Medicine (387)
  • Health Economics (680)
  • Health Informatics (2657)
  • Health Policy (1005)
  • Health Systems and Quality Improvement (985)
  • Hematology (363)
  • HIV/AIDS (851)
  • Infectious Diseases (except HIV/AIDS) (13695)
  • Intensive Care and Critical Care Medicine (797)
  • Medical Education (399)
  • Medical Ethics (109)
  • Nephrology (436)
  • Neurology (3882)
  • Nursing (209)
  • Nutrition (577)
  • Obstetrics and Gynecology (739)
  • Occupational and Environmental Health (695)
  • Oncology (2030)
  • Ophthalmology (585)
  • Orthopedics (240)
  • Otolaryngology (306)
  • Pain Medicine (250)
  • Palliative Medicine (75)
  • Pathology (473)
  • Pediatrics (1115)
  • Pharmacology and Therapeutics (466)
  • Primary Care Research (452)
  • Psychiatry and Clinical Psychology (3432)
  • Public and Global Health (6527)
  • Radiology and Imaging (1403)
  • Rehabilitation Medicine and Physical Therapy (814)
  • Respiratory Medicine (871)
  • Rheumatology (409)
  • Sexual and Reproductive Health (410)
  • Sports Medicine (342)
  • Surgery (448)
  • Toxicology (53)
  • Transplantation (185)
  • Urology (165)