Two sample Mendelian randomisation (2SMR) is a method to estimate the causal effect of an exposure on an outcome using only summary statistics from genome wide association studies (GWAS). Though conceptually straightforward, there are a number of steps that are required to perform the analysis properly, and they can be cumbersome. The TwoSampleMR package aims to make this easy by combining three important components

The general principles (Davey Smith and Ebrahim 2003; Davey Smith and Hemani 2014), and statistical methods (Pierce and Burgess 2013; Bowden, Davey Smith, and Burgess 2015) can be found elsewhere, here we will just outline how to use the R package.


To install directly from the GitHub repository do the following:

If you don’t have the devtools package install it from CRAN using install.packages("devtools").


The workflow for performing MR is as follows:

  1. Select instruments for the exposure (perform LD clumping if necessary)
  2. Extract the instruments from the MR Base GWAS database for the outcomes of interest
  3. Harmonise the effect sizes for the instruments on the exposures and the outcomes to be each for the same reference allele
  4. Perform MR analysis, sensitivity analyses, create plots, compile reports

A diagramatic overview is shown here: