Internet Guide to Mplus
Print article

Reading Mplus data sets

I have described elsewhere which type of data files Mplus can read and how they are created.

To read the data, use the DATA command.

Free format

Data in free format are most easy to use, as you don't have to go into the trouble of defining the exact position of variables. All you have to do is to indicate the file where the data are to be found. Of course, in the variables section you will have to name your variables (which is also the case with fixed format data).

DATA:
       FILE IS "C:\directory\subdirectory\filename.csv";

Note that the suffix "csv" is not needed to indicate a csv file to Mplus. It is, however, useful in order for yourself to see at a glance which type of file you are dealing with.

Fixed format

To follow

Multiply imputed data

With multiply imputed data, Mplus expects several data files, corresponding to the number of imputed data sets created. Treatment of these data files is slightly different from normal procedure:

This might look like this:

DATA:
       FILE IS "C:\directory\subdirectory\mifilenames.txt";
       TYPE = IMPUTATION;

The file "mifilenames.txt" might look like this:

midata1.csv
midata2.csv
midata3.csv

and so on, according to the number of files you have created. This set-up assumes that the imputed data sets are in the same directory as "mifilenames.txt". Most likely, you might also indicate paths leading to different directories.

© W. Ludwig-Mayerhofer, Mplus Guide | Last update: 08 Mar 2010