reverseMAsim.MultiProcess: reverseMAsim.MultiProcess

Description Usage Arguments Value Author(s)

View source: R/reverseMAsim_impl.R

Description

A function to similate the performance of the mediate function from the mediation package in scenarios of reverse causality. Leverages parallel processing and Rcpp with Eigen for faster computation speed.

Usage

1
2
3
4
5
reverseMAsim.MultiProcess(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,
  use_cpp = F, num_jobs = 2)

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

use_cpp

use Rcpp with Eigen

num_jobs

the number of cores to use, i.e. the number of parallel procesess to spawn

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)

Michael Gooch, Annie Thwing, Sharon Lutz


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