楼主: Shazam
2220 0

Random Coefficien​t Model using SPSS? [推广有奖]

  • 0关注
  • 2粉丝

已卖:147份资源

硕士生

40%

还不是VIP/贵宾

-

TA的文库  其他...

C++

Culture(文化学)

C#(Newoccidental)

威望
0
论坛币
1847 个
通用积分
2.0750
学术水平
6 点
热心指数
6 点
信用等级
5 点
经验
1118 点
帖子
144
精华
0
在线时间
4 小时
注册时间
2006-5-10
最后登录
2016-12-4

楼主
Shazam 发表于 2014-5-3 05:25:07 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
I thought some might find it interesting to see a random coefficient model employed using the MIXED procedure. Specifically, I generate data from a linear mixed model with a random intercept and slope which are a function of fixed intercept, fixed slope, and error terms. The random slope term suggests that the linear effect of "time" varies across subjects. Moreover, a positive correlation between the random intercept and slope terms suggests that higher subject-specific (t0) intercepts (means) tend to have a greater rate of change than lower subject-specific (t0) intercepts (means). Of note, I have provided standard linear mixed model notation in the code, so we do not lose sight of how the model is built from the ground up. The next question might be to try to explain the correlation between the random intercept and slope by incorporating a 2nd-level predictor (a true multilevel model).
Although I employ the MIXED procedure to fit this model, it is entirely possible to fit the same model using AMOS.

Best,

Ryan

--

/*Generate Data*/.
/*seed for random  generator*/.
set seed 987879546.

new file.
input program.
compute subject_ID = -99.
compute Gamma00 = -99.
compute Gamma10 = -99.
compute V11 = -.99.
compute V22 = -99.
compute rho = -99.
compute V21 = -99.
compute a11 = -99.
compute a21 = -99.
compute a22 = -99.
compute x0j = -99.
compute x1j = -99.
compute u0j = -99.
compute u1j = -99.
compute B0J = -99.
compute B1J = -99.
compute eij = -99.
compute time = -99.
leave subject_ID to time.

    /*1000 subjects*/.
    loop subject_ID = 1 to 10000.
    /*fixed intercept*/.
    compute Gamma00 = 0.50.
    /*fixed slope*/.
    compute Gamma10 = 0.30.
    /*random intercept var*/.
     compute V11 = 0.80.
    /*random slope var*/.
    compute V22 = 0.50.
    /*random intercept and slope corr*/.
    compute rho = 0.35.
    /*random intercept and slope cov*/.
    compute V21 = rho*sqrt(V11*V22).
  
    compute a11 = sqrt(V11).
    compute a21 = V21/a11.
    compute a22 = sqrt(V22 - a21*a21).
    /*norm. dist r.v.*/.
    compute x0j = rv.normal(0,1).
    /*norm. dist r.v.*/.
    compute x1j = rv.normal(0,1).
     /*random intercept error term*/.
    compute u0j = a11*x0j.
    /*random slope error term*/.
    compute u1j = a21*x0j + a22*x1j.
    /*random intercept term*/.
    compute B0J = Gamma00 + u0j.
    /*random slope term*/.
     compute B1J = Gamma10 + u1j.
    /*5 time points*/.
    loop time = 0 to 4.
    /*error term*/.
    compute eij = rv.normal(0,1).
    /*full equation*/.
    compute y = B0J + B1J*time + eij.
    end case.
    end loop.
  end loop.
end file.
end input program.
execute.

MIXED y WITH time
  /FIXED=time | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION G
  /RANDOM=INTERCEPT time | SUBJECT(subject_ID) COVTYPE(UNR).

二维码

扫码加我 拉你入群

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

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

关键词:random model Using mode rand procedure function positive subjects generate

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 19:50