eHIMA: Efficient high-dimensional mediation analysis

View source: R/eHIMA.R

eHIMAR Documentation

Efficient high-dimensional mediation analysis

Description

eHIMA is used to estimate and test high-dimensional mediation effects using an efficient algorithm.

Usage

eHIMA(
  X,
  M,
  Y,
  COV = NULL,
  Y.family = c("gaussian", "binomial"),
  penalty = c("MCP", "SCAD", "lasso"),
  topN = NULL,
  scale = TRUE,
  FDRcut = 0.05,
  verbose = FALSE
)

Arguments

X

a vector of exposure.

M

a data.frame or matrix of high-dimensional mediators. Rows represent samples, columns represent mediator variables.

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.

Y.family

either 'gaussian' (default) or 'binomial', depending on the data type of outcome (Y). This parameter is passed to function lasso.proj in R package hdi for de-biased lasso penalization.

penalty

the penalty to be applied to the model (a parameter passed to function ncvreg in package ncvreg. Either 'MCP' (the default), 'SCAD', or 'lasso'.

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

BH-FDR-corrected p value cutoff applied to define and select significant mediators. Default = 0.05.

verbose

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

Value

A data.frame containing mediation testing results of selected mediators (Bonferroni-adjusted p value <Bonfcut).

  • ID: index of selected significant mediator.

  • alpha: coefficient estimates of exposure (X) –> mediators (M).

  • alpha_se: standard error for alpha.

  • beta: coefficient estimates of mediators (M) –> outcome (Y) (adjusted for exposure).

  • beta_se: standard error for beta.

  • gamma: coefficient estimates of exposure (X) –> outcome (Y) (total effect).

  • alpha*beta: mediation effect.

  • % total effect: alpha*beta / gamma. Percentage of the mediation effect out of the total effect.

  • p.joint: joint raw p-value of selected significant mediator (based on FDR).

References

Zhang H, Hong X, Zheng Y, Hou L, Zheng C, Wang X, Liu L. High-Dimensional Quantile Mediation Analysis with Application to a Birth Cohort Study of Mother–Newborn Pairs. Bioinformatics. 2024. DOI: 10.1093/bioinformatics/btae055. PMID: 38290773; PMCID: PMC10873903

Examples

## Not run: 
# Note: In the following example, M1, M2, and M3 are true mediators.
data(himaDat)

# When Y is continuous and normally distributed
# Example 1 (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")],
                   Y.family = 'gaussian',
                   scale = FALSE,
                   verbose = TRUE) 
eHIMA.fit

# When Y is binary (should specify Y.family)
# Example 2 (binary outcome): 
head(himaDat$Example2$PhenoData)

eHIMA.fit <- eHIMA(X = himaDat$Example2$PhenoData$Treatment,
                   Y = himaDat$Example2$PhenoData$Disease,
                   M = himaDat$Example2$Mediator,
                   COV = himaDat$Example2$PhenoData[, c("Sex", "Age")],
                   Y.family = 'binomial',
                   scale = FALSE,
                   verbose = TRUE)
eHIMA.fit

## End(Not run)


YinanZheng/HMA documentation built on April 23, 2024, 4:55 a.m.