Output factor scores with ID variable? PreviousNext
Mplus Discussion > Confirmatory Factor Analysis >
Message/Author
 Wouter Steenbeek posted on Tuesday, September 15, 2009 - 12:50 am
Is it possible to output an ID variable with the outputted factor scores? Then I can make absolutely sure that the Nth factor score also belongs to the Nth case in my original data.

This is especially important a hierarchical dataset. If I'm not mistaken, the saved factor scores are scrambled - case nr 1 in this new file is NOT the same as case nr1 in my original data file. I *think* Mplus reorders the dataset so that the largest level-2 units come first? But I'm not 100% sure, so I'm hesitant to use the factor scores now.
 Linda K. Muthen posted on Tuesday, September 15, 2009 - 6:15 am
Use the IDVARIABLE option of the VARIABLE command.
 Wouter Steenbeek posted on Tuesday, September 15, 2009 - 4:51 pm
Thank you!

FYI: The dataset I was trying out with, the example dataset ex9.6.dat, has no level-1/unique-case identifier, so therefore I didn't get it to work.

From what I see now, the IDVARIABLE option of the VARIABLE command isn't even necessary. After making afjusted the .dat file with a case nr identifier called "respnr", I think it doesn't matter if include that IDVARIABLE option or not; both methods also output the "clus" and the "respnr" variable in the factor scores output file.
 Richard E. Zinbarg posted on Thursday, November 02, 2017 - 8:57 pm
I am having trouble getting Mplus to save an id variable along with my factor scores. According to the output file, the idvariable is being saved in the last column of the file containing my factor scores but what is saved in that column is not my idvariable. Is there a way to get Mplus to save the cases in the file containing the factor scores in the same order as in my raw data set? Then, it wouldn't matter if I can save the idvariable.

Also, I don't understand what it saves before the factor scores - the output file names these variables as if they are my observed variables but what is saved doesn't appear to correspond to my raw data. Is it the residuals that are being saved?
 Linda K. Muthen posted on Friday, November 03, 2017 - 1:31 pm
Please send the output, data set, saved data set, and your license number to support@statmodel.com.
 Wendy S Wei posted on Monday, July 30, 2018 - 11:57 am
I am also having a similar issue as Richard. My idvariable is also being saved as a column along with my factor scores, but it does not take on the form of my original idvariable (includes both numbers, letters, special characters). How can I save my original ID variables along with their factor scores?

Thanks!
 Bengt O. Muthen posted on Monday, July 30, 2018 - 1:48 pm
There is no option to do that.
 Yue Yin posted on Tuesday, December 18, 2018 - 11:44 am
Hi,

If I want to generate the ID variable using monte carlo, how should I do it ? I tried the idvariable in the montecarlo command, but this command is not recognized.

Thank you!
 Tihomir Asparouhov posted on Tuesday, December 18, 2018 - 3:10 pm
It is not implemented. You can add a column of ID variables in excel if it is just for a single data set. If it is for multiple data sets you can trick Mplus using two-level modeling. Generate data with clusters of size 1 and empty between level model with all variables declared as within only. This will give you the cluster ID which you can use as an observation ID.
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: