sim_mediation_data: Simulate data for analysis.

View source: R/sim_mediation_data.R

sim_mediation_dataR Documentation

Simulate data for analysis.

Description

Simulate data for analysis.

Usage

sim_mediation_data(
  hypo = "H00",
  sample_size = 1000,
  num_mediators = 30,
  num_mechanisms = 10000,
  num_covariates = 2,
  SS = NULL,
  har = 0.1,
  mm = 0,
  vv = 0,
  sm = 5,
  mc = 5,
  Styp = "C"
)

Arguments

hypo

Hypothesis type: "H00" refers to the complete null hypothese (default); "G0A" refers to the null hypothese with only alpha-signals; "G0B" refers to the null hypothese with only beta-signals; "H02" refers to the cases with disjoint signals, if rho=0 then it is a null, otherwise alternative; "HA" refer to the alternative hypothesis with connected signals.

sample_size

Number of samples, default=1000.

num_mediators

Number of mediators, default=30.

num_mechanisms

Number of mechanisms, default=10000.

num_covariates

Number of covariates, default=2.

SS

The correlation matrix between mediators.

har

The percentage of mechanisms with signals within one experiment, default=0.1. (affect when hypo is not "H00")

mm

The mean of the signal, default=0. (affect when hypo is not "H00")

vv

The variance of the signal, default=0. (affect when hypo is not "H00")

sm

Number of mediators with signal within one mechanism, default=5. (affect when hypo is not "H00")

mc

Number of cores for parallel computing, default=5.

Examples

H00=sim_mediation_data()
H00_ss=sim_mediation_data(sample_size=100)
H00_rh=sim_mediation_data(rho=0)
G0A=sim_mediation_data(hypo="G0A",har=0.1,mm=0,vv=0.05,sm=5)
G0B=sim_mediation_data(hypo="G0B",har=0.1,mm=0,vv=0.05,sm=5)
H02_null=sim_mediation_data(hypo="H02",har=1,mm=0,vv=0.05,sm=2)
HA=sim_mediation_data(hypo="HA",mm=0.1,vv=0.1,sm=10)

roqe/MACtest documentation built on Aug. 6, 2023, 9:53 a.m.