dblassoHIMA: This is the function for high-dimensional mediation analysis...

View source: R/dblassoHIMA.R

dblassoHIMAR Documentation

This is the function for high-dimensional mediation analysis using de-biased lasso HIMA with de-biased lasso

Description

dblassoHIMA is used to estimate and test high-dimensional mediation effects using de-biased lasso penalty.

Usage

dblassoHIMA(
  X,
  Y,
  M,
  COV = NULL,
  Y.family = c("gaussian", "binomial"),
  topN = NULL,
  scale = TRUE,
  FDRcut = 0.05,
  verbose = FALSE
)

Arguments

X

a vector of exposure.

Y

a vector of outcome. Can be either continuous or binary (0-1).

M

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

COV

a data.frame or matrix of covariates dataset for testing the association M ~ X and Y ~ M.

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.

topN

an integer specifying the number of top markers from sure independent screening. Default = NULL. If NULL, topN will be either ceiling(n/log(n)) if Y.family = 'gaussian', or ceiling(n/(2*log(n))) if Y.family = 'binomial', 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

FDR 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 (FDR <FDPcut).

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

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

  • 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

Perera C, Zhang H, Zheng Y, Hou L, Qu A, Zheng C, Xie K, Liu L. HIMA2: high-dimensional mediation analysis and its application in epigenome-wide DNA methylation data. BMC Bioinformatics. 2022. DOI: 10.1186/s12859-022-04748-1. PMID: 35879655; PMCID: PMC9310002

Examples

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

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

dblassohima.fit <- dblassoHIMA(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) 
dblassohima.fit

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

dblassohima.logistic.fit <- dblassoHIMA(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)
dblassohima.logistic.fit

## End(Not run)


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