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).


雷达卡


京公网安备 11010802022788号







