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

Feature Request: Extract a section of model output that is not "supported" #152

Open e-mcbride opened 3 years ago

e-mcbride commented 3 years ago

There is a section of output I would like to extract from my .out files that is currently not supported by MplusAutomation. It would be so great if there was a way to extract an unsupported output section for my set of models so that I would not have to inspect the .out file directly.

Specifically, the section I want to extract is "RANDOM STARTS RESULTS RANKED FROM THE BEST TO THE WORST LOGLIKELIHOOD VALUES". This comes between the sections titled "UNIVARIATE SAMPLE STATISTICS" and "THE MODEL ESTIMATION TERMINATED NORMALLY". This would allow me to determine whether my loglikelihood values were replicated directly in R. It would also allow me to more easily determine the optimal seed values (OPTSEED) for each of my models. If adding the capability to extract an unsupported section is not feasible, I believe adding support for this specific section would be useful to researchers who need to check for LL replication.

JWiley commented 3 years ago

Hi Elizabeth,

I've wanted this before as well. While it is not currently extracted, in the latest version of MplusAutomation, all the output is stored in R. Below is an example. res$results$output has the complete contents of the .out file stored as a text string in R, so you could relatively easily find which row has RANDOM STARTS RESULTS and THE MODEL ESTIMATION TERMINATED and then just show those rows. It would take a bit more to get it parsed into clean data in R like a data.frame but maybe easier than opening each .out file and scrolling and reading yourself if you have many models.

library(MplusAutomation)

test <- mplusObject( MODEL = "mpg ON wt hp am vs;", OUTPUT = "CINTERVAL;", rdata = mtcars) res <- mplusModeler(test, modelout = "model1.inp", run = 1L) res$results$output

On Mon, Jul 19, 2021 at 5:47 AM Elizabeth McBride @.***> wrote:

There is a section of output I would like to extract from my .out files that is currently not supported by MplusAutomation. It would be so great if there was a way to extract an unsupported output section for my set of models so that I would not have to inspect the .out file directly.

Specifically, the section I want to extract is "RANDOM STARTS RESULTS RANKED FROM THE BEST TO THE WORST LOGLIKELIHOOD VALUES". This comes between the sections titled "UNIVARIATE SAMPLE STATISTICS" and "THE MODEL ESTIMATION TERMINATED NORMALLY". This would allow me to determine whether my loglikelihood values were replicated directly in R. If adding the capability to extract an unsupported section is not feasible, I believe adding support for this specific section would be useful to researchers who need to check for LL replication.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/michaelhallquist/MplusAutomation/issues/152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOZHAG6546UICLNMMMDELTYMVUNANCNFSM5ASOBYTQ .

e-mcbride commented 3 years ago

@JWiley Thank you, I didn't notice that section previously! I will use that and get it parsed into a data.frame.

JWiley commented 3 years ago

Reopening the issue as this would be useful feature to have in the future.

@e-mcbride its a new section only introduced in v1.0.0

dinanajiarch commented 1 year ago

Hi @JWiley, I was curious if there was an update to this feature request? Thank you!