Mplus
Tuesday
October 21, 2014
HOME ORDER CONTACT US CUSTOMER LOGIN MPLUS DISCUSSION
Mplus
Mplus at a Glance
General Description
Mplus Programs
Pricing
Version History
System Requirements
Platforms
FAQ
Mplus Demo Version
Training
Short Courses
Short Course Videos
and Handouts
Web Training
Documentation
Mplus User's Guide
Mplus Diagrammer
Technical Appendices
Mplus Web Notes
User's Guide Examples
Analyses/Research
Mplus Examples
Papers
References
Special Mplus Topics
Alignment (MG CFA)
BSEM (Bayesian SEM)
Complex Survey Data
ESEM (Exploratory SEM)
Genetics
IRT
Mediation
Missing Data
Randomized Trials
How-To
Using Mplus via R
Mplus plotting using R
Chi-Square Difference
Test for MLM and MLR
Power Calculation
Monte Carlo Utility
Search
 
Mplus Website Updates

The RUNALL Utility

The RUNALL utility is a set of DOS batch files used to aid in Monte Carlo studies when data have been generated outside of Mplus. RUNALL is used with the new SAVEDATA RESULTS option in Mplus Version 2. It takes one input file and a set of data files, runs Mplus on the input setup using each of the data files, and appends the results from the runs (parameter estimates, standard errors of the parameter estimates, and fit statistics) into one file. All data files used for a particular input file must have the same data format and the same number of variables with all variables in the same order.

The RUNALL utility consists of 4 DOS batch files: runall.bat, runstart.bat, runone.bat, and runend.bat. To customize RUNALL, you must change the settings in runstart.bat. No changes are necessary in the other 3 files. The self-extracting executable runutil.exe contains all 4 DOS batch files. Click on the link to download and extract these files into the directory in which Mplus is installed.

Steps to use RUNALL:

  1. Place all the data files to be used for the run in one directory. It is recommended that the data files be placed in a directory different from where you would do the actual run. Also, if you are running this for the first time, it is recommended that you try it on a small set of data files (with backups) to be sure that you have set the variables correctly.

  2. Place the input file in a working directory. Note the names of the data and the file used for SAVEDATA RESULTS specified in the input file. These filenames should not include a direct path. You will need to specify these filenames in your settings in runstart.bat.

  3. Change the necessary settings in runstart.bat to customize the run. To edit a batch file, open it in a text editor or right click on the file in Windows Explorer and choose Edit. See below for an explanation of the environment variables that need to be set.

  4. Type RUNALL at the MS-DOS prompt.

  5. Here are some important files to look at when the run completes:
    • The output file contains information about the order the results are saved in the RESULTS file.
    • The file specified as ERROR_LOG in runstart.bat contains the names of data files for which results were not saved. This may be due to nonconvergence, math errors, or other related problems.
    • The file specified as ALL_RESULTS in runstart.bat contains the results for all successful runs. This can be used as a data file where each observation is a successful run. The variables in this new data file are the results that are saved (parameter1, parameter2, ..., se1, se2, ..., chi-square, logL, etc.).
    • The file specified as COMPLETED_LOG contains the names of data files for which the model terminated successfully. The order of the data files listed in the COMPLETED_LOG corresponds to the order the results are saved in ALL_RESULTS.

How to change settings in runstart.bat

In the file runstart.bat, each setting is preceeded by a description of its usage. Lines starting with REM are comments and should not be changed. To change a setting, edit the line beginning with SET. For example, here is the setting for WORKING_DIR:

REM **************************************************************
REM * WORKING_DIR                                                *
REM *    The working directory.  This is the directory in which  *
REM *    you should place the input and use the RUNALL utility.  *
REM **************************************************************

SET WORKING_DIR=C:\TESTDIR

To change the working directory to C:\MYRUN, edit the last line as follows:

SET WORKING_DIR:C:\MYRUN

Description of settings in RUNSTART

    WORKING_DIR
    The working directory. This is the directory in which you should place the input and use the RUNALL utility.

    DATA_DIR
    The data directory. This is the directory which contains the data files. It is recommended that this directory be different from the working directory.

    FILES
    A wildcard expression describing the data files you want to use in the data directory.

    INPUT_FILE
    Name of the input file.

    COMMON_DATA
    Name of the data file specified in the input file. Do not include a direct path for this filename.

    COMMON_RESULTS
    Name of the file specified for the SAVEDATA RESULTS option. Do not include a direct path for this filename.

    ALL_RESULTS
    Name of the file to which results from each run should be saved.

    TEMP_FILE
    Name of a temporary file for use by the RUNALL utility.

    ERROR_LOG
    Name of the error log file. This file contains the names of data files which caused the model to not terminate normally.

    COMPLETED_LOG
    Name of the log file for completed runs. This file contains the names of data files for which the model terminated successfully. The order of the data files listed in the COMPLETED_LOG file corresponds to the order of results saved in the ALL_RESULTS file.

Click here for an example using the RUNALL utility.

Frequently Asked Questions about RUNALL

Q: I get an "Out of environment space" error when running RUNALL. What should I do?
A: You need to increase the environment space for your MS-DOS session. There are 3 ways to do this:

  1. To increase the environment space temporarily for an opened MS-DOS session, type the following at the prompt:

      C:\>C:\WINDOWS\COMMAND.COM /E:2048

    The number after /E: specifies the size of the environment space. This number must be a power of 2. It has been seen that 2048 is sufficient for RUNALL, but if this isn't enough, try increasing it to 4096.

  2. Increase the environment space for an existing MS-DOS shortcut or create a new shortcut for MS-DOS with a bigger environment space.

    To change the environment space for an existing MS-DOS shortcut, right-click on the shortcut and select Properties. Click on the Program tab. You should see C:\WINDOWS\COMMAND.COM listed for Cmd line. Add /E:2048 (or the necessary environment space size) to the end of line. Make sure there's a space between COMMAND.COM and /E.

    To create a new shortcut for MS-DOS with a bigger environment space, right-click on the desktop and select New and Shortcut. For the command line, type

    C:\WINDOWS\COMMAND.COM /E:2048

    (or the necessary environment space size). Then click on Next. Type in a name for the shortcut and then click Finish.

  3. To change the default environment space, use a text editor such as Notepad to edit config.sys. This file is located in the C:\ directory (or your computer's root directory). Check to see if there is already a line starting with SHELL= in the file. If not, add this line

    SHELL=C:\COMMAND.COM /E:2048 /P

    to the end of the file. If there is already a line with SHELL=C:\COMMAND.COM, then add /E:2048 to the end of the line. You must reboot your computer for the new default environment space to be set.

Q: Are the data files used in any particular order? Is there a way for me to determine which data file produced a particular set of results?
A: The data files are not used in any particular order. The SUCCESS_LOG file gives the order the data files are run. This is also the order the results are saved in the ALL_RESULTS file. Note: This is new in the latest version of RUNALL (1.1). Download the new set of batch files to use this feature of RUNALL.