--mediation

Switch

--mediation

Description

Mediation analysis considers three variables, as seen in the following figure: path start (also called the treatment), mediator and outcome.

Argument and Default Value

These variables can be located within a feature or outcome table. There are 4 switches to specify where the features will go within the mediation: --feat_as_path_start, --feat_as_outcome, --feat_as_control, --no_features. Once you specify which variable is in the feature table all other variables will be in the outcome table. There is the option to specify specific features or consider the entire feature table. For example, if your outcome variable is a feature you can run either of the following two commands:

Details

Mediation analysis considers three variables, as seen in the following figure: path start (also called the treatment), mediator and outcome.

These variables can be located within a feature or outcome table. There are 4 switches to specify where the features will go within the mediation: --feat_as_path_start, --feat_as_outcome, --feat_as_control, --no_features. Once you specify which variable is in the feature table all other variables will be in the outcome table. There is the option to specify specific features or consider the entire feature table. For example, if your outcome variable is a feature you can run either of the following two commands:

# Specify feature 1200 as the outcome ./dlatkInterface.py -d twitterGH -t messages_en -c cty_id -f 'feat$cat_met_a30_2000_cp_w$messages_en$cty_id$16to16' --mediation --path_start 'hsgradHC03_VC93ACS3yr$10' --mediators 'ucd_I25_1_atheroHD$0910_ageadj' --outcome_table nejm_intersect_small50k --outcomes '1200' --feat_as_outcome

# Consider all features as outcomes ./dlatkInterface.py -d twitterGH -t messages_en -c cty_id -f 'feat$cat_met_a30_2000_cp_w$messages_en$cty_id$16to16' --mediation --path_start 'hsgradHC03_VC93ACS3yr$10' --mediators 'ucd_I25_1_atheroHD$0910_ageadj' --outcome_table nejm_intersect_small50k --feat_as_outcome

The analysis is done using two methods. The first is the Baron and Kenny method with a Sobel test for significance. We first do three regressions (all of which are normalized):

Regress the outcome with the path start:

Regress the mediator with the path start:

Regress the outcome with the path start and the mediator:

We then check if , and are significant and that is smaller in absolute value than . The Sobel test score is calculated as

where and are the standard error of , , respectively.

The second analysis outputs the following varirables:

ACME (control) = Average Causal Mediation Effect with controls ACME (treated) = Average Causal Mediation Effect without controls ADE (control) = Average Direct Effect with controls ADE (treated) = Average Direct Effect without controls

When no controls are given then ACME (control) = ACME (treated) and ADE (control) = ADE (treated). In the case of linear models with no interactions involving the mediator, the results should be similar or identical to the earlier Barron:doc:fwflag_Kenny approach.

Other Switches

Required Switches: * -d, -g, -t * -f FEATURE_TABLE_NAME (note: this becomes optional if --no_features is used) * --path_starts PATH_START_1 ... PATH_START_I * --mediators MEDIATOR_1 ... MEDIATOR_J * --outcomes OUTCOME_1 ... OUTCOME_K * --outcome_table OUTCOME_TABLE_NAME Optional Switches: * fwflag_controls CONTROL_1 ... CONTROL_L * --group_freq_thresh GROUP_THRESH * --feat_as_path_start or --feat_as_outcome or --feat_as_control or --no_features * --p_value --mediation_boot --mediation_boot_num --output_name OUTPUT_FILE_NAME * --mediation_no_summary * --mediation_csv * --mediation_method * fwflag_no_bonferroni * --p_correction

Example Commands

Part of Output: