simHIMA {HIMA}R Documentation

Simulation Data Generator for High-dimensional Mediation Analyais

Description

simHIMA is used to generate simulation data for high-dimensional mediation analysis.

Usage

simHIMA(n, p, alpha, beta, binaryOutcome = FALSE, seed)

Arguments

n

an integer specifying sample size.

p

an integer specifying the dimension of mediators.

alpha

a numeric vector specifying the regression coefficients alpha (exposure –> mediators).

beta

a numeric vector specifying the regression coefficients beta (mediators –> outcome).

binaryOutcome

logical. Should the simulated outcome variable be binary?

seed

an integer specifying a seed for random number generation.

See Also

see hima to run HIMA.

Examples

n <- 100  # sample size
p <- 500 # the dimension of covariates

# the regression coefficients alpha (exposure --> mediators)
alpha <- rep(0, p) 

# the regression coefficients beta (mediators --> outcome)
beta <- rep(0, p) 

# the first four markers are true mediators.
alpha[1:4] <- c(0.45,0.5,0.55,0.6)
beta[1:4] <- c(0.5,0.45,0.4,0.35)

alpha[7:8] <- 0.5
beta[5:6] <- 0.5

# Generate simulation data
simdat = simHIMA(n, p, alpha, beta, seed=1029) 


[Package HIMA version 1.0.7 Index]