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

Remove missing sections from "what" BEFORE parsing them #101

Open cjvanlissa opened 5 years ago

cjvanlissa commented 5 years ago

I've been contributing to the parsing of SAMPSTAT and class_counts, and notice that bugs pop up when these sections are missing from the .out file, e.g. because Mplus gave an error and didn't return full results.

I think that a lot of these errors could be avoided, and hence, the package would be more robust, by checking preemptively whether sections requested in the "what" argument of readModels are actually present in the output, and removing them if they are not present.

Just something to be considered; I'm not actively developing this right now.

michaelhallquist commented 5 years ago

Thanks for your work on this, Caspar. I'm not totally clear on the errors you're referring to. In version 0.7-1 of the package, I thought I implemented what you are describing, in which we check whether a section in 'what' is requested before parsing it. This is seen here: https://github.com/michaelhallquist/MplusAutomation/blob/master/R/readModels.R.

Are there cases where this breaks down? I'd be happy to look at them if so.

Michael

cjvanlissa commented 5 years ago

Michael, I mean the reverse check: Checking if the sections requested in 'what' exist in the output file.

This now happens in a piecemeal manner in each section's parsing function. It might be worthwhile to develop dedicated checks that identify which sections exist in the output file.

Best, Caspar