Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to transfer back data from Mplus to STATA?

    Hello Stata users,

    Please help .
    I converted data set from Stata to Mplus, then ran some latent class analysis using Mplus. Now I would like to transfer back 3 class solution from Mplus to Stata for other analysis. In detail, I wanted to add a variable to Stata indicating for each participant, which class they are in (so for 3 class solution, participants would have a value of 1,2 or 3). It would be based on 3 class solution output file from Mplus. Hope that is clear explanation, if not, please let me know and I will amend it.
    Thank you very much for any help.

    Regards

    Witold

  • #2
    Since Stata cannot read Mplus files directly, I think you are going to have to use the Mplus SAVEDATA command somehow to create a file containing your participant identifier and class assignment. You will then need to read this file into Stata and use the merge command to add each class assignment to the corresponding observation in your Stata dataset.

    I am not an Mplus user and cannot confirm that SAVEDATA is indeed capable of what I describe.

    It need to point out, in case you are not aware of it, that latent class analysis can be carried out in recent releases of Stata using their Structural Equation Modeling (SEM) package. For a start see the output of help sem - and if there is no help output, then your copy of Stata does not support SEM.

    Comment


    • #3
      Yes, you will need to use the savedata command from Mplus and then read the data back into Stata. You may also need to do a little data cleaning. You should also keep in mind that simply using most likely group is somewhat problematic. Basically, most likely group membership is based on estimated probabilities. In a 3 class model the estimated class probabilities for a subject could be .33, .33, and .34. The subject would then be assigned to class 3. Another subject could have probabilities of .01, .01, and .98. The most likely class for both subjects would be the same. In short, using most likely group fails to take into account the measurement error. The most recent versions of Mplus use a 3-step estimator. I've not used it and am not very familiar with the particular nuances. But I think it's something you should consider.

      Comment

      Working...
      X