Skip to content

Stata package for two-sample Mendelian randomization analyses using summary data

License

Notifications You must be signed in to change notification settings

okezie94/mrrobust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mrrobust: Stata package for two-sample Mendelian randomization analyses using summary data

Latest updates

Short video introduction

Click here for a short video demonstrating the use of the package.

Helpfile examples

Click here for some of the code and output from the examples in the helpfiles.

Once the package is installed, there is a summary helpfile which can be viewed in Stata with:

help mrrobust

This has links to the helpfile for each command, which has an example near the bottom. In these examples you can click on the code to run it.

Overview

The mrrobust package is a collection of commands for performing two-sample Mendelian randomization analyses using summary data of genotype-phenotype and genotype-outcome associations.

Such data can be obtained from repositories such as MR-Base http://www.mrbase.org (Hemani et al. 2016).

The package contains the following commands:

  • mrratio implements the standard instrumental variable ratio (Wald) estimate with a choice of standard errors/confidence intervals.
  • mrivests automates calling mrratio on all the selected genotypes in your dataset.
  • mregger implements the IVW and MR-Egger regression approaches introduced in Bowden et al. 2015.
  • mreggersimex implements the simulation extrapolation algorithm for the MR-Egger model.
  • mreggerplot implements a scatter plot with fitted line (either from IVW, MR-Egger, or weighted median estimators) and confidence interval.
  • mrmedian and mrmedianobs implement the unweighted, weighted, and penalized weighted median IV estimators robust to 50% invalid instruments in Bowden et al. 2016.
  • mrmodal implements the zero modal estimator of Hartwig et al. 2017.
  • mrmodalplot plot of density used in modal estimator.
  • mrforest implements a forest plot of genotype specific IV estimates and estimates from models (e.g. IVW and MR-Egger).
  • mrfunnel funnel plot of genotype specific IV estimates.

Installing and updating mrrobust

Installation for Stata version 13 and later

First install the dependencies. The package uses Ben Jann's addplot, kdens, and moremata packages, the heterogi command (Orsini et al.), the metan command (Harris et al.), and the grc1leg command (Wiggins). Install these using the following commands:

ssc install addplot
ssc install kdens
ssc install moremata
ssc install heterogi
ssc install metan
net install grc1leg, from(http://www.stata.com/users/vwiggins)

To install mrrobust issue in Stata (in versions 13 and above):

net install mrrobust, from(https://raw.github.com/remlapmot/mrrobust/master/) replace

If you have previously installed the package and the net install command above fails with an error message that there are two copies of the package installed simply run adoupdate.

Updating mrrobust

To check if there is an update available to any of your user-written Stata packages run adoupdate. To update mrrobust run:

adoupdate mrrobust, update

Uninstalling mrrobust

To uninstall the package, issue in Stata:

ado uninstall mrrobust

If this fails with an error mentioning that you have multiple citations/instances of the package installed simply issue adoupdate mrrobust which should leave you with just one instance of the package, which you can then uninstall.

Installation for Stata version 12 and earlier versions

The net install syntax for installing mrrobust does not work under Stata version 12 (and earlier versions) because this webpage has an address starting with https rather than http. Therefore you need to do a manual installation.

To download and install mrrobust manually:

  • click the green "Clone or download" button at the top of the GitHub repository here and download as a zip archive.
  • On your computer, extract the zip archive and move the extracted files to your adopath
  • Typing adopath in Stata shows you the folders where the Stata programs, ado-files, are saved. You want to save the mrrobust files in the folder marked PERSONAL. If the folder Stata is pointing to does not exist simply make it, e.g. using Windows Explorer.

The installation commands for the other dependencies should work. However, if you want to install them manually:

Extract the zip archives and save all files on your adopath.

To uninstall a manual installation simply delete the files that you placed on your adopath.

Authors

Tom Palmer, Wesley Spiller, Neil Davies

How to cite the mrrobust package

Spiller W, Davies NM, Palmer TM. Software Application Profile: mrrobust - A tool for performing two-sample summary Mendelian randomization analyses. International Journal of Epidemiology, published online 12th September 2018. https://doi.org/10.1093/ije/dyy195

References

  • Bowden J, Davey Smith G, Burgess S. Mendelian randomization with invalid instruments: effect estimation and bias detection through Egger regression. International Journal of Epidemiology, 2015, 44, 2, 512-525. http://dx.doi.org/10.1093/ije/dyv080
  • Bowden J, Davey Smith G, Haycock PC, Burgess S. Consistent estimation in Mendelian randomization with some invalid instruments using a weighted median estimator. Genetic Epidemiology, published online 7 April 2016. http://dx.doi.org/10.1002/gepi.21965
  • Hartwig FP, Davey Smith G, Bowden J. Robust inference in two-sample Mendelian randomisation via the zero modal pleiotropy assumption. bioRxiv. http://dx.doi.org/10.1101/126102
  • Hemani G et al. MR-Base: a platform for systematic causal inference across the phenome using billions of genetic associations. bioRxiv, 2016. https://doi.org/10.1101/078972

Acknowledgements

Thanks to Michael Holmes, Caroline Dale, Amy Taylor, Rebecca Richmond, Judith Brand, Yanchun Bao, Kawthar Al-Dabhani, Michalis Katsoulis, and Ghazaleh Fatemifar for helpful feedback and suggestions.

About

Stata package for two-sample Mendelian randomization analyses using summary data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 69.5%
  • Stata 30.5%