Supplemental Material for Causal Mediation Analysis With Two Mediators: A Comprehensive Guide to Estimating Total and Natural Effects Across Various Multiple Mediators Setups

Variable descriptionTo illustrate the process of conducting a causal mediation analysis with two mediators, we used data from the International Dating Violence Study (Strauss, 2011) conducted between 2001 and 2006.The initial sample size consisted of 17, 404 participants, of whom 8, 896 were excluded because they had not been involved in a romantic relationship for at least one year, leaving a sample of 8, 508 individuals.An additional 2, 284 participants were excluded because they were not Canadian, American, or European, resulting in a final sample size of n = 6, 224.Childhood maltreatment was assessed using the following question: "When I was less than 12 years old, I was spanked or hit a lot by my mother or father."Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").The variable has been recoded to vary from 0 to 3 when treating childhood maltreatment as a continuous variable.A binary indicator was created to indicate exposure to childhood maltreatment; the indicator was equal to 1 if participants answered "Agree" or "Strongly Agree", and 0 otherwise.Post-traumatic stress symptoms were measured as the mean of eight items, such as "I've been terrified by things that have happened to me" and "I try not to think about terrible things that happened to me." Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").The Cronbach's alpha based on our final sample was = 0.74.Alcohol use was assessed using four items, including "I sometimes drink enough to feel really high or drunk" and "Sometimes I can't remember what happened the night before because of drinking."Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").For instructional purposes, a binary indicator of problematic alcohol use was created.It was equal to 1 ("Problematic alcohol use") if participants answered "Strongly Agree" to any of these items, and 0 ("No problematic alcohol use") otherwise.Religious involvement was measured as the mean of two items: "I attend a church, synagogue, or mosque once a month or more" and "I rarely have anything to do with religious activities".The answers ranged from 1 ("Strongly Disagree") to 4 ("Strongly bys tempID : gen replicate = _n * Find the quantiles gen D = 0.05 + (.90/4)*(replicate-1) estimate restore pxc predict pxc * Set x0 to the 5 quantiles gen x0 = e(rmse)*invnormal(D) + pxc * Set x1 to x_cont for all replications gen x1 = x_cont * Imputation of the outcome estimate restore py replace x_cont = x0 predict y_hat *-----Natural effect models ***Conditional glm y_hat c.x0##c.x1 i.c1 c2 c3 c4 c5 c6 i.c7 i.c8, fam(bin) link(logit) matrix coef[1,1] = 0.7*_b[x0] matrix coef[1,2] = (_b[x1] + 0.7*_b[x0#x1])*0.7 matrix coef[1,3] = coef[1,1] + coef[1,2] restore *-----Results ***Colname matrix colnames coef = "NDEc" "NIEc" "TEc" *****Return ereturn post coef, esample(`touse') end * Set the value of J local J = 5 * Mediation model (M1) for calculating weights regress m1 x_cont i.c1 c2 c3 c4 c5 c6 i.c7 i.c8 estimate store m1 * Mediation model (M2) for calculating weights regress m2 x_cont i.c1 c2 c3 c4 c5 c6 i.c7 i.c8 estimate store m2 preserve * Matrix to save estimates matrix coef = J(1, 6, .)gen tempID = _n * Expand the data set by a factor of J expand `J' sort tempID estimate restore pxc predict meanA * Set x0 to x_cont for all replications gen x0 = x_cont * Randomly draw J values for x1, and then expand the data set by a *factor of J * x1 replicates the J sampled values sequence J times gen x1 = rnormal(meanA, e(rmse)) expand `J' bys tempID x1 : gen counter_id = _n * Arrange the values of x2 * x2 replicates each of the J sampled values J times by tempID : gen x2 = x1[1+ `J'*(counter_id-1)] * Computing weights based on M1

Publication Details

Journal
Psychological Methods
Published
2025-10-02
DOI
https://doi.org/10.1037/met0000781.supp
Primary Topic
Information and Cyber Security
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Supplemental Material for Causal Mediation Analysis With Two Mediators: A Comprehensive Guide to Estimating Total and Natural Effects Across Various Multiple Mediators Setups

Psychological Methods
Information and Cyber Security
article

Supplemental Material for Causal Mediation Analysis With Two Mediators: A Comprehensive Guide to Estimating Total and Natural Effects Across Various Multiple Mediators Setups

article en

Abstract

Variable descriptionTo illustrate the process of conducting a causal mediation analysis with two mediators, we used data from the International Dating Violence Study (Strauss, 2011) conducted between 2001 and 2006.The initial sample size consisted of 17, 404 participants, of whom 8, 896 were excluded because they had not been involved in a romantic relationship for at least one year, leaving a sample of 8, 508 individuals.An additional 2, 284 participants were excluded because they were not Canadian, American, or European, resulting in a final sample size of n = 6, 224.Childhood maltreatment was assessed using the following question: "When I was less than 12 years old, I was spanked or hit a lot by my mother or father."Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").The variable has been recoded to vary from 0 to 3 when treating childhood maltreatment as a continuous variable.A binary indicator was created to indicate exposure to childhood maltreatment; the indicator was equal to 1 if participants answered "Agree" or "Strongly Agree", and 0 otherwise.Post-traumatic stress symptoms were measured as the mean of eight items, such as "I've been terrified by things that have happened to me" and "I try not to think about terrible things that happened to me." Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").The Cronbach's alpha based on our final sample was = 0.74.Alcohol use was assessed using four items, including "I sometimes drink enough to feel really high or drunk" and "Sometimes I can't remember what happened the night before because of drinking."Responses ranged from 1 ("Strongly Disagree") to 4 ("Strongly Agree").For instructional purposes, a binary indicator of problematic alcohol use was created.It was equal to 1 ("Problematic alcohol use") if participants answered "Strongly Agree" to any of these items, and 0 ("No problematic alcohol use") otherwise.Religious involvement was measured as the mean of two items: "I attend a church, synagogue, or mosque once a month or more" and "I rarely have anything to do with religious activities".The answers ranged from 1 ("Strongly Disagree") to 4 ("Strongly bys tempID : gen replicate = _n * Find the quantiles gen D = 0.05 + (.90/4)*(replicate-1) estimate restore pxc predict pxc * Set x0 to the 5 quantiles gen x0 = e(rmse)*invnormal(D) + pxc * Set x1 to x_cont for all replications gen x1 = x_cont * Imputation of the outcome estimate restore py replace x_cont = x0 predict y_hat *-----Natural effect models ***Conditional glm y_hat c.x0##c.x1 i.c1 c2 c3 c4 c5 c6 i.c7 i.c8, fam(bin) link(logit) matrix coef[1,1] = 0.7*_b[x0] matrix coef[1,2] = (_b[x1] + 0.7*_b[x0#x1])*0.7 matrix coef[1,3] = coef[1,1] + coef[1,2] restore *-----Results ***Colname matrix colnames coef = "NDEc" "NIEc" "TEc" *****Return ereturn post coef, esample(`touse') end * Set the value of J local J = 5 * Mediation model (M1) for calculating weights regress m1 x_cont i.c1 c2 c3 c4 c5 c6 i.c7 i.c8 estimate store m1 * Mediation model (M2) for calculating weights regress m2 x_cont i.c1 c2 c3 c4 c5 c6 i.c7 i.c8 estimate store m2 preserve * Matrix to save estimates matrix coef = J(1, 6, .)gen tempID = _n * Expand the data set by a factor of J expand `J' sort tempID estimate restore pxc predict meanA * Set x0 to x_cont for all replications gen x0 = x_cont * Randomly draw J values for x1, and then expand the data set by a *factor of J * x1 replicates the J sampled values sequence J times gen x1 = rnormal(meanA, e(rmse)) expand `J' bys tempID x1 : gen counter_id = _n * Arrange the values of x2 * x2 replicates each of the J sampled values J times by tempID : gen x2 = x1[1+ `J'*(counter_id-1)] * Computing weights based on M1

Psychological Methods
Openalex Percentile: Top 60%
Information and Cyber Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.