Output error - too many categories PreviousNext
Mplus Discussion > Confirmatory Factor Analysis >
Message/Author
 Cathy Williams posted on Saturday, October 22, 2011 - 8:43 am
When I run my CFA, the error below is reported. I have saved the SPSS data set as .dat and .csv (write names of variables is unchecked). This error occurs for both files. This number (16197) is similar to the sample size. I have also examined the SPSS data set and cannot find any indication of why this error is occurring. Any thoughts are appreciated!

*** ERROR
Categorical variable U1 contains 16197 categories.
This exceeds the maximum allowed of 10.

Title:
CFA

Data:
FILE IS C:\Documents and Settings\Owner\Desktop\dissertation\stats\CFA mplus.dat;

Variable:
NAMES ARE


u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19
u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32;

CATEGORICAL ARE


u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19
u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32;

MISSING ARE all (-9);



MODEL: f1 BY u1-u7;
f2 BY u8-u12;
f3 BY u13-u17;
f4 BY u18-u22;
f5 BY u23-u27;
f6 BY u28-u29;
f7 BY u30-u32;

OUTPUT: standardized;
modindices;
 Linda K. Muthen posted on Saturday, October 22, 2011 - 1:30 pm
You probably have blanks in the data set and are reading it free format. Blanks are not allowed with free format data. SPSS seems to use blanks for certain types of missing data.
 Lisa M Boyd posted on Friday, October 28, 2011 - 1:55 pm
I'm having a similar problem with Stata data that I've transferred to .dat format using the 'stata2mplus' command. The error message says one of my variables has 11 categories, even though according to Stata it only has 3 (dichotomous plus missing). Any ideas about how I might identify the problem?
 Linda K. Muthen posted on Friday, October 28, 2011 - 4:53 pm
The data reading specifications must be set up incorrectly. Check that the number of variable names matches the number of columns in the data set and that the order of the names corresponds to the order of the columns. If this does not help, please send the output, data, and your license number to support@statmodel.com.
 Emily posted on Wednesday, February 29, 2012 - 9:39 am
Hi,
am having the same problem importing a categorical variable from STATA using the 'stata2mplus' command. The error message says one of my variables has 11,396 categories, even though according to Stata it only has 2(dichotomous plus missing). 11,396 is the number of induvidual records. I've tried compressing the data but this did not solve it. Do you now have a fix for this?
 Linda K. Muthen posted on Wednesday, February 29, 2012 - 2:22 pm
Please send the input, data, output and your license number to support@statmodel.com.
 Emily posted on Thursday, March 01, 2012 - 7:05 am
Thanks Dr Muthen I solved this on my own. I outsheeted from stata as a csv file, filled in my missing values as -9999 and removed the variable name headers and imported direct into mplus as a csv file without problem without using stata2mplus. Hope this solution might help others with the same issue.
 Ide Katrine Birkeland posted on Tuesday, March 01, 2016 - 1:17 am
Hello Drs Muthén

I'm running into the same problem with my file which is imported from SPSS. I have severeal missing data, but only two of the items are tagged with too many categories. Since previous posts mentioned it may have something to do with blanks, I tried removing all of the rows with missing data, but even with no missing data, the same two items caused problems with too many categories. I do ESEM, btw.

Any suggestions?

Thank you very much in advance.
 Linda K. Muthen posted on Tuesday, March 01, 2016 - 6:27 am
If not due to blanks, you probably have more variable names in the NAMES statement than you have columns in the data set.
 Ide Katrine Birkeland posted on Tuesday, March 01, 2016 - 7:21 am
Thank you for your quick reply. As far as I can see, I have the same amount of names and columns, but I might be mistaken.
 Linda K. Muthen posted on Tuesday, March 01, 2016 - 10:48 am
Count them.
 Ide Katrine Birkeland posted on Tuesday, March 01, 2016 - 1:17 pm
I have 56 names and 56 columns.
 Linda K. Muthen posted on Tuesday, March 01, 2016 - 4:02 pm
Please send the output and data set along with your license number to support@statmodel.com.
 Linda K. Muthen posted on Wednesday, March 02, 2016 - 6:29 am
The data set contains many blanks. Open it in Excel and scroll to the right and you will see them. Blanks are not allowed with free format data.
 Mikael Sandberg posted on Friday, January 12, 2018 - 3:46 am
Dear Drs Muthén
I am having the same type of problem importing categorical variables from STATA using the 'stata2mplus' command. The error message says one of my variables has 38 categories, though this is not true.
Best
 Linda K. Muthen posted on Friday, January 12, 2018 - 2:44 pm
It sounds like you are not reading the data correctly. Be sure you have the same number of variable names in the NAMES statement as there are columns in the data set. Be sure you don't have blanks in the data set. If you can't figure it out, send the output, data set, and your license number to support@statmodel.com.
 Monalisa Chandra posted on Wednesday, April 25, 2018 - 10:41 pm
I have the same problem no blanks in the excel sheet and the number of names is same the number of columns.
 Linda K. Muthen posted on Thursday, April 26, 2018 - 6:09 am
Please send the output, data set, and your license number to support@statmodel.com.
 Virginia Rangel posted on Friday, June 15, 2018 - 9:48 am
I am getting an error message saying that I have a categorical variable with more than 10 categories, and I have gone through my .dat file (also tried as a .csv file) and there are no blanks in the dataset (I have checked for each variable that Mplus has flagged) and I have the same number of variables as variable names.

Unfortunately I cannot send my data or output because of the restrictions imposed by my data license. Is there anything else I can look for in my dataset?
 Linda K. Muthen posted on Friday, June 15, 2018 - 11:06 am
If Mplus is finding more categories than the variable has, it is either blanks, more variable names in the NAMES statement than columns in the data set, or your don't have the order of the variable names correctly corresponding to the columns in the data set. I have never seen this message for any other reason. I would need to see the data set and output to help further if you can't see the problem yourself.

One thing you could try is to put only that variable on the USEVARIABLES list and save it. See how many observations you get and the values being saved. That may give you a hint. If the number of observations reported is less than the number of observations in the data set, it is blanks or too many variable names.
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: