As the effort to understand the multilevel mixture modeling capacity of Mplus, I have decided to use the Mplus sample data set, "ex10.1.dat", to try alternative model specifications in both Mplus, Stata and R. I am going to post a series of code and results.
As the first step, I try this really simple Mplus code:
-----------------------------------------------------------
DATA: FILE IS ex10.1.dat;
VARIABLE: NAMES ARE y x1 x2 w class clus;
USEVARIABLES = y x1 x2;
WITHIN = x1 x2;
CLUSTER = clus;
ANALYSIS: TYPE = TWOLEVEL;
STARTS = 0;
MODEL:
%WITHIN%
y ON x1 x2;
%BETWEEN%
y ON ;
-----------------------------------------------------------
which gives exactly the same results as the following Stata code:
-----------------------------------------------------------
xtreg y x1 x2, i(clus) mle
-----------------------------------------------------------
No comments:
Post a Comment