test_mrtryx.Rmd
library(knitr) knitr::opts_chunk$set(echo=TRUE, message=FALSE, warning=FALSE, dev="png", cache=TRUE, eval=FALSE)
Test commands for each function
library(TwoSampleMR) library(MRInstruments) library(RadialMR) library(tryx)
Data preparation
Example: systolic blood pressure and coronary artery disease
ao <- available_outcomes() bmi <- extract_instruments(outcomes = 2) sbp <- extract_outcome_data(snps=bmi$SNP, outcomes = "UKB-a:360") dat <- harmonise_data(bmi, sbp)
Scan
scan_bmi <- tryx.sig(scan_bmi)
id_remove <- c(2, 72, 89, 90, "UKB-a:35", "UKB-a:359", "UKB-a:61", 1096, 85, 91, 93, 999) ad <- tryx.adjustment(scan_bmi, id_remove = id_remove)
ad.mv <- tryx.adjustment.mv(scan_bmi, id_remove = id_remove)
an <- tryx.analyse(scan_bmi, id_remove = id_remove)
an.mv <- tryx.analyse.mv(scan_bmi, id_remove = id_remove)