mplusModeler with multiple imputed datasets

36 views
Skip to first unread message

malte.c...@googlemail.com

unread,
Jun 9, 2021, 12:03:43 PM6/9/21
to MplusAutomation
Dear everyone,

I am trying to run a few models using the mplusObject and mplusModeler functions and it seems I cant get them to work with multiple imputed datasets. Creating the 15 imputed datasets as well as the .dat file with the list of imputed datasets works well, but in the generated .inp script, it seems to use the wrong dataset name (without "implist"). I also get this result when I use the example from the CRAN manual (p.48). When I use the version from github, I get a different error message from mplusModeler, but it still doesn't work (Assertion on 'df' failed: Must be of type 'data.frame', not 'list'):

> idat <- list(data.frame(mpg = mtcars$mpg, hp = c(100, mtcars$hp[-1])),
+              data.frame(mpg = mtcars$mpg, hp = c(110, mtcars$hp[-1])),
+              data.frame(mpg = mtcars$mpg, hp = c(120, mtcars$hp[-1])))

> testobjimp <- mplusObject(MODEL = "[mpg];", rdata = idat, imputed = TRUE)
R variables selected automatically as any variable name that
occurs in the MODEL, VARIABLE, or DEFINE section.

> testimp <- mplusModeler(testobjimp,modelout = "testimp.inp",writeData = "ifmissing", hashfilename=TRUE,run = TRUE)
Wrote model to: testimp.inp
Fehler in .cleanHashData(df = df, keepCols = keepCols, dropCols = dropCols,  :
  Assertion on 'df' failed: Must be of type 'data.frame', not 'list'.

Has anyone else experienced this and could help me?

Best regards and thanks in advance

Malte


malte.c...@googlemail.com

unread,
Jun 9, 2021, 12:18:08 PM6/9/21
to MplusAutomation
Hiya,

nevermind, I have gotten it to work using the 0.8 version.

Cheers
Malte

Joshua Wiley

unread,
Jun 14, 2021, 7:28:19 PM6/14/21
to malte.c...@googlemail.com, MplusAutomation
Hi Malte,

It's also just been fixed, I think, in the most recent development version thanks to @cjvanlissa 

Cheers,

Josh


--
You received this message because you are subscribed to the Google Groups "MplusAutomation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mplusautomati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mplusautomation/45175dfc-d5bc-444b-aed6-cbac9f002f5cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages