Learn R Programming

HIMA (version 2.3.0)

eHIMA: Efficient high-dimensional mediation analysis

Description

eHIMA is used to estimate and test high-dimensional mediation effects using an efficient algorithm. It provides higher statistical power than the standard hima. Note: efficient HIMA is only applicable to mediators and outcomes that are both continuous and normally distributed.

Usage

eHIMA(
  X,
  M,
  Y,
  COV = NULL,
  topN = NULL,
  scale = TRUE,
  FDRcut = 0.05,
  verbose = FALSE
)

Value

A data.frame containing mediation testing results of significant mediators (FDR <FDRcut).

Index:

mediation name of selected significant mediator.

alpha_hat:

coefficient estimates of exposure (X) --> mediators (M) (adjusted for covariates).

alpha_se:

standard error for alpha.

beta_hat:

coefficient estimates of mediators (M) --> outcome (Y) (adjusted for covariates and exposure).

beta_se:

standard error for beta.

IDE:

mediation (indirect) effect, i.e., alpha*beta.

rimp:

relative importance of the mediator.

pmax:

joint raw p-value of selected significant mediator (based on divide-aggregate composite-null test [DACT] method).

Arguments

X

a vector of exposure. Do not use data.frame or matrix.

M

a data.frame or matrix of high-dimensional mediators. Rows represent samples, columns represent mediator variables. M has to be continuous and normally distributed.

Y

a vector of continuous outcome. Do not use data.frame or matrix.

COV

a matrix of adjusting covariates. Rows represent samples, columns represent variables. Can be NULL.

topN

an integer specifying the number of top markers from sure independent screening. Default = NULL. If NULL, topN will be 2*ceiling(n/log(n)), where n is the sample size. If the sample size is greater than topN (pre-specified or calculated), all mediators will be included in the test (i.e. low-dimensional scenario).

scale

logical. Should the function scale the data? Default = TRUE.

FDRcut

Benjamini-Hochberg FDR cutoff applied to select significant mediators. Default = 0.05.

verbose

logical. Should the function be verbose? Default = FALSE.

References

Bai X, Zheng Y, Hou L, Zheng C, Liu L, Zhang H. An Efficient Testing Procedure for High-dimensional Mediators with FDR Control. Statistics in Biosciences. 2024. DOI: 10.1007/s12561-024-09447-4.

Examples

Run this code
if (FALSE) {
# Note: In the following example, M1, M2, and M3 are true mediators.
data(himaDat)

# Y is continuous and normally distributed
# Example (continuous outcome):
head(himaDat$Example1$PhenoData)

eHIMA.fit <- eHIMA(
  X = himaDat$Example1$PhenoData$Treatment,
  Y = himaDat$Example1$PhenoData$Outcome,
  M = himaDat$Example1$Mediator,
  COV = himaDat$Example1$PhenoData[, c("Sex", "Age")],
  scale = FALSE, # Disabled only for simulation data
  FDRcut = 0.05,
  verbose = TRUE
)
eHIMA.fit
}

Run the code above in your browser using DataLab