R数据分析:纵向数据如何做中介,交叉滞后中介模型介绍
In practice, it is strongly recommended to establish mediation with longitudinal data
随机效应交叉滞后中介模型引出
multilevel model (MLM), which is proposed on the basis of the fact that longitudinal data are clustered in nature: The repeated measures are nested within individuals
传统交叉滞后中介模型
treatment, mediator and outcome variables should be measured at three separated and ordered time points.
Another 10 (14%) ignored or abused the longitudinal structure of their own data by focusing on only a single wave,averaging across waves, or treating later variables as predictors of earlier variables when testing for mediation.
The indirect effect is denoted by ab because it is often quantified by the product of two effects: the effect of X on M (a effect) and the effect of M on Y controlling for X
传统交叉滞后中介模型的做法实例
CLPM <- '
# 路径系数
x2 ~ x1
m2 ~ a*x1
m2 ~ m1
y2 ~ b*m1
x3 + m3~ x2
m3+y3 ~ m2
y3~c*x1
y2~y1
y3~y2
x1+m1+y1~z1
x1+m1+y1~z2
# 相关
x1 ~~ y1 # Covariance
x1 ~~ m1
m1 ~~ y1
# 方差
x1 ~~ x1
m1 ~~ m1# Variances
y1 ~~ y1
x2 ~~ x2
m2 ~~ m2# Residual variances
y2 ~~ y2
x3 ~~ x3
m3 ~~ m3
y3 ~~ y3
# 间接作用 (a*b)
ab := a*b
# 总效应
total := c + (a*b)
'
graph_sem(model = CLPM.fit)
lay <- get_layout("x1", "x2", "x3","m1","m2","m3","y1","y2",
"y3",rows = 3)
graph_sem(model = CLPM.fit,layout = lay)
随机效应交叉滞后中介模型
random effects will cause heteroscedasticity in the residuals. Failure to take into account this heteroscedasticity can bias the standard error estimates, leading to misleading statistical inferences.
小结
赞 (0)