How do I load data in fixed format into Mplus?
Mplus can read a data set in either free or fixed format. In order to
load fixed format data into Mplus, you must specify FORTRAN style
statements in the FORMAT IS option of the DATA command.
The following sample data set contains five variables. The first variable begins from the first column and ends at the fifth one, and has one digit under the decimal point (i.e., 2419.2 for the first observation). The second variable has the same format (1249.2). The third through fifth variables begins from twelfth column after skipping one space and each has four digits without the decimal point (i.e., 4129, 3187, and 1858 from the third through fifth variables).
2419212492 412931871858 2187212342 287981012789 8518912451 582541224242 1589752610 158112575421 2587856352 878924217821This data set can be read by the following command:
DATA: FILE IS "C:\mplus\example.dat"; FORMAT IS 2F5.1,1x,3F4; VARIABLE: NAMES ARE var1-var5;You can use column and line control symbols when reading non-typical
data arrangements. 1x tells Mplus to skip one space
before reading the third variable. t shifts
the pointer to the column specified; for example, t12
moves it to the twelfth column. The / (forward
slash) shifts the pointer to the next line and thus makes it possible
to read multiple lines for an observation.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on April 19, 2011.







