reverseMAsim: reverseMAsim

Description Usage Arguments Value Author(s)

View source: R/reverseMAsim.R

Description

A function to similate the performance of the mediate function from the mediation package in scenarios of reverse causality.

Usage

1
2
reverseMAsim(n = 1000, pX = 0.2, gamma0 = 0, gammaX = 0.1, varM = 1, beta0 = 0, betaX = 1, betaM = c(0, 0.1, 0.2), 
varY = 1, nSim = 100, nSimImai = 1000, SEED = 1, plot.pdf = T, plot.name = "reverseMAsim.pdf", alpha_level = 0.05)

Arguments

n

is the sample size.

pX

is the minor allele frequency

gamma0

is the intercept for M

gammaX

is the association of X with M

varM

is the variance of M

beta0

is the intercept for Y

betaX

is the direct effect of X on 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

nSimImai

is the number of simulations to run in mediate from the mediation package

SEED

is the seed

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

Value

a matrix of the power of the mediate method from the mediation 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/reverseC documentation built on Aug. 29, 2019, 5:58 a.m.