没有合适的资源?快使用搜索试试~ 我知道了~
Mplus跨层分析参考 源程序模型 示例:多级混合模型可包括回归分析、路径分析、确认因子分析(CFA)、项目响应理论(IRT)分析、结构方程建模(SEM)、潜伏类分析(LCA)、潜伏类生长分析(LTA)、生长混合物建模(GMM)、离散时间生存分析、连续时间生存分析和这些模型的组合。
资源推荐
资源详情
资源评论
Updated 08/13/11 1
Mplus syntax files for single- and multilevel mediation models, to accompany:
Preacher, K. J., Zyphur, M. J., & Zhang, Z. (2010). A general multilevel SEM framework for
assessing multilevel mediation. Psychological Methods, 15, 209-233.
Preacher, K. J., Zhang, Z., & Zyphur, M. J. (2011). Alternative methods for assessing mediation
in multilevel data: The advantages of multilevel SEM. Structural Equation Modeling, 18, 161-
182.
Note: In models in which the Between and Within components of a 1→1 path are estimated
separately and the Within component is random, the Between component is estimated as the
contextual effect rather than as the Between slope in Mplus (see Mplus User's Guide, Ex.9.2). In
Examples F and J this has been addressed by adding the Within slope to the contextual effect to
yield the correct Between slope component before computing the indirect effect.
A. simple mediation
TITLE: simple mediation
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
x m y;
USEVARIABLES ARE
x m y;
ANALYSIS: BOOTSTRAP IS 5000; ! bootstrap is recommended for simple mediation
MODEL: ! model specification follows
m ON x; ! regress mediator on independent variable
y ON x m; ! regress outcome on both mediator and independent variable
MODEL INDIRECT: ! request significance test for indirect effect of x on y via m
y IND m x; ! indirect effect of interest (ending in y and starting with x)
OUTPUT: CINTERVAL(BCBOOTSTRAP); ! request bias-corrected bootstrap
! confidence intervals
B. 2-2-1 model with latent variables (MSEM)
TITLE: 2-2-1 mediation (similar code used in example 2)
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
group x1 x2 x3 m1 m2 m3 m4 m5 y1 y2 y3 y4 y5;
MISSING ARE *; ! missing data denoted "*" in mydata.dat
USEVARIABLES ARE
group x1 x2 x3 m1 m2 m3 m4 m5 y1 y2 y3 y4 y5;
BETWEEN ARE x1 x2 x3 m1 m2 m3 m4 m5; ! identify variables with only Between variance;
! variables that are not claimed as "BETWEEN ARE" or "WITHIN ARE" can have
! both Within and Between variance
CLUSTER IS group; ! Level-2 grouping identifier
ANALYSIS: TYPE IS TWOLEVEL RANDOM; ! tell Mplus to perform multilevel modeling
Updated 08/13/11 2
MODEL: ! model specification follows
%WITHIN% ! Model for Within effects follows
yw BY y1 y2 y3 y4 y5; ! yw is a factor defined by y1, y2, y3, y4, and y5
%BETWEEN% ! Model for Between effects follows
mb BY m1 m2 m3 m4 m5; ! mb is a factor defined by m1, m2, m3, m4, and m5
xb BY x1 x2 x3; ! xb is a factor defined by x1, x2, and x3
yb BY y1 y2 y3 y4 y5; ! yb is a factor defined by y1, y2, y3, y4, and y5
mb ON xb(a); ! regress mb on xb, call the slope "a"
yb ON mb(b); ! regress yb on mb, call the slope "b"
yb ON xb; ! regress yb on xb, too
MODEL CONSTRAINT: ! section for computing indirect effect
NEW(ab); ! name the indirect effect
ab = a*b; ! compute the indirect effect
OUTPUT: TECH1 TECH8 CINTERVAL; ! request parameter specifications, starting values,
! optimization history, and confidence intervals for all effects
C. 2-1-1 model (traditional MLM)
TITLE: 2-1-1 mediation (traditional MLM)
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
group x m y;
USEVARIABLES ARE
group x m y;
BETWEEN IS x; ! identify variables with only Between variance;
! variables that are not claimed as "BETWEEN IS" or "WITHIN IS" can have
! both Within and Between variance
CLUSTER IS group; ! Level-2 grouping identifier
ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL: ! model specification follows
%WITHIN% ! Model for Within effects follows
m y; ! estimate Level-1 (residual) variances for m and y
y ON m(b); ! regress y on m, call the slope "b"
%BETWEEN% ! Model for Between effects follows
x m y; ! estimate Level-2 (residual) variances for x, m, and y
m ON x(a); ! regress m on x, call the slope "a"
y ON m(b); ! regress y on m, constrain the slope equal to "b"
y ON x; ! regress y on x
MODEL CONSTRAINT: ! section for computing indirect effect
NEW(indb); ! name the indirect effect
indb=a*b; ! compute the Between indirect effect
OUTPUT: TECH1 TECH8 CINTERVAL; ! request parameter specifications, starting values,
! optimization history, and confidence intervals for all effects
Updated 08/13/11 3
D. 2-1-1 model (unconflated MLM)
TITLE: 2-1-1 mediation (unconflated MLM)
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
group x m y mmean;
USEVARIABLES ARE
group x m y mmean;
BETWEEN ARE x mmean; ! identify variables with only Between variance;
! variables that are not claimed as "BETWEEN ARE" or "WITHIN ARE" can have
! both Within and Between variance
WITHIN ARE m; ! identify variables with only Within variance
CENTERING IS GROUPMEAN(m); ! group-mean center m
CLUSTER IS group; ! Level-2 grouping identifier
ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL: ! model specification follows
%WITHIN% ! Model for Within effects follows
m y; ! estimate Level-1 (residual) variances for m and y
y ON m; ! regress y on m
[m@0]; ! m was group-mean centered, so fix its mean to zero
%BETWEEN% ! Model for Between effects follows
y mmean; ! estimate Level-2 (residual) variances for y and mmean
mmean ON x(a); ! regress mmean on x, call the slope "a"
y ON mmean(b); ! regress y on mmean, call the slope "b"
y ON x; ! regress y on x
MODEL CONSTRAINT: ! section for computing indirect effect
NEW(indb); ! name the indirect effect
indb=a*b; ! compute the Between indirect effect
OUTPUT: TECH1 TECH8 CINTERVAL; ! request parameter specifications, starting values,
! optimization history, and confidence intervals for all effects
E. 2-1-1 model (MSEM)
TITLE: 2-1-1 mediation (MSEM)
DATA: FILE IS mydata.dat; ! text file containing raw data in long format
VARIABLE: NAMES ARE
group x m y;
USEVARIABLES ARE
group x m y;
BETWEEN IS x; ! identify variables with only Between variance;
! variables that are not claimed as "BETWEEN IS" or "WITHIN IS" can have
! both Within and Between variance
CLUSTER IS group; ! Level-2 grouping identifier
ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL: ! model specification follows
%WITHIN% ! Model for Within effects follows
剩余10页未读,继续阅读
资源评论
jlzhangyi
- 粉丝: 6
- 资源: 55
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功