mediate_hima {hdmed} | R Documentation |
High-Dimensional Mediation Analysis
Description
mediate_hima
fits a high-dimensional mediation model with
the minimax concave penalty as proposed by Zhang et al. (2016),
estimating the mediation contributions of potential mediators.
Usage
mediate_hima(
A,
M,
Y,
C1 = NULL,
C2 = NULL,
binary_y = FALSE,
n_include = NULL,
...
)
Arguments
A |
length |
M |
|
Y |
length |
C1 |
optional numeric matrix of covariates to include in the outcome model. |
C2 |
optional numeric matrix of covariates to include in the mediator model. |
binary_y |
logical flag for whether |
n_include |
integer specifying the number of top markers from sure
independent screening to be included. Default is |
... |
other arguments passed to |
Details
The first step in HIMA is to perform sure independence
screening (SIS) to choose the n_include
mediators that are most
associated with the outcome (when Y is continuous) or the exposure
(when Y is binary), based on p-values from linear regression. The second step
is to fit the outcome model for the remaining mediators with the minimax
concave penalty. HIMA then fits the mediator models using linear regression
among those mediators that have both survived SIS (in step 1) and been
selected by the MCP (in step 2), which enables estimation of the mediation
contributions. The global indirect effect is estimated by summing these
contributions, and the direct effect is estimated by subtracting the global
indirect effect from an estimate of the total effect. We compute p-values for
the mediation contributions by taking the maximum of the \alpha_a
and \beta_m
p-values, where the beta p-values are obtained via a second, unpenalized generalized
linear model containing only the mediators selected by the MCP. We include this
p-value computation so that our function replicates the behavior of the
HIMA
function from HIMA
package, the function on which ours is based, but we caution that the beta
p-values may be over-optimistic due to double-dipping, since the mediators tested in
the unpenalized model are only those chosen by the penalized model. Note also
that the HIMA authors apply Bonferroni correction to the final, maxed p-values
to account for multiple testing, which we choose to leave up to the user. For
more information, see the "HIMA" R package along with the provided reference.
Value
A list containing:
-
contributions
: a data frame containing the estimates and p-values of the mediation contributions. -
effects
: a data frame containing the estimated direct, global mediation, and total effects.
References
Zhang, H. et al. Estimating and testing high-dimensional mediation effects in epigenetic studies. Bioinformatics 32, 3150-3154 (2016).
Examples
A <- med_dat$A
M <- med_dat$M
Y <- med_dat$Y
# Fit hima with continuous outcome
out <- mediate_hima(A, M, Y)
head(out$contributions)
out$effects
# Fit hima with binary outcome
Y1 <- as.numeric(Y > mean(Y))
out1 <- mediate_hima(A, M, Y1, binary_y = TRUE)
head(out1$contributions)
out1$effects