Savedata with LCA PreviousNext
Mplus Discussion > Latent Variable Mixture Modeling >
Message/Author
 Katharina Schmid posted on Thursday, December 01, 2005 - 3:49 am
Hi
I am in the process of carrying out LCA and the model appears to be running ok. However, I am having difficulty saving the conditional probabilities- I get an error message in the output. Would appreciate any advice on this.
Input and warning as follows:

INPUT INSTRUCTIONS

Title: LCA for experience (5classes)
Data: FILE IS modeldata.dat;
FORMAT IS 124F7.0 11F7.2 20F7.0 1F7.2;

Variable: NAMES ARE id a1-a28 b1-b127;
USEVARIABLES ARE a1-a28;
CLASSES = c(5);
CATEGORICAL ARE a1-a28;

Analysis: TYPE = MIXTURE;
STARTS = 500 10;
STITERATIONS = 20;

Output: TECH8 TECH10 TECH11;

Savedata: File is exp5.sav;
Save = CPROB;



*** WARNING in Savedata command
(Err#: 9)
Error opening data save file:
exp5.sav
Data will not be saved.
1 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS
 Anonymous posted on Thursday, December 01, 2005 - 5:29 am
I donīt know if there is another mistake, but you didnīt specify a file path in the savedata command (like "C:\exp.5.sav";).
 Anonymous posted on Thursday, December 01, 2005 - 5:35 am
Sorry for the overhasty comment, according to the userīs guide, a file path doesnīt seems to be necessary in the savedata command.
 Marco Grados posted on Thursday, December 01, 2005 - 9:57 am
I have used this with success in MPLUS 3.0

SAVEDATA: FILE IS result.dat; FORMAT IS FREE; SAVE = CPROBABILITIES;
 Linda K. Muthen posted on Thursday, December 01, 2005 - 12:58 pm
You would get this message if the file is open or if the directory cannot be written to.
 Hee-Jin Jun posted on Tuesday, February 06, 2007 - 8:03 pm
I used savedata command and got the data.
but when I opened the data,
there were '*' for missing (originally it was -999) and '**********' for id (originally id was 6 digit)
How can I get the real numbers instead of ***.

My command was
SAVEDATA:
FILE IS BMI10C1_2.sav;
format is delimited;
SAVE = CPROB;

I used 'format is free' as well. It gave me the same result.

Thanks a lot for your help.
 Linda K. Muthen posted on Wednesday, February 07, 2007 - 7:51 am
It seems that your id variable is too long. The asterisks indicate that it will not fit in the space provided. The default for missing is the asterisk. If you cannot figure this out, please send your input, data, output, and license number to support@statmodel.com.
 Hee-Jin Jun posted on Friday, February 09, 2007 - 4:46 pm
Thanks Linda,

If my id number does not fit in the space provided, how many digits Mplus allows and is there any way that I can increase the digit?

Thank you for your help.
 Linda K. Muthen posted on Friday, February 09, 2007 - 5:18 pm
You will need to shorten your id variable to no more than 7 digits.
 Phil Wood posted on Friday, June 15, 2007 - 11:53 am
Here's a somewhat related question:
I have an ID variable which contains alpha information (e.g., 198292A).
Is there any way to save this alpha information in the savedata statement?
I tried using
IDVARIABLE to read the information in, (i.e., idvariable is dadid;)
but when I save the data, the output doesn't contain the alpha variable.
Thanks for any insights!
(Alternatively, I guess a workaround is to case-merge the files afterward, but I'm, as always, lazy).
thanks!
Phil
 Linda K. Muthen posted on Friday, June 15, 2007 - 3:12 pm
For Mplus, all data must be numeric. There is no way around this. You could do a global change of A to 9 for example.

I'm surprised you don't get an error message. I added an A to a variable in a data set and I did.
 MAH posted on Wednesday, August 06, 2008 - 10:04 am
My ID variable is 7 digits long, ranging from 0001502 to 2601602. Right now, when I save the data, 0001502 becomes 1502. I need to retain the leading zeros on the smaller numbers when I use the savedata command. How can I do this?
 Linda K. Muthen posted on Wednesday, August 06, 2008 - 10:22 am
Are you identifying the ID variable using the IDVARIABLE option of the VARIABLE command? Also, you can use a FORMAT statement in SAVEDATA. See the user's guide.
 Linda K. Muthen posted on Wednesday, August 06, 2008 - 10:57 am
I was just informed that leading zeroes are not saved. I don't know of how you would do that or why it would matter. Can you explain?
 Kätlin Peets posted on Tuesday, July 28, 2009 - 7:16 am
Hello,

I have a question. I am conducting a LCA (mixture missing). When I save my data (class membership and other data), can I somehow override the default option for missing values (i.e., asterisks) and use a numerical value instead? I have a problem opening the dat. file in spss with asterisks.
 Linda K. Muthen posted on Tuesday, July 28, 2009 - 8:37 am
There is not an option in the SAVEDATA command to change the missing data flag. If you want to do this, I suggest opening the file in the Mplus or some other editor and doing a global replace of the asterisk with another missing value flag.
 Gareth posted on Wednesday, September 23, 2009 - 7:28 am
Could an option to change the default asterisk (e.g. to 9999) be included in a future update? It is difficult to get SPSS and Excel to recognize the asterisk.
 Linda K. Muthen posted on Wednesday, September 23, 2009 - 7:40 am
You can do a global change of asterisk to either a number of symbol that is recognized by SPSS and Excel, for example, 9999.
 luke fryer posted on Monday, November 22, 2010 - 6:22 am
Dr. Linda Muthen,


Mplus (6.1) can now save variables 16 in length... But we are still restricted to numbers only right? There is no possible way around this...?

Just checking,

luke
 Linda K. Muthen posted on Monday, November 22, 2010 - 8:02 am
Yes, ASCII files must be numeric if this is what you mean.
 sunyforever posted on Friday, November 01, 2013 - 8:15 am
Dear Linda or Bengt,

I have difficulty saving the latent class membership after fitting a LCA model.

In the model I controlled the effects of complex survey. My commands were:

VARIABLE:
weight = wt;
STRATIFICATION = strata;
CLUSTER = psu;
IDVARIABLE = id;

SAVEDATA:
FILE IS newdata.dat ;
SAVE = CPROB ;

However, when I checked the exported data file, I found two problems: 1) the id variable is composed of 7-digit numbers, and should look like 1311110, 6522222, and so forth. But in many cases these values were truncated and looked like 131, 652, ..

2) When I read the data file in Stata, I found all the variables were not aligned with the respective columns. For instance, case#1 of the id variable lies rightly in the first column, but case#2 of id falls in the second column, and #3 in the third column..

I tried to save the model without controlling complex survey effects. It turned out a success. But I do wish to save the data with the survey effects. Could you help to figure out where the problem is?

Thanks
 Linda K. Muthen posted on Friday, November 01, 2013 - 8:43 am
Please send the files and your license number to support@statmodel.com.
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: