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.
82 stars 46 forks source link

readModels : Error in rbind(deparse.level, ...) : \n numbers of columns of arguments do not match\n #25

Closed wbuchanan closed 7 years ago

wbuchanan commented 9 years ago

Have several different models with varying output based on model specification (e.g., some of the TECH arguments are only appropriate if continuous variables are included or appropriate only if all manifest variables are categorical) and get the error message:

Error in rbind(deparse.level, ...) : \n numbers of columns of arguments do not match\n

When using readModels to read in the output files.

michaelhallquist commented 9 years ago

Hi William,

Would you please upload (or email to me) an example output file that is not reading in properly. Without this, we can’t diagnose the problem.

Thanks, Michael

On Jul 10, 2015, at 6:09 AM, William Buchanan notifications@github.com wrote:

Have several different models with varying output based on model specification (e.g., some of the TECH arguments are only appropriate if continuous variables are included or appropriate only if all manifest variables are categorical) and get the error message:

Error in rbind(deparse.level, ...) : \n numbers of columns of arguments do not match\n

When using readModels to read in the output files.

— Reply to this email directly or view it on GitHub https://github.com/michaelhallquist/MplusAutomation/issues/25.

pfsj commented 8 years ago

This issue appears related to the additional confidence interval output provided by including "OUTPUT: CINTERVAL;" in the Mplus model (a multilevel mixture model). I received the same error (i.e., "Error in rbind(deparse.level, ...) : numbers of columns of arguments do not match") using readModels. However, using readModels works just fine on the same Mplus model when not requesting confidence intervals in the output file.

michaelhallquist commented 7 years ago

Thanks for the feedback on the issue. I was able to mimic the problem in multilevel mixtures with CINTERVAL output by adding OUTPUT: CINTERVAL to Mplus User's Guide example 10.1. The issue is that Mplus does not output Within Level in the first part of the Categorical Latent Variables CINTERVAL output, even though this pertains to Within. I've implemented a workaround to detect this omission and add it to the data.frame. This seems to correct the error mentioned above. Here's the problematic output section for record keeping:

Categorical Latent Variables

 C#1      ON
    X1              -1.979      -1.817      -1.734      -1.302      -0.869      -0.787      -0.625

 Intercepts
    C#1             -0.692      -0.490      -0.386       0.153       0.692       0.795       0.997

Between Level

 C#1      ON
    W               -1.989      -1.785      -1.680      -1.134      -0.588      -0.484      -0.280

 Residual Variances
    C#1             -0.325      -0.244      -0.203       0.013       0.230       0.271       0.352