Using "mxAlgebras" to compare indirect effects

Posted on
No user picture. jennies001 Joined: 10/19/2023
Forums
Hi community,

I am currently using the wls() function from the MetaSEM package to conduct mediation analysis with two parallel mediators. My code successfully estimates the indirect effects and their significance using likelihood-based confidence intervals. However, I am curious about estimating the difference between these indirect effects (e.g., between the two indirect effects).

I attempted to write a function such as a1b1 - a2b2, and it produced results. Now, I am wondering how reliable this practice is, as I have found little mention of it in Mike’s book and seminars.

Here is my code for reference:


MASEM_df2_Total_Effect <- wls(
Cov = corr_df,
aCov = acov_df,
n = sample_size,
diag.constraints = TRUE,
RAM = RAM,
cor.analysis = TRUE,
intervals.type = "LB",
mx.algebras = list(
Total = mxAlgebra(b12 * b24 + b13 * b34 + b14, name = "Total"),
Indirect_total = mxAlgebra(b12 * b24 + b13 * b34, name = "Indirect_total"),
Indirect_1 = mxAlgebra(b12 * b24, name = "Indirect_1"),
Indirect_2 = mxAlgebra(b13 * b34, name = "Indirect_2"),
Indirect_diff = mxAlgebra(b12 * b24 - b13 * b34, name = "Indirect_diff")
)
)

Best regards,
Jennis

Replied on Fri, 07/26/2024 - 10:29
Picture of user. Mike Cheung Joined: 10/08/2009

Dear Jennis,

I am unaware of any meta-analysis studies, but there is one on the primary studies. It works reasonably well.

Cheung, M. W.-L. (2007). Comparison of approaches to constructing confidence intervals for mediating effects using structural equation models. Structural Equation Modeling: A Multidisciplinary Journal, 14(2), 227–246. https://doi.org/10.1080/10705510709336745

Best,
Mike

Replied on Fri, 07/26/2024 - 15:11
Picture of user. AdminHunter Joined: 03/01/2013

If the wls() function returns an MxModel object class, then you can add profile likelihood confidence intervals directly on the mxAlgebra's. You can then run them with omxRunCI().

I'm happy to elaborate if needed!