errors on runModels()

916 views
Skip to first unread message

Siwachoat Srisuttiyakorn

unread,
Sep 1, 2014, 6:17:08 AM9/1/14
to mplusau...@googlegroups.com
Hello.
i want to test sem in R using MplusAutomation but i always have the same problem 
when i execute runmodels i dont find file .out in my folder.

i use mplus demo 7.11 

my code is 
ds = read.csv("http://www.math.smith.edu/r/data/help.csv") 
attach(ds) 
library(MplusAutomation) 
cesdcut = ifelse(cesd>20, 1, 0) 
smallds = na.omit(data.frame(homeless, cesdcut, 
satreat, linkstatus)) 
prepareMplusData(smallds, file="mplus.dat") 
createModels("mplus.txt") 
runModels() 
summary=extractModelSummaries() 
models=readModels()

my mplus.txt file is
[[init]]
iterators = classes;
classes = 1:4;
dir = "Z:/field/blog";
filename = "mplus-[[classes]]-class-.inp";
outputDirectory = [[dir]];
[[/init]]
TITLE: [[classes]]-class
DATA: FILE IS mplus.dat;
VARIABLE: NAMES ARE homeless cesdcut satreat linkstatus;
CLASSES = c ([[classes]]);
CATEGORICAL = all;
ANALYSIS: TYPE = MIXTURE;
STARTS = 2000 200;
STITERATIONS=1000;
OUTPUT: TECH1 TECH10;
SAVEDATA: FILE IS "mplus-[[classes]]-class.cprob";
SAVE IS CPROB;
This is a warning message:

Running model: mplus-1-class-.inp 
System command: C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-1-class-.inp" 

Running model: mplus-2-class-.inp 
System command: C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-2-class-.inp" 

Running model: mplus-3-class-.inp 
System command: C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-3-class-.inp" 

Running model: mplus-4-class-.inp 
System command: C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-4-class-.inp" 
Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-1-class-.inp"' had status 1 
2: running command 'C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-2-class-.inp"' had status 1 
3: running command 'C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-3-class-.inp"' had status 1 
4: running command 'C:\WINDOWS\system32\cmd.exe /c cd "C:\Users\Siwachoat\Desktop\mplus" && "Mplus" "mplus-4-class-.inp"' had status 1 

 
please help me.

Siwachoat


michael.hallquist

unread,
Oct 10, 2014, 10:58:30 AM10/10/14
to mplusau...@googlegroups.com

Hi Siwachoat,

I would check your mplus input files, as well as the corresponding .out files to see what error occurred. A non-zero exit status of Mplus means an error has occurred, and the information about that error should be in the .out file. Feel free to attach a .inp and/or .out file here if you need more input.

Michael

ignacz...@gmail.com

unread,
Feb 23, 2015, 9:54:30 AM2/23/15
to mplusau...@googlegroups.com
Dear Michael, dear All,
unfortunately, I also had the same problem, and I cannot figure out what is the problem.
I create an .inp file, and then use the RunModels() command, but no .out file is created.
I really don't know where the problem lies, as I do create a valid .inp files that I can run in Mplus.
I have attached a demo version of my model, with R syntax, the R-generated Input file, the log R creates, and my data, of course. I've tried both 32-bit, and 64-bit versions of R, same result.
I would be very grateful, if you could assist. See below for more details,
Kind regards,
Zsofia Ignacz

Technical Information on R:
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

Technical Information on Mplus:
Mplus Version 5.2
Base Program 

Error Message:
runModels(replaceOutfile = "modifiedDate")

Running model: ess_test.inp 
System command: C:\Windows\system32\cmd.exe /c cd "\\datastore.fu-berlin.de\polsoz\SOZ-MAKROSOZ\04 PROJEKTE\demokratiedeutung_ZsISoS\Datensätze" && "Mplus" "ess_test.inp" 
Warning message:
running command 'C:\Windows\system32\cmd.exe /c cd "\\datastore.fu-berlin.de\polsoz\SOZ-MAKROSOZ\04 PROJEKTE\demokratiedeutung_ZsISoS\Datensätze" && "Mplus" "ess_test.inp"' had status 1 
demo.R
demo.sav
ess_test.dat
ess_test.inp
Mplus Run Models.log

Michael Hallquist

unread,
Feb 23, 2015, 5:01:43 PM2/23/15
to ignacz...@gmail.com, mplusau...@googlegroups.com
Hi Zsofia,

What happens if you paste the exact command that follows “System command:” below into a DOS command prompt? Also check that the cd command itself below works (i.e., that the network location is accessible). Finally, do you get a .out file from the command? If so, does it list an error?

Hope this helps,
Michael

--
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.
For more options, visit https://groups.google.com/d/optout.
<demo.R><demo.sav><ess_test.dat><ess_test.inp><Mplus Run Models.log>

Ignácz Zsófia

unread,
Feb 24, 2015, 4:58:39 AM2/24/15
to Michael Hallquist, mplusau...@googlegroups.com
Dear Michael,
yes, thank you, I think this helped locate the problem. I get the error in DOS "Cmd.exe does not support UNC names as the current directory". As I understand, this means that the way I gave the network connection link, is not UNC conform. The network connection itself was intact.
I now made a quick fix by moving the files to my own computer, where lowcaps/direct routes prevail (yes, admittedly this is sloppy). But it works beautifully.
Will see how I can hanker out the problem with the UNC route and will post it to the forum - in the hope this will help others with similar problems. Apparently, I need to get an updated version of the cmd.exe, but it might have some stability issues:

Thank you again for your help,
Zsófia

Isabel Slurink

unread,
Jul 5, 2018, 9:56:46 AM7/5/18
to MplusAutomation
Dear Zsófia,

I'm currently experiencing the same problem as you described in your first message (the error message below). I was wondering if you could elaborate a little more on how you tackled the problem. I'm not using the demo version but MplusAutomation in R.
running command 'C:\WINDOWS\system32\cmd.exe /c cd "N:\Documents" && "Mplus" "mplus-9-class-.inp"' had status 1 

Warm regards,
Isabel

Op dinsdag 24 februari 2015 10:58:39 UTC+1 schreef Ignácz Zsófia:

michael.hallquist

unread,
Jul 18, 2018, 6:07:15 PM7/18/18
to MplusAutomation
Hi Isabel,

I think my advice remains the same as before. I would run the exact command printed below in a DOS command prompt. It could be that the input file doesn't exist, the folder name is slightly wrong, or that the network mount dropped out. runModels calls Mplus on the command line in the same way that you can do manually. That will probably be the best approach for debugging this problem.

Best,
Michael
Reply all
Reply to author
Forward
0 new messages