michaelhallquist / MplusAutomation

The MplusAutomation package leverages the flexibility of the R language to automate latent variable model estimation and interpretation using Mplus, a powerful latent variable modeling program developed by Muthen and Muthen (www.statmodel.com). Specifically, MplusAutomation provides routines for creating related groups of models, running batches of models, and extracting and tabulating model parameters and fit statistics.
84 stars 46 forks source link

Class of extracted model parameters in Mplus 8 #78

Closed hynekcigler closed 4 years ago

hynekcigler commented 6 years ago

Dear dr. Hallquist, I have problem with extracting model parameters from Mplus 8. I tried also the newest version on GitHub, but the problem is still there. The class of parameters extracted from version 8 is character, but from version 7 it was numeric. There are also some more warnings

x <- readModels("../pjso_crosscyclemgcfa_hynek.out", what="parameters") ## Mplus 8 Reading model: ../pjso_crosscyclemgcfa_hynek.out There were 13 warnings (use warnings() to see them) class(x$parameters$unstandardized$est) [1] "character" y <- readModels("../mit13mgcfabconfigural.out", what="parameters") ## Mplus 7 Reading model: ../mit13mgcfabconfigural.out class(y$parameters$unstandardized$est) [1] "numeric" warnings() Warning messages: 1: In rbind(c("TC3G44E", "0.201", "0.028", "7.238", "0.000" ... : number of columns of result is not a multiple of vector length (arg 10) 2: In rbind(c("TC3G44E", "0.104", "0.028", "3.769", "0.000" ... : number of columns of result is not a multiple of vector length (arg 10)

... and several more similar warnings (I suppose for each group one).

I use these parameters for subsequent analyses and it causes several problems as I have to use as.numeric in all the functions; shouldn't be the result the same for both Mplus versions?

hynekcigler commented 6 years ago

Update: I am sorry, the error is not possibly produced by difference between Mplus 7 and 8, but by fixing parameters. If I fix certain parameters to prespecified values, MplusAutomation read all the parameters as character. Unfortunately, I am not able to compare this behavior with Mplus 7 license.

michaelhallquist commented 6 years ago

Hi there, I've seen these kinds of errors many times... it almost always comes from Mplus having a section heading that I've never seen before. We have to trap each one of these individually, and they tend to change from version to version. It's usually a very quick and easy fix, but we need the .out files to reverse engineer that part.

Would you please upload the .out file (you may have to rename the suffix .txt for Github to like it) here? I can then take a look in more detail and figure out which section is being missed.

Thanks, Michael

michaelhallquist commented 4 years ago

I'm going to close this issue for now since I believe Mplus v8+ outputs parse correctly in general and I haven't gotten any further details from you about this.

-Michael