Using longtowide PreviousNext
Mplus Discussion > Growth Modeling of Longitudinal Data >
Message/Author
 QianLi Xue posted on Sunday, November 25, 2007 - 11: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 Monday, November 26, 2007 - 12:17 am
Example 9.16 use DATA WIDETOLONG.
 Renee McDonald posted on Thursday, June 16, 2011 - 9:05 pm
Hello,
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 - 11: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 Friday, June 17, 2011 - 2:52 am
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 - 12:10 pm
No, this function is not available in Mplus.
 Alain Girard posted on Monday, June 11, 2012 - 5:10 pm
Hi,
I have a problem using longtowide.

My syntax is:

data:
file = ..\..\..\Données\Test-2012-06-06.dat;
data longtowide:
long = fimp|gimp;
wide = fimp1-fimp2|gimp1-gimp2;
idvariable = nofamill;
repetition = bonpid;
variable:
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 :

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

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

Sorry

Thank
Alain Girard
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: