modalityMediationDataGen: Data Generation for High-Dimensional Mediation Model

View source: R/modalityMediationDataGen.R

modalityMediationDataGenR Documentation

Data Generation for High-Dimensional Mediation Model

Description

Data Generation for High-Dimensional Mediation Model

Usage

modalityMediationDataGen(
  n = 100,
  p = 50,
  sigmaY = 1,
  sizeNonZero = c(3, 3, 4),
  alphaMean = c(6, 4, 2),
  alphaSd = 0.1,
  betaMean = c(6, 4, 2),
  betaSd = 0.1,
  sigmaM1 = NULL,
  gamma = 3,
  generateLaplacianMatrix = FALSE,
  seed = 20231201
)

Arguments

n

The number of subjects for the high-dimensional mediation model)

p

The number of high-dimensional mediators.

sigmaY

The argument "sigmaY" represents the standard deviation (SD) of the error distribution for the dependent variable.

sizeNonZero

The number of nonzero mediators. Here, we provide simulated scenarios that could produce large, medium, and small mediated effects, generating from a normal distribution.

alphaMean, alphaSd

The mean and SD vector of the effect between the mediator and independent variable.

betaMean, betaSd

The mean and SD vector of the effect between the mediator and dependent variable.

sigmaM1

The covariance matrix of the error distribution among mediators. Default is diag(p).

gamma

The true value of direct effect.

generateLaplacianMatrix

A logical value to specify whether to generate Laplacian matrix for network penalty.

seed

The random seed. Default is NULL to use the current seed.

Value

A object with three elements.

  • MediData: The simulated data for high-dimensional mediation model.

  • MediPara: The true value for mediated effect and direct effect.

  • Info : The output includes random seed, parameter setting, and Laplacian matrix for generating mediation model.

Examples

simuData <- modalityMediationDataGen(seed = 20231201)

HDMAADMM documentation built on May 29, 2024, 12:08 p.m.