Closed paige-cho closed 8 months ago
Thank you for your kind comments regarding the package. It should be able to handle covariates and moderated mediation with bootstrapping. Support for brms is coming very soon. It may be that there was a delay in announcing covariates as part of that code was experimental and I occasionally heard reports of it encountering problems. @toddvogel1628 may be able to say more about that.
It does not support a categorical mediator for various reasons. It also does not support survey weights.
Thank you for your comments and help. It's wonderful that the package supports covariates. Thank you very much!
Yes, the package should now be able to handle covariates using the covars.m
and covars.y
arguments in the modmed.mlm
function. These can include more than one covariate by using a vector of column names in the dataset, e.g., c("covar1", "covar2")
. It will give an error if these variables have the same names as any moderators used (see stack_bpg
in the utils.R file).
The package also supports moderated mediation using the moderator
, mod.a
, mod.b
, and mod.cprime
for the various paths in the modmed.mlm
function. You can include random effects on the normal paths, moderators, or covariates using the random.a
, random.mod.a
, random.covars.m
, etc. arguments, although this can quickly increase the complexity of the model and lead to estimation issues without a lot of data.
I think if there are no other questions for this issue, I'll close this one for now. A dichotomous outcome or mediator could be added as a request (separate issue), but I'm not sure we would get to it for a while. Survey weights as well, and that may depend somewhat on either what the underlying software supports or someone doing work to figure out how this jives with bootstrapping.
Hello!
I am very excited to have found and read one of the few studies, (and probably the only one providing R codes!) on longitudinal mediation model using R. In the article (Multilevel mediation analysis in R: A comparison of bootstrap and Bayesian approaches), I read that the 'multilevelmediation' package does not yet accomodate including covariates, moderated mediation, and dummy mediator (and probably not the survey weight?). I am seeking your advice on if these features can be explored through other alternative packages than the 'multilevelmediation', or it can now be handled through the 'multilevelmediation' package. Thank you so much for developing the package for R. It is almost like an oasis in the dessert!
Seongha Cho