Using longtowide PreviousNext
Mplus Discussion > Growth Modeling of Longitudinal Data >
 QianLi Xue posted on Sunday, November 25, 2007 - 5:40 pm
Could you please provide examples for how to use longtowide and widetolong commands? I have trouble with the order by which "DATA, "VARIABLE: NAMES ARE", and "USE VARIABLES ARE" should be placed.
Thanks for your help!
 Linda K. Muthen posted on Sunday, November 25, 2007 - 6:17 pm
Example 9.16 use DATA WIDETOLONG.
 Renee McDonald posted on Thursday, June 16, 2011 - 3:05 pm
I would like to transpose a dataset to use in EFA. Is longtowide the correct option to simply transpose a dataset, i.e., make rows columns and columns rows?

Thanks for your help!
 Linda K. Muthen posted on Thursday, June 16, 2011 - 5:28 pm
DATA LONGTOWIDE is used in a growth modeling context where the long format has one variable and a time variable designating the time point. DATA LONGTOWIDE transforms the data into one variable for each time point. It does not sounds like this is what you want.
 Renee McDonald posted on Thursday, June 16, 2011 - 8:52 pm
Thanks. No, that is not what I want. Is there a way to simply transpose (rows to columns and columns to rows) the dataset in Mplus.
 Linda K. Muthen posted on Friday, June 17, 2011 - 6:10 am
No, this function is not available in Mplus.
 Alain Girard posted on Monday, June 11, 2012 - 11:10 am
I have a problem using longtowide.

My syntax is:

file = ..\..\..\Données\Test-2012-06-06.dat;
data longtowide:
long = fimp|gimp;
wide = fimp1-fimp2|gimp1-gimp2;
idvariable = nofamill;
repetition = bonpid;
names are nofamill bonpid fimp gimp;
missing are all (999);

The first line of my data are:
1001 0 5.00000 8.00000
1001 1 1.00000 4.00000
1003 0 .00000 .00000
1003 1 1.00000 2.00000

I have the following error :

While converting long-to-wide data, variation within an ID was detected for
a variable not listed as a WITHIN variable. Problem with ID 1001
for the following variable: FIMP

I realy don't understand the error because FIMP varying within id (nofamill) and i want to transform in wide format like GIMP.

Alain Girard
 Alain Girard posted on Monday, June 11, 2012 - 11:31 am
i answer to my own question. I don't use a usevariable: statement !...


Alain Girard
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message