MplusAutomation icon indicating copy to clipboard operation
MplusAutomation copied to clipboard

Multiple imputation issues

Open sda030 opened this issue 2 years ago • 0 comments

I thought I would never use imputation given that FIML is more convenient and offers the same features. However, in face of comlicated models (4+ latent variables, multigroup, ordinal observed), it became the only option. Here are some issues I found:

  1. The argument "DATAIMPUTATION" is missing, as has been reported but closed 7 years ago (https://github.com/michaelhallquist/MplusAutomation/issues/24). The hack works well though, so not a priority.
Warning message:
In l_getSavedata_readRawFile(curfile, outfiletext, format = "free",  :
  Unable to locate SAVEDATA files for filename: imputed_*.dat

Mplus takes the asterisk as a placeholder for the number of the draw. A quick fix should be something like below.

if(grepl("\\*", results$savedata_info$fileName)) {
  results$savedata_info$imputation <- TRUE
  lapply(dir(pattern = results$savedata_info$fileName), function(imp_file) {
     l_getSavedata_readRawFile(...
  }
}

(Sorry, I have not developed this fully, I find a PR for this package a bit intimidating)

example_imputation.zip

sda030 avatar Aug 09 '22 15:08 sda030