Writing to savedata file PreviousNext
Mplus Discussion > Latent Variable Mixture Modeling >
Message/Author
 Jeanne Geiger Brown posted on Monday, June 04, 2007 - 3:02 pm
Hi,
I've finished an analysis and want to write the Cprob and Cluster variables to an output file including the subject ID number. I was able to get the CProb and Cluster variables in a .dat file but these were not linked to the subj ID. Can you correct my syntax to include the subject ID number (residno)- only applicable parts of syntax pasted below. Thanks.

VARIABLE:
NAMES ARE residno psy_del agit_agg refus_re call_out anxiety
depress withdr_l sleep_do delir_LO;
USEVARIABLES ARE psy_del - sleep_do ;
CATEGORICAL ARE psy_del-sleep_do ;
CLASSES = cluster(3);


SAVEDATA: FILE IS "threeclass.dat";
SAVE IS CPROB;
 Linda K. Muthen posted on Monday, June 04, 2007 - 3:54 pm
Use the IDVARIABLE option of the VARIABLE command to include an id variable in the saved data.
 Scott C. Roesch posted on Thursday, June 07, 2007 - 8:00 am
Hi there:

I am running an LPA using the code below. The MPlus output file states that it has processed and assigned 1198 cases to the classes. However, when I pull the .sav file into SPSS (the file created with the SAVEDATA command) only 874 have numeric values for class membership. The 324 other cases are assigned missing values. There appears to be a disconnect between what the MPlus output file is reporting and the file that the SAVEDATA command generated. Any help would be greatly appreciated.

TITLE: lpa-2 classes

DATA: FILE C:\SCOTT\Grants\LONGSCAN\LPA\MALTX_053107.dat;
FORMAT IS FREE;

VARIABLE: NAMES ARE CASEID
MSPA06 MSPA68 MSPA810 MSPA1012
MSSA06 MSSA68 MSSA810 MSSA1012
MSFP06 MSFP68 MSFP810 MSFP1012
MSLS06 MSLS68 MSLS810 MSLS1012
MSEM06 MSEM68 MSEM810 MSEM1012
PHYAtot SARAtot PSMAtot neglect;

USEVARIABLES ARE MSEM06 MSEM68 MSEM810 MSEM1012 PSMAtot;

MISSING ALL (-999);

IDVARIABLE IS CASEID;

CLASSES = C(2);

ANALYSIS: TYPE = MIXTURE MISSING;
STARTS = 50 5;

OUTPUT: TECH11;

SAVEDATA: FILE IS C:\SCOTT\Grants\LONGSCAN\LPA\2class_emotional.SAV;
SAVE IS CPROB;
 Linda K. Muthen posted on Thursday, June 07, 2007 - 8:17 am
This is an Mplus support question. Please send your input, data, output, saved data, and license number to support@statmodel.com.
 Feifei Li posted on Wednesday, September 17, 2008 - 2:24 pm
Hi,there

I have a question regarding Lo-Mendell-Rubin (LMR) test. When I save result by using "savedata" options, I can only get BIC, AIC, Entropy such regular goodness of fit statistics for mixture model in a compact form of data. How can I also include LMR in this small .dat file?

Thanks,
Mary
 Linda K. Muthen posted on Wednesday, September 17, 2008 - 3:28 pm
In Version 5.1 these values are saved.
 Michelle posted on Thursday, August 06, 2009 - 8:42 am
Hi - I am having a similar issue to Scott who posted 6-7-08. I am using MPlus for an LCGA-survival analysis and would like to import the cprob data into STATA for further analysis. Two problems seem to arise: 1) there is a disconnect between what the MPlus output reports as the class assignment and what shows up in the ASCI file. For instance, MPlus reports in the output file that there are approximately 900, 400, and 2100 people in each of three classes based on the most likely class assignment; however, when reading the data into STATA, I ask for a count of the various classes, and it reports a nearly even ~1100, ~1000, ~1300 split of the different classes. I can't figure out this discrepancy. Secondly, even though I have specified the ID Variable in the VARIABLE portion of the command, it still seems to be reporting it incorrectly in the data file. I have ~3600 cases in the dataset, and at case 1100, everyone from 1100 to 1199 gets 1100 as their ID variable; then the next 100 get 1200, and so on. I have been able to determine that the data are still in case id order (based on the other variables in the dataset) and so was able to just add an extra field that replicates the case id, but I am curious if there is a different solution to this.
 Linda K. Muthen posted on Thursday, August 06, 2009 - 11:05 am
Please send the files and your license number to support@statmodel.com.
 Christine Critchley posted on Wednesday, April 13, 2011 - 5:31 pm
Hello I am running a LCA with 3 clusters and nominal indicators, and want to save the cprob data. When I run the analysis the output says the data file has been saved, but the file is nowhere to be found. I have tried this for a number of cluster solutions and the same problem exists. I have done LCA before and the data has saved before. I am wondering if I am doing anything wrong. I am using:

SAVEDATA:
FILE IS "class3.dat";
SAVE=CPROB;

Thanks!
 Linda K. Muthen posted on Thursday, April 14, 2011 - 8:48 am
If the data are not saved, there should be a message in the output. Or perhaps you are trying to write to a directory where you don't have write privileges. If you cannot figure this out, send your input, data, and 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: