Skip to contents

For each univariate exposure variable and the subset of mediators MS, the hdmax2::estimate_effect() function computes several estimates to evaluate the indirect effects in the path between exposure variables and the outcome variable. Initially, this function assesses each mediator variable MS_j individually and computes causal measures of interest such as (i) the Average Causal Mediated Effect (ACME, corresponding to the indirect effect) and (ii) the Proportion Mediated (PM). The ACME differs from the Average Direct Effect (ADE), which represents the unmediated effect, and from the Total Effect (TE) which is equal to the sum of direct and indirect effect. PM corresponds to the proportion of the total effect that is mediated by the mediator (ratio of the indirect effect to the total effect). ACME and PM are computed by the mediation::mediate() function of the package mediation, that automatically detects the type of statistical model used in the mediation analysis (Tingley et al. 2014). The function mediation::mediate() calculates uncertainty estimates by a quasi-Bayesian Monte Carlo approach described (Imai et al. 2010). In addition, it estimates the intermediary effect sizes a_j and b_j and their standard deviations. Eventually, hdmax2 calculates an Overall Indirect Effect (OIE) from a single model that includes all mediators MS simultaneously. The OIE corresponds to the sum of the indirect effect associated with all mediators. The confidence interval (CI) of the OIE is estimated by a bootstrap approach. Along with the OIE, hdmax2 estimates the Overall Total Effect (OTE) corresponding to the effect of exposure variables on the outcome variable, as well as the Overall Direct Effect (ODE) corresponding to the effect of exposure variables on the outcome variable when the mediators MS are included in the model.

Usage

estimate_effect(object, m, boots = 1000, ...)

Arguments

object

results from hdmax2 step 2

m

a response variable matrix with n rows and p columns corresponding to mediators selected at step1. Response variables must be encoded as numeric. No NAs allowed.

boots

number of bootstrap

...

arguments for inner functions

Value

hdmax2_step2 object

  • ACME, estimation of the average causal mediation effect (the indirect effect)

  • ADE, estimation average direct effect

  • PM, estimation of the proportion mediated

  • TE, estimation of the total effect

Regressions:

  • xm, regression X on M

  • my, regression M on Y

Overall effect

  • oie, overall indirect effect

  • oie_med , oie median

  • oie_sd , oie standard deviation

  • ote, overall total effect

  • ode, overall direct effect

Details

We use the mediate function of the mediation package on the set of markers having Q-value lower than the FDR threshold. It estimates their indirect effects and tests their significance.

Author

Florence Pittion, Magali Richard, Olivier Francois, Basile Jumentier

Examples

# Load example dataset
attach(simu_data)
K = 5
# Run {hdmax2} step 1
hdmax2_step1 = hdmax2::run_AS(
  exposure = simu_data$X_binary,
  outcome =  simu_data$Y_continuous,
  M =  simu_data$M1,
  K = K
)
#> Running first regression with univariate exposure variable.
#> Running second regression.
#> Running max-squared test.
# Select mediators
mediators_subset = names(sort(hdmax2_step1$max2_pvalues)[1:10])
mediators_top10 = simu_data$M1[, mediators_subset]
# Run {hdmax2} step 2
hdmax2_step2 = hdmax2::estimate_effect(object = hdmax2_step1, 
                                       m = mediators_top10)
#> Estimating indirect effect for univariate exposome.
#> The input exposome is continuous or binary
#> Generate regression 1 for continuous or binary exposure and mediator 1
#> Generate regression 2 for continuous outcome and mediator 1
#> Generate regression 1 for continuous or binary exposure and mediator 2
#> Generate regression 2 for continuous outcome and mediator 2
#> Generate regression 1 for continuous or binary exposure and mediator 3
#> Generate regression 2 for continuous outcome and mediator 3
#> Generate regression 1 for continuous or binary exposure and mediator 4
#> Generate regression 2 for continuous outcome and mediator 4
#> Generate regression 1 for continuous or binary exposure and mediator 5
#> Generate regression 2 for continuous outcome and mediator 5
#> Generate regression 1 for continuous or binary exposure and mediator 6
#> Generate regression 2 for continuous outcome and mediator 6
#> Generate regression 1 for continuous or binary exposure and mediator 7
#> Generate regression 2 for continuous outcome and mediator 7
#> Generate regression 1 for continuous or binary exposure and mediator 8
#> Generate regression 2 for continuous outcome and mediator 8
#> Generate regression 1 for continuous or binary exposure and mediator 9
#> Generate regression 2 for continuous outcome and mediator 9
#> Generate regression 1 for continuous or binary exposure and mediator 10
#> Generate regression 2 for continuous outcome and mediator 10
#> Computing ODE and OTE for continuous outcome.