Ex 9.16 question PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Wesley Anderson posted on Saturday, August 13, 2016 - 9:59 am
I want to do the kind of analysis that is in ex 9.16. However, my data is already in LONG form and already has ID and repetition variables. How can I let Mplus know about those variables without doing the WIDETOLONG transformation and having Mplus construct them as I do not need it to do so? When I simply choose cluster and within variables using the variables already in the data set, I get the error that there is variation within clusters. I suspect this is because it is not understanding that we've got repeated measures. So I suppose the problem is not with the ID variable but with picking out the repetition variable that I already have in the data set. Again, I do not need Mplus to construct this variable. I just need Mplus to recognize that there is a special (repetition) variable in the data set and that the data is already in LONG format. Alternatively, I would be happy to do the analysis at a single level with time as a covariate but the RANDOM analysis option seems to work better with TWOLEVELS than not. I do not know why. But perhaps that's a question for another day. I appreciate any help.
 Linda K. Muthen posted on Saturday, August 13, 2016 - 11:30 am
Use the MODEL command from Example 9.16. The NAMES statement for the long format data set used in Example 9.16 is:

NAMES ARE person y time a3 x1 x2;

Example 3.9 shows a single-level analysis with a random slope.
 Wesley Anderson posted on Saturday, August 13, 2016 - 12:00 pm
Thank you for your quick response. Unfortunately, I am getting the same error.

data:
file = merged-251-1.csv;

variable:
names = person X ZM OM DM F time;
usevariables = person X ZM OM F time;
within = ZM time;
between = F X;
cluster = person;

define:
time = time/50;

analysis: type = twolevel;

model:
%WITHIN%

OM ON ZM time;

%BETWEEN%

OM ON F X;


*** ERROR
One or more between-level variables have variation within a cluster for
one or more clusters. Check your data and format statement.

Between Cluster ID with variation in this variable
Variable (only one cluster ID will be listed)

X 10
F 10
 Linda K. Muthen posted on Saturday, August 13, 2016 - 3:03 pm
Please send the data set, output, and your license number to support@statmodel.com. VAriables on the BETWEEN list should have the same value for each cluster member.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: