error in mplusModeler

589 views
Skip to first unread message

bire...@gmail.com

unread,
Jun 16, 2016, 9:33:45 AM6/16/16
to MplusAutomation
Hi
 
i am unable handle the error from this code in rstudio
here is the code
library(MplusAutomation)
t <- mplusObject(
  TITLE = "latent;",
  MODEL = "
    eta ON xi1 xi2;
    xi1 WITH xi2;",
  usevariables = c("eta", "xi1", "xi2"),
  rdata = rt)

h <- mplusModeler(t, "w.dat", "model1.inp", run = 1L)
 and  when i run (t),here is the output

Wrote model to: model1.inp
Wrote data to: w.dat

Running model: model1.inp 
System command: C:\Windows\system32\cmd.exe /c cd "C:\Users\Bira\Documents" && "Mplus" "model1.inp" 
Error in getOutFileList(target, recursive, filefilter) : 
  Specified target does not exist.
  Target: model1.out
In addition: Warning message:
running command 'C:\Windows\system32\cmd.exe /c cd "C:\Users\Bira\Documents" && "Mplus" "model1.inp"' had status 1 



Thanks

michael.hallquist

unread,
Jun 16, 2016, 4:12:46 PM6/16/16
to MplusAutomation
Hi Biree,

It sounds like the .out file was not written, suggesting Mplus didn't even run. Can you check for model1.out in the same directory? If you copy the command listed onto the command prompt, do you get any more information about the error? Those would be the first two things to check in troubleshooting.

Michael

bire...@gmail.com

unread,
Jun 17, 2016, 10:15:06 AM6/17/16
to MplusAutomation
Thank you Michael 
Still i didn't handle it. 
 I have checked model1.out in the same directory. For your second recommendation, i don't know how to run R from windows command prompt.
 Since Mplus Demo is limited by number of variables,  i chose to use MplusAutomation to do latent variable interaction effects for my thesis. 
 
Even i tried the same  command by Joshua F. Wiley using data in r "mtcars" just to see how its working. 
here is :
library(MplusAutomation)
test1 <- mplusObject(
  TITLE = "test the MplusAutomation;",
  MODEL = "
  mpg ON wt hp;
  wt WITH hp;",
  usevariables = c("mpg", "wt", "hp"),
  rdata = mtcars)

res1 <- mplusModeler(test1, "mtcars.dat", modelout = "model1.inp", run = 1L)
summary(res1)
 
and again the error is the same. That's 

Wrote model to: model1.inp
Wrote data to: mtcars.dat

Running model: model1.inp 
System command: C:\Windows\system32\cmd.exe /c cd "C:\Users\Bira\Documents" && "Mplus" "model1.inp" 
Error in getOutFileList(target, recursive, filefilter) : 
  Specified target does not exist.
  Target: model1.out
In addition: Warning messages:
running command 'C:\Windows\system32\cmd.exe /c cd "C:\Users\Bira\Documents" && "Mplus" "model1.inp"' had status 1 
> summary(res1)
Error in summary(res1) : object 'res1' not found

Thanks
Biree

michael.hallquist

unread,
Jun 20, 2016, 1:07:55 PM6/20/16
to MplusAutomation
I suspect this has something to do with the fact that you're using the Mplus Demo, which we haven't previously tested or supported using MplusAutomation. There may be ways around this using the Mplus_command argument in runModels, but I haven't tried it myself. You should also verify that Mplus is in your system path.

Best,
Michael

bire...@gmail.com

unread,
Jun 21, 2016, 3:55:11 AM6/21/16
to MplusAutomation
Thank you Michael
Reply all
Reply to author
Forward
0 new messages