Using define with widetolong PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Alain Girard posted on Tuesday, June 12, 2012 - 11:57 am
Hi,
I have a file in wide format (twins data) and i want to analysis in long format.

I use:
data widetolong:
wide = x1 x2 | y1 y2 | z1 z2;
long = x | y | z;
idvariable = fam;
repetition = pid;

variable:
names = x1 x2 y1 y2 z1 z2 fam;
usevariable = x y z;

I want to compute the interaction k=x*z.

I try

define:
k1=x1*z1;
k2=x2*z2;

And i recive the error message that k1 and k2 don't exist.

I add k1 and k2 in the wide statement and k in the wide statement. I recive the same error message.

I add k1, k2 and k in the usevariable statement. The model was estimated but it also compute means and variance for k1 and k2.

I realy confuse... the analysis was in the long format but k1 and k2 was in wide format.

I probably doing something wrong

How can i compute the interaction ?

Thanks
Alain Girard
 Linda K. Muthen posted on Tuesday, June 12, 2012 - 7:07 pm
Try the following:

data widetolong:
wide = x1 x2 | y1 y2 | z1 z2 | k1 k2;
long = x | y | z | k;
idvariable = fam;
repetition = pid;

variable:
names = x1 x2 y1 y2 z1 z2 fam;
usevariable = k1 k2 x y z k;
Auxiliary = k1 k2;

define:
k1=x1*z1;
k2=x2*z2;
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: