True if the outcome is binary, otherwise False. Default is False.
data1
The transformed and organized data set from data.org. If the data set has not been organized, leave data1=NULL (by default), and set org.data=T with the transformation functions (f arguments). Otherwise, set data1 as the output from the data.org function and do not include the arguments: org.data and fs.
x
the vector of the predictive variable.
levelx
the level of x (1 or 2), 1 by default.
levely
the level of y (1 or 2), 1 by default.
m
the matrix or vector of mediators.
l1
the column numbers of level 1 continuous mediators in m or the list of names of the level 1 continuous mediators.
l2
the column numbers of level 2 continuous mediators in m or the list of names of the level 2 continuous mediators.
c1
the column numbers of level 1 categorical mediators in m or the list of names of the level 1 categorical mediators.
c1r
the reference groups of categorical mediators specified by c1.
c2
the column numbers of level 2 categorical mediators in m or the list of names of the level 2 categorical mediators.
c2r
the reference groups of categorical mediators specified by c2.
level
a vector that record the group number for each observation.
weight
the weight of cases in groups.
random
the random effect part for the full model. random = "(1|level)" by default.
random.m1
the random effect part for model explaining the mediators. All other random effects are random = "(1|level)" if not specified here.
intercept
True if fit an intercept to models, by default.
covariates
the covariates matrix to explain the outcome, y, and/or the mediators, m.
cy1
the column numbers of covariates that are level 1 and used to explain y.
cy2
the column numbers of covariates that are level 2 and used to explain y.
cm
the column numbers of covariates that are used to explain m. cm[[1]] gives the mediators (in l1, cl, l2, or c2) that can be partially explained by covariates. Each of the rest items of the cm list shows the column number(s) in covariates that should be used to explain each mediator listed in cm[[1]] and by that order.
joint
the list of group(s) of mediators whose joint mediation effect is of interests. joint[[1]] list the levels of mediators in each group and by the order of the list. Note that if any mediator in the group is of level 2, the level of the group should be 2.
org.data
if is TRUE, first organize the data set and do transformations using the function "data.org". In such case, need to specify the transformation function arguments.
f01y, f10y, f02ky, f20ky, f01km1, f01km2, f10km
the transformation functions as describe in the function "data.org". Need these arguments only when org.data=T.
Details
The multilevel mediation is based on the following linear multilevel additive models:
Note that in the models, mathbf{f}(cdot)=(f_1(cdot), f_2(cdot), cdots, f_l(cdot))^T is a set of l transformation functions on cdot, with the corresponding linear coefficients vector oldsymbol{β}=(β_1, β_2, cdots, β_l)^T. mathbf{f} and l are known for model fitting. l may be different with mathbf{f} of different sub- and super-scripts.
Value
A "mlma" mode list will be returned with the following items:
de1
level 1 direct effect from predictor.
de2
level 2 direct effect from predictor.
ie1
level 1 indirect effect from level 1 mediator.
ie12
level 2 indirect effect from level 1 mediator.
ie2
level 2 indirect effect from level 2 mediator.
f1
the overall multilevel model.
fm1
a list, where the first item identifies the level 1 mediators, and in that order, the following items give the prediction functions of the mediators.
fm2
a list, where the first item identifies the level 2 mediators, and in that order, the following items give the prediction functions of the mediators.
ie1_list
a list, where the first item identifies the level 1 mediators, and in that order, the following items give the column(s) of the indirect effects of the mediator in ie1.
ie2_list
a list, where the first item identifies the level 2 mediators, and in that order, the following items give the column(s) of the indirect effects of the mediator in ie2.
iej2_list
a list, where the first item identifies the level 2 joint mediators, and in that order, the following items give the column(s) of the indirect effects of the mediator in cbind(ie12,ie2).
ie12_1,ie12_2, ie1_1, ie1_2, ie2_1, ie2_2
the first and second part of the corresponding indirect effects.
x
the vector of the predictive variable.
x.j
the vector of the aggregated variable at the higher level by the order of unique(level[!is.na(level)]).
data1
The results from data.org.
Author(s)
Qingzhao Yu (qyu@lsuhsc.edu), Bin Li (bli@lsu.edu).