Problems with input SPSS data file PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Eva van de Weijer posted on Monday, July 08, 2013 - 2:10 pm
Hello, I am a new user of Mplus and I have problems reading SPSS data into Mplus.
Mplus gives the following error:

*** ERROR
The number of observations is 0. Check your data and format statement.
Data file: Leeuwenspel & cito voor Mplus_zonder StudentID.csv
*** ERROR
Invalid symbol in data file:
"101" at record #: 1, field #: 1

The value in the first record at the first field is 101 (a numeric variable), and I don't understand why the error occurs or how I can fix this.

All variables are numeric, point decimal, and variable names do not exceed 8 characters. I have tried both .dat and .csv files.

kind regards, Eva
 Linda K. Muthen posted on Monday, July 08, 2013 - 3:27 pm
Open the data file in the Mplus Editor. You will see the invalid character. Delete it and save the data. This problem seems to have been introduced in the latest version of SPSS.
 Eva van de Weijer posted on Monday, July 08, 2013 - 11:48 pm
Thank you for your quick reply. It worked!
 Takisha McNeill Corbett posted on Monday, February 03, 2014 - 8:09 pm
Hi,
Can I open an SPSS files .sav in Mplus editor? It doesn't appear as an file format option when I tried your recommendation above. Only .inp and .out are options. Any other suggestions, I am working on my dissertation? Also can Mplus randomly split the data in an SPSS file .sav?

Thanks for your help.

Thanks,
Takisha
 Linda K. Muthen posted on Tuesday, February 04, 2014 - 9:05 am
You cannot open an SPSS data file in Mplus. You need to create a numeric ASCII file for Mplus to read.

Mplus cannot randomly split the data. You should do that in SPSS before you save the data as a numeric ASCII file.
 Kayla Sedgwick posted on Sunday, February 16, 2014 - 8:26 am
Hi,

Does anyone know if MPLUS computes mediation under the same assumptions as the famous Barron & Kenny approach? If so, does anyone know the syntax for this?

Thank you!
 Bengt O. Muthen posted on Sunday, February 16, 2014 - 12:44 pm
Chapter 3 of the User's Guide shows mediation modeling. The same assumptions as Baron-Kenny are used.
 Kayla Sedgwick posted on Friday, February 21, 2014 - 8:13 am
Thank you for your reply, I was able to get the code from the User guide. Now I am wanting to test mediation a different way, under the assumptions of Preacher & Hayes (2004, 2008). Is there syntax for this that is different from the Barron and Kenny approach? or does MPLUS not compute mediation in this way?

Thank you!
 Bengt O. Muthen posted on Friday, February 21, 2014 - 11:26 am
Not sure what you mean by the Baron-Kenny approach, or what you mean by the assumptions of Preacher-Hayes. Mplus computes indirect effects using the product formula.
 Sytske posted on Tuesday, June 02, 2015 - 2:26 pm
I am getting the same error:

INPUT INSTRUCTIONS

DATA: FILE IS DIVERSITY.dat;
VARIABLE: NAMES ARE ID agg10_pt agg20_pt aggcol ag10_rec ag20_rec aggscolr;
IDVARIABLE IS ID;
MODEL: f1 BY agg10_pt agg20_pt aggcol;


*** ERROR
The number of observations is 0. Check your data and format statement.
Data file: DIVERSITY.dat
*** ERROR
Invalid symbol in data file:
"ID" at record #: 1, field #: 1

When I open the data in Mplus, I don't see any invalid symbol: ID is the variable name of the first variable. What am I doing wrong?

Thanks in advance for your help,

Sytske
 Sytske posted on Tuesday, June 02, 2015 - 2:36 pm
Sorry, I already found the solution: the file had the variable names on top and Mplus doesn't like that. Problem solved!
 Eivor Fredriksen posted on Thursday, October 22, 2015 - 3:39 am
Hi,

I've converted a .sav-file to a ASCII file (.dat). When I run the analysis in mplus I get the following error-message:
"*** ERROR
Invalid symbol in data file:
"-" at record #: 2, field #: 10"

The symbol that is referred to is a minus-sign to indicate that the value is negative. Do you have an advice on what I am doing wrong, and how to correct it?

Thanks!
 Linda K. Muthen posted on Thursday, October 22, 2015 - 9:14 am
Please send the output, data set, and your license number to support@statmodel.com.
 Eivor Fredriksen posted on Friday, October 23, 2015 - 4:49 am
I think I figured it out, so I won't bother you by sending the files. It was "-.87", and when I replaced all negative values in the format of "-.xx" with "-0.xx" it worked fine.

Anyway, thank you for your reply!
 Hugh F. Crean posted on Tuesday, May 03, 2016 - 7:24 am
Hello All,

I am using SPSS, saving as a .dat file. The original file has 202 observations and when I run anything in Mplus, I get 193 observations (even just running type = basic). There is some missing data in the file (coded 999999), but Mplus recognizes this as missing for the 193 that it uses. Also, when I open/observe the .dat file using Mplus (and pasting into Excel), I get 202 observations. Any thoughts and/or ideas for help in figuring out what is going on?

Thanks in advance.
 Linda K. Muthen posted on Tuesday, May 03, 2016 - 9:05 am
It is likely that the file contains blanks. SPSS seems to use blanks for certain kinds of missing data. Blanks are not allowed with free format data. If you cannot figure this out, send the input, data, output and your license number to support@statmodel.com.
 Hugh F. Crean posted on Tuesday, May 03, 2016 - 10:30 am
Yes, that was it. Thanks so much for the quick insight!
 Deirdre Quinn posted on Monday, July 24, 2017 - 8:38 am
I am experiencing the same problem - the error message I received is pasted below. I opened the data in both Excel and in the Mplus editor, and don't see any invalid symbols - the field in question contains a single digit number, as do all the other fields.

Any advice would be appreciated!

*** ERROR
The number of observations is 0. Check your data and format statement.
Data file: /Users/smileydq/Desktop/DissMplus/MplusData7_23_17.csv
*** ERROR
Unrecognized symbol in data file:
symbol at record #: 1, field #: 163
 Linda K. Muthen posted on Monday, July 24, 2017 - 1:43 pm
Please send your files and license number to support@statmodel.com.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: