
Under VARIABLE: in your Mplus syntax file, list all the variables you exported from SPSS. Forgot spss code windows#
Note that Mplus uses Unix-style forward slashes /, not the Windows standard \.
Under DATA: in your Mplus syntax file, point to the correct directory and data file, e.g., “DATA: File is “C:/directory/subdirectory/datafile.dat” “. dat file in Mplus, remove the first few characters (the Byte Order Mark, “”), and save to replace – this is the only effect saving in Unicode has in this particular case) (If you forgot this step, you can also simply open the final. Under Encoding, select “Local Encoding” to avoid SPSS saving in Unicode. Uncheck “Write variable names to spreadsheet“. Take careful note of which variables you are saving and their order (i.e., write them down somewhere). If you did not remove unnecessary variables at step 2, click Variables and select which variables you wish to save. Save data in a format Mplus can conveniently read. If necessary, convert those to the value you chose as well, similar to 3a. Ensure that no other values are used in your data to indicate “missing” (e.g., 0 or -99 or user-missing). Under Old and New Values, select “System-missing” as the old value and enter your selected value (e.g., -999) as the new value. Click Transform – Recode into Same Variables. Convert missing values to a value easy for Mplus to handle (e.g., -999). Don’t rearrange the variables after this. In Variable view, select all the names of the variables and copy-paste them somewhere safe (e.g., a text editor). Save your data set under an alternative name to avoid overwriting your complete set. Note that Mplus does not handle strings in any way, only numeric variables.
In Variable View, remove all the variables you do not intend to export to Mplus for analysis.(Optional): Remove unnecessary variables.Here’s my reasonably fool-proof step-by-step guide. Various instructions exist all over the Web, but many of them forgo a couple of details that may not be obvious to novices. Exporting data from SPSS (23) to Mplus (7.3) – a simple step-by-step guideĮxporting data from SPSS to Mplus is theoretically a simple process, but can still be a little more complicated than it should be.