10.07.2015 Views

Mplus Users Guide v6.. - Muthén & Muthén

Mplus Users Guide v6.. - Muthén & Muthén

Mplus Users Guide v6.. - Muthén & Muthén

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 13EXAMPLE 13.17: MERGING DATA SETSTITLE: this is an example of merging two datasetsDATA: FILE IS data1.dat;VARIABLE: NAMES ARE id y1-y4;IDVARIABLE IS id;USEVARIABLES = y1 y2;MISSING IS *;ANALYSIS: TYPE = BASIC;SAVEDATA: MFILE = data2.dat;MNAMES ARE id y5-y8;MFORMAT IS F6 4F2;MSELECT ARE y5 y8;MMISSING = y5-y8 (99);FILE IS data12.sav;FORMAT IS FREE;MISSFLAG = 999;This example shows how to merge two data sets using TYPE=BASIC.Merging can be done with any analysis type. The first data set data1.datis named using the FILE option of the DATA command. The seconddata set data2.dat is named using the MFILE option of the SAVEDATAcommand. The NAMES option of the VARIABLE command gives thenames of the variables in data1.dat. The MNAMES option of theSAVEDATA command gives the names of the variables in data2.dat.The IDVARIABLE option of the VARIABLE command gives the nameof the variable to be used for merging. This variable must appear onboth the NAMES and MNAMES statements. The merged data setdata12.dat is saved in the file named using the FILE option of theSAVEDATA command. The default format for this file is free and thedefault missing value flag is the asterisk (*). These defaults can bechanged using the FORMAT and MISSFLAG options as shown above.In the merged data set data12.dat, the missing value flags of asterisk (*)in data1.dat and 99 in data2.dat are replaced by 999.For data1.dat, the USEVARIABLES option of the VARIABLEcommand is used to select a subset of the variables to be in the analysisand for merging. The MISSING option of the VARIABLE command isused to identify the values or symbol in the data set that are treated asmissing or invalid. In data1.dat, the asterisk (*) is the missing value404

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!