Message/Author 

Student 09 posted on Thursday, April 30, 2009  8:54 am



Hi I wonder whether there is any possibility to save variables which are not part of the model with the savedata command. I need to save both fscores and an Identifiervariable, which is not part of the model, and obviously cannot be saved together with the information on the fscores? thanks 


See the FSCORES option of the SAVEDATA command and the IDVARIABLE option of the VARIABLE command. You can save other variables using the AUXILIARY option of the VARIABLE command. 


would the SAVE FSCORES option save factor scores that are free from measurement error if you are specifying a latent variable with 5 predictors? 


Also, I am confused about how I am receiving a factor score for those participants who have no data. Thanks! 


The default in Mplus is to estimate the model using all available information and missing data estimation. Therefore, all observations receive a factor score. For listwise deletion, add LISTWISE=ON; to the DATA command. Factor scores are not the same as the factors in a model. How close they are to each other can be seen in the factor determinacy score. See the FSDETERMINACY option of the OUTPUT command. 


Thank you! One follow up question. If I have 5 measures and am creating a latent variable and then using that latent variable in subsequent analyses with other latent variables would the model use the same factor scores as I would receive in the fscores output? Is that what you meant by the factor scores are not the same as the factors in the model? For example, if I created a mean composite of the 5 measures would that differ the fscores output? 


To clarify further: I am doing a 4 latent variable cross lagged analysis in mplus but first doing CFA analyses on each of the 4 variables. Would the fscores data be the same as what is being used in this 4 latent variable cross lagged analysis? I would like to extract the same data without measurement error. Is that possible? Thank you again! 


I do not understand your question. However, I would only use factor scores if it was unavoidable. 


Sorry if that was unclear. I am doing a basic 1Factor CFA using 5 measures. When using the SAVE Fscores option, I am wondering whether the factor scores that are saved are free from measurement error. Thank you! 


Factor scores can be seen as free of measurement error, but are not free of estimation error. Estimated factor scores do not behave as true factors (give different variances and relations to other variables) unless you have many good indicators. See for instance Skrondal, A. and Laake, P. (2001). Regression among factor scores. Psychometrika 66, 563575. 


When factor scores are saved, are they placed in the rightmost columns in the DAT file? (This will affect the VARIABLE NAMES line in the program where I call in the saved data file.) 

Jon Heron posted on Wednesday, February 15, 2012  8:47 am



Hi Lisa, it should tell you at the end of your .out file, e.g. here it's the last 8 vars SAVEDATA INFORMATION Order and format of variables TOT_T1 F10.3 TOT_T2 F10.3 TOT_T3 F10.3 TOT_T4 F10.3 TOT_T5 F10.3 AGE_T1 F10.3 AGE_T2 F10.3 AGE_T3 F10.3 AGE_T4 F10.3 AGE_T5 F10.3 INTCPT1 F10.3 INTCPT1_SE F10.3 SLOPE1 F10.3 SLOPE1_SE F10.3 INTCPT2 F10.3 INTCPT2_SE F10.3 SLOPE2 F10.3 SLOPE2_SE F10.3 


Thanks, Jonthis is very helpful! I see in the Mplus manual how to merge files using an ID variablebut it is problematic that the saved factor score file does not have an ID in it. How then do I merge these saved factor scores back into my main data set? Thank you so much. 

Jon Heron posted on Wednesday, February 15, 2012  9:18 am



You can push the ID through to the final file within your variable section using idvariable = ID; the data I use had more than one ID and this isn't permitted with this command. If you're like me then you'll need to push other variables through using "auxiliary" so I do idvariable = ID1; auxiliary = ID2; Don't put them in your usevariable list though  the ID variable rarely fits the model well!! 


ExactlyI didn't want to put ID in the USEVARIABLE list because it would mess up the fit of my factor models! Thanks so much, Jon, for your expertise on this. 


Hi, I've just spent hours trying to save my factor scores through the MFILE command of the SAVEDATA function. I can save the factor scores no problem but I can't seem to get the factor scores to be merged back into the original dataset. Even trying to take them into SPSS was a problem with the factor scores being saved over three columns/variables. With MFILE, should I be nominating the original dataset that I want to merge the factor scores into? Regards, Joanne 


You should be using the SAVE option if you want the factor scores in the original data set: SAVE = FSCORES; 


Hi Linda, can you tell me what is wrong in my Mplus script below, such that I get the error message at the bottom of this section of text? I was relying on p. 404 of the current Mplus manual as an example. This script begins at the ANALYSIS line of my program, to save space. ANALYSIS: TYPE = BASIC; SAVEDATA: MFILE = FACTORSCORES.DAT; MNAMES ARE H4MH3R H4MH4R H4MH5R H4MH6R H4PE37R H4PE38R H4PE39R H4PE40R H4PE41R AID GENERAL CONCRETE; MFORMAT IS 9F10.3 I9 2F10.3; MSELECT ARE GENERAL CONCRETE; MMISSING = H4MH3R H4MH4R H4MH5R H4MH6R H4PE37R H4PE38R H4PE39R H4PE40R H4PE41R AID GENERAL CONCRETE (. *); FILE IS MERGED.sav; FORMAT IS FREE; MISSFLAG = .; *** ERROR in SAVEDATA command Unknown option: MFILE 


Please send the output and your license number to support@statmodel.com. 


Hi Linda, I took the advice of you and Jon Heron above, and saved the factor scores using the SAVE=FSCORES command, and selected other variables that I wanted in the saved data set using the AUXILIARY option. But when I work with the newly created data set, factorscores_022312.dat, I get the message. Why would this be? *** ERROR The number of observations is 0. Check your data and format statement. Data file: D:\AH\locker\factorscores_022312.dat *** ERROR Nonmissing blank found in data file at record #1, field #: 18 


Open the data file and look at record 1 filed 18. 


Hi Linda, can I change the default missing data flag when saving FSCORES from * to another value such as 999 or 999? I got an error message when I tried to change the default missing data flag in this script. SAVEDATA: FILE IS FACTORSCORES_022812.DAT; SAVE = FSCORES; MISSFLAG = 999; 


Please send the output and your license number to support@statmodel.com. 


Hi Linda, thanks for all of your help. What does it mean that Mplus saved two versions of my latent variables in the DAT file with the fscores: GENERAL F10.3 GENERAL_SE F10.3 CONCRETE F10.3 CONCRETE_SE F10.3 Does the "_SE" refer to a standard error? 


Yes. 


Hi Linda, I noticed that when I use SAVE FSCORES for a categorical factor analysis, SEs for the saved factor scores are missing from the list of variables in the DAT file that is created. Is that true: There are no saved SEs for fscores from a categorical CFA? Thanks. 


Mplus 6.12 does not have that, but if you use ML you can get that information via the information curve that you get in the PLOT command. One divided by the square root of the information value is the SE for the factor score at that factor value. 

Back to top 