reverseMRsim: reverseMRsim

Description Usage Arguments Value Author(s)

View source: R/reverseMRsim.R

Description

A function to simulate the performance of different MR methods from the MendelianRandomization package in scenarios of reverse causality.

Usage

1
2
3
4
reverseMRsim(n = 1000, nSNP = 3, MAF = c(0.2, 0.2, 0.2),
  gamma0 = 0, gammaX = c(0.2, 0.2, 0.2), varM = 1, beta0 = 0,
  betaM = c(0, 0.1), varY = 1, nSim = 100, plot.pdf = T,
  plot.name = "reverseMRsim.pdf", alpha_level = 0.05, SEED = 1)

Arguments

n

is the sample size

nSNP

is the number of SNPS to generate

MAF

is a vector of the MAF of each SNP

gamma0

is the intercept for M

gammaX

is a vector of the associations of each SNP with M

varM

is the variance of M

beta0

is the intercept for Y

betaM

is a vector of different associations of M with Y

varY

is the variance of Y

nSim

is the number of simulations to run

plot.pdf

is T to output a plot, is F to not output a plot

plot.name

is the name of the plot

alpha_level

is the significance level

SEED

is the seed

Value

a matrix of the power of three Mendelian Randomization approaches from the MendelianRandomization package to detect an effect of the mediator M on the outcome Y when M and Y are correctly specified and also when they are incorrectly specified (the true mediator is Y and the true outcome is M)

Author(s)

Annie Thwing, Sharon Lutz


SharonLutz/reverseCT documentation built on Oct. 30, 2019, 11:54 p.m.