bmem | R Documentation |
Mediation analysis based on bootstrap
bmem(data, model, v, method='list', ci='perc', cl=.95, boot=1000, m=10, varphi=.1, st='i', robust=FALSE, max_it=500, parallel=FALSE, ncore=1, ...)
data |
A data set |
model |
RAM path for the mediaiton model |
v |
Indices of variables used in the mediation model. If omitted, all variables are used. |
method |
|
ci |
|
cl |
Confidence level. Can be a vector. |
boot |
Number of bootstraps |
m |
Number of imputations |
varphi |
Percent of data to be downweighted in robust method |
st |
Starting values |
robust |
Whether to use roubst method |
max_it |
Maximum number of iterations in EM |
parallel |
Whether to use parallel method to calculate. |
ncore |
Number of cores for parallel method. |
... |
Other options for |
The indirect effect can be specified using equations such as a*b
, a*b+c
, and a*b*c+d*e+f
, which can be defined in 'model' parameter.
The on-screen output includes the parameter estimates, bootstrap standard errors, and CIs.
Zhiyong Zhang, Shuigen Ming and Lijuan Wang
Zhang, Z., & Wang, L. (2013). Methods for mediation analysis with missing data. Psychometrika, 78(1), 154-184. doi: 10.1007/s11336-012-9301-5
Yuan, KH., Zhang, Z. Robust Structural Equation Modeling with Missing Data and Auxiliary Variables. Psychometrika 77, 803-826 (2012). doi: 10.1007/s11336-012-9282-4
data("PoliticalDemocracy") model_l <- ' ind60 =~ x1 + g*x2 + h*x3 dem60 =~ y1 + d*y2 + e*y3 + f*y4 dem65 =~ y5 + d*y6 + e*y7 + f*y8 dem60 ~ a * ind60 dem65 ~ c * ind60 + b * dem60 y1 ~~ y5 y2 ~~ y4 + y6 y3 ~~ y7 y4 ~~ y8 y6 ~~ y8 ind := a*b ' fit_l <- bmem(data=PoliticalDemocracy, model = model_l, method='list', ci='perc', boot=50, parallel = TRUE, ncore = 8) summary(fit_l)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.