楼主: Lisrelchen
3156 23

[Code]Multilevel Modeling using Mplus [推广有奖]

  • 0关注
  • 62粉丝

VIP

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50164 个
通用积分
81.5628
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

[size=0.8em]Level 1
    MATHij= β0j+ rij
Level 2
    β0j = γ00 + u0j

  1. title:
  2.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  3.   Page 64, Table 4.2
  4. data:
  5.   file = imm23.dat ;
  6. variable:
  7.   names = schid stuid ses meanses homework white parented public
  8.           ratio percmin math sex race sctype cstr scsize urban region;
  9.   cluster = schid;
  10.   usevar  = math;
  11.   within  = ;       ! level 1 variables here (none)
  12.   between = ;       ! level 2 variables here (none)

  13. analysis:       
  14.   type = twolevel random;
  15.   estimator = ml;
  16. model:
  17.   %within%
  18.     math;      ! no fixed effects

  19.   %between%
  20.     math;      ! no predictors of intercept
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Multilevel Modeling Mplus Using Level

本帖被以下文库推荐

沙发
Lisrelchen 发表于 2016-6-1 11:29:17 |只看作者 |坛友微信交流群
  1. Level 1
  2.     MATHij= β0j + β1(HOMEWORK) + rij
  3. Level 2
  4.     β0j = γ00 + u0j
  5.     β1  = γ10

  6. Here is the Mplus setup for estimating this model.

  7. title:
  8.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  9.   Page 65, Table 4.3
  10. data:
  11.   file = imm23.dat ;
  12. variable:
  13.   names = schid stuid ses meanses homework white parented public
  14.           ratio percmin math sex race sctype cstr scsize urban region;
  15.   cluster = schid;
  16.   usevar  = math homework;
  17.   within  = homework; ! level 1 variables here
  18.   between = ;         ! level 2 variables here (none)
  19. analysis:       
  20.   type = twolevel random;
  21.   estimator = ml;
  22. model:
  23.   %within%
  24.     math on homework; ! fixed effect
  25.   %between%
  26.     math ;            ! no predictors of intercept
复制代码

使用道具

藤椅
Lisrelchen 发表于 2016-6-1 11:30:34 |只看作者 |坛友微信交流群
  1. Level 1
  2.     MATHij= β0j + β1(HOMEWORK) + rij
  3. Level 2
  4.     β0j = γ00 + u0j
  5.     β1  = γ10 + u1j

  6. Here is the Mplus setup for estimating this model.

  7. title:
  8.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  9.   Page 67, Table 4.4
  10. data:
  11.   file = imm23.dat ;
  12. variable:
  13.   names = schid stuid ses meanses homework white parented public
  14.           ratio percmin math sex race sctype cstr scsize urban region;
  15.   cluster = schid;
  16.   usevar  = math homework;
  17.   within  = homework; ! level 1 variables here
  18.   between = ;         ! level 2 variables here (none)

  19. analysis:       
  20.   type = twolevel random;
  21.   estimator = ml;
  22. model:
  23.   %within%
  24.     math ;                  ! no fixed effects
  25.     b1 | math on homework;  ! random slope for homework

  26.   %between%
  27.     math;                   ! nothing predicts intercept
  28.     b1;                     ! nothing predicts slope

  29.     math with b1;           ! covariance between intercept and slope
复制代码

使用道具

板凳
Lisrelchen 发表于 2016-6-1 11:31:27 |只看作者 |坛友微信交流群
  1. This model is...

  2. Level 1
  3.     MATHij= β0j + β1(HOMEWORK)  + β2(PARENTED) + rij
  4. Level 2
  5.     β0j = γ00 + u0j
  6.     β1j  = γ10 + u1j
  7.     β2  = γ20

  8. Here is the Mplus setup for estimating this model.

  9. title:
  10.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  11.   Page 69, Table 4.5
  12. data:
  13.   file = imm23.dat ;
  14. variable:
  15.   names = schid stuid ses meanses homework white parented public
  16.           ratio percmin math sex race sctype cstr scsize urban region;
  17.   cluster = schid;
  18.   usevar  = math homework parented;
  19.   within  = homework parented; ! level 1 variables here
  20.   between = ;                  ! level 2 variables here
  21. analysis:       
  22.   type = twolevel random;
  23.   estimator = ml;
  24. model:

  25.   %within%
  26.     math on parented;       ! fixed effect
  27.     b1 | math on homework;  ! random effect

  28.   %between%
  29.     math;                   ! nothing predicts intercept
  30.     b1;                     ! nothing predicts slope

  31.     math with b1;           ! covariance intercept and slope
复制代码

使用道具

报纸
Lisrelchen 发表于 2016-6-1 11:32:36 |只看作者 |坛友微信交流群
  1. This model is...

  2. Level 1
  3.     MATHij= β0j + β1(HOMEWORK)  + rij
  4. Level 2
  5.     β0j = γ00 + γ01(SCSIZE) + u0j
  6.     β1j  = γ10 + u1j

  7. The Mplus setup is shown below

  8. title:
  9.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  10.   Page 74, Table 4.7
  11. data:
  12.   file = imm23.dat ;
  13. variable:
  14.   names = schid stuid ses meanses homework white parented public
  15.           ratio percmin math sex race sctype cstr scsize urban region;
  16.   cluster = schid;
  17.   usevar  = math homework scsize;
  18.   within  = homework;         ! level 1 variables here
  19.   between = scsize;           ! level 2 variables here
  20. analysis:       
  21.   type = twolevel random;
  22.   estimator = ml;
  23. model:
  24.   %within%
  25.     math;                     ! no fixed effects
  26.     b1 | math on homework;    ! random effect of homework
  27.   %between%
  28.     math on scsize;           ! scsize predicts intercept
  29.     b1;                       ! nothing predicts homework slope

  30.     math with b1;             ! covariance intercept and slope
复制代码

使用道具

地板
hyq2003 发表于 2016-6-1 11:33:49 |只看作者 |坛友微信交流群

使用道具

7
Lisrelchen 发表于 2016-6-1 11:33:51 |只看作者 |坛友微信交流群
  1. This model is...

  2. Level 1
  3.     MATHij= β0j + β1(HOMEWORK)  + rij
  4. Level 2
  5.     β0j = γ00 + γ01(PUBLIC) + u0j
  6.     β1j  = γ10 + u1j

  7. The Mplus setup is shown below

  8. title:
  9.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  10.   Page 75, Table 4.8
  11. data:
  12.   file = imm23.dat ;
  13. variable:
  14.   names = schid stuid ses meanses homework white parented public
  15.           ratio percmin math sex race sctype cstr scsize urban region;
  16.   cluster = schid;
  17.   usevar  = math homework public;
  18.   within  = homework;        ! level 1 variables here
  19.   between = public;          ! level 2 variables here
  20. analysis:       
  21.   type = twolevel random;
  22.   estimator = ml;
  23. model:
  24.   %within%
  25.     math;                    ! no fixed effects
  26.     b1 | math on homework;   ! random effect of homework

  27.   %between%
  28.     math on public;          ! public predicts intercept
  29.     b1;                      ! nothing predicts homework slope

  30.     math with b1;            ! covariance intercept and slope
复制代码

使用道具

8
Lisrelchen 发表于 2016-6-1 11:35:28 |只看作者 |坛友微信交流群
  1. This model is...

  2. Level 1
  3.     MATHij= β0j + β1(HOMEWORK)  + rij
  4. Level 2
  5.     β0j =  γ00 + γ01(PUBLIC) + u0j
  6.     β1j  = γ10 + γ11(PUBLIC) + u1j

  7. The Mplus setup is shown below
  8. title:
  9.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  10.   Page 77, Table 4.10
  11. data:
  12.   file = imm23.dat ;
  13. variable:
  14.   names = schid stuid ses meanses homework white parented public
  15.           ratio percmin math sex race sctype cstr scsize urban region;
  16.   cluster = schid;
  17.   usevar  = math homework public;
  18.   within  = homework;    ! level 1 variables here
  19.   between = public;      ! level 2 variables here
  20. analysis:       
  21.   type = twolevel random;
  22.   estimator = ml;
  23. model:
  24.   %within%
  25.     math;                   ! no fixed effects
  26.     b1 | math on homework;  ! random slope for homework
  27.   %between%
  28.     math on public;         ! intercept predicted by public
  29.     b1 on public;           ! slope predicted by public

  30.     math with b1;           ! covariance of intercept and slope
复制代码

使用道具

9
Lisrelchen 发表于 2016-6-1 11:38:10 |只看作者 |坛友微信交流群
  1. Table 4.12 on page 82.

  2. Input: ch4_p82.inp
  3. Output: ch4_p82.out
  4. This model is...

  5. Level 1
  6.     MATHij= β0j + β1(HOMEWORK) + β2(WHITE)  + rij
  7. Level 2
  8.     β0j =  γ00 + γ01(PUBLIC) + u0j
  9.     β1j  = γ10 + u1j
  10.     β2  = γ20

  11. The Mplus setup is shown below

  12. title:
  13.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  14.   Page 82, Table 4.12
  15. data:
  16.   file = imm23.dat ;
  17. variable:
  18.   names = schid stuid ses meanses homework white parented public
  19.           ratio percmin math sex race sctype cstr scsize urban region;
  20.   cluster = schid;
  21.   usevar  = math homework white public ;
  22.   within  = homework white; ! level 1 variables here
  23.   between = public;         ! level 2 variables here
  24. analysis:       
  25.   type = twolevel random;
  26.   estimator = ml;
  27. model:
  28.   %within%
  29.     math on white;          ! fixed effect of white
  30.     b1 | math on homework;  ! random effect of homework

  31.   %between%
  32.     math on public;         ! public predicts intercept
  33.     b1;                     ! nothing predicts homework slope

  34.     math with b1;           ! covariance intercept and slope
复制代码

使用道具

10
Lisrelchen 发表于 2016-6-1 11:38:54 |只看作者 |坛友微信交流群
  1. Table 4.13 on page 83.

  2. Variable WHITE is now made a random effect.

  3. Input: ch4_p83.inp
  4. Output: ch4_p83.out
  5. This model is...

  6. Level 1
  7.     MATHij= β0j + β1(HOMEWORK) + β2(WHITE)  + rij
  8. Level 2
  9.     β0j  =  γ00 + γ01(PUBLIC) + u0j
  10.     β1j  = γ10 + u1j
  11.     β2j  = γ20 + u2j

  12. The Mplus setup is shown below

  13. title:
  14.   Introducing Multilevel Modeling by Kreft and de Leeuw.
  15.   Page 83, Table 4.13
  16. data:
  17.   file = imm23.dat ;
  18. variable:
  19.   names = schid stuid ses meanses homework white parented public
  20.           ratio percmin math sex race sctype cstr scsize urban region;
  21.   cluster = schid;
  22.   usevar  = math homework white public;
  23.   within  = homework white;   ! level 1 variables here
  24.   between = public;           ! level 2 variables here
  25. analysis:       
  26.   type = twolevel random;
  27.   estimator = ml;
  28. model:
  29.   %within%
  30.     math;                    ! no fixed effects
  31.     b1 | math on homework;   ! random effect homework predicting math
  32.     b2 | math on white;      ! random effect white    predicting math

  33.   %between%
  34.     math on public;          ! public predicts intercept
  35.     b1;                      ! nothing predicts b1 (homework slope)
  36.     b2;                      ! nothing predicts b2 (white slope)

  37.     math with b1;            ! covariance intercept and b1
  38.     math with b2;            ! covariance intercept and b2
  39.     b1 with b2;              ! covariance b1 and b2
  40. and some of the output is shown below.
复制代码

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-11-5 08:00