Variable with non-integer value PreviousNext
Mplus Discussion > Categorical Data Modeling >
Message/Author
 Jessica Leah posted on Thursday, August 05, 2010 - 5:42 pm
Hi,

I'm trying to do a path analysis with a variable that has non-integer values. As a result, I'm getting an error message. Is it possible to correct this without modifying my variable?

Thanks
 Linda K. Muthen posted on Friday, August 06, 2010 - 9:52 am
It sounds like you are putting the variable on the CATEGORICAL list. If it is categorical, it should not have non-integer values. Perhaps you are reading the data incorrectly.
 Melissa Kimber posted on Monday, February 13, 2012 - 9:02 am
Hello,
I am getting a similar problem; however, I checked the data and everyone is coded as either a 1,2 or 3.
Any suggestions?
 Linda K. Muthen posted on Monday, February 13, 2012 - 9:57 am
Please send the input, data, output, and your license number to support@statmodel.com.
 Lin Gu posted on Sunday, December 09, 2012 - 6:43 pm
I have a variable that has 7 ordered values: 0, .5, 1, 1.5, 2, 2.5, and 3. I put it one the categorical list and got the error message about non-integar values. Is there a way that I can treat the variable as a categorical variable or do I have to model it as a continuous variable? Thanks.
 Linda K. Muthen posted on Monday, December 10, 2012 - 10:50 am
The values of a categorical variable have no meaning. Just change the values to integers:

0 1 2 3 4 5 6
 Rohan Jayasuriya posted on Friday, October 30, 2015 - 8:08 am
Hi

I am having the same problem as Melissa Kimber

*** ERROR
Categorical variable BPCNTR contains non-integer values

I have checked the input file on notepad and the variable is coded 1 or 2

I went back to my original SPSS file and saved it as dat file and tried again. same result.

any help appreciated
 Linda K. Muthen posted on Friday, October 30, 2015 - 9:00 am
Please send the output, data set, and your license number to support@statmodel.com. You are most likely reading the data incorrectly or you have blanks in the data set.
 Aiden M A Thornton posted on Thursday, January 05, 2017 - 9:21 pm
Hello, I am also having the same problem as both Melissa and Rohan (above).

I'm trying to read in a categorical variable, and have checked that the values are integer in the .dat file but the output continues to state the following

"*** ERROR
Categorical variable SCT1OGIV contains non-integer values."

I have tried running this many times and continues to be a problem. Is there a way if / how I may be reading in the data incorrectly?

Many thanks.
 Linda K. Muthen posted on Friday, January 06, 2017 - 8:16 am
It is likely that you have blanks in the data set which cause free format data to be read incorrectly. If you can't figure this out, send the files and your license number to support@statmodel.com.
 Martin Taylor posted on Sunday, June 11, 2017 - 3:01 pm
*** ERROR in VARIABLE command
Categorical variable U20 contains invalid and/or non-integer values.
Problem with: GPCM

I see this error trying to run an IRT model in mplus. I am employing the users guide example "5.5: Generalized partial credit model". I am copying/downloading the example input and data files as is. The file will run if I drop (gpcm) out of the command line in the example. But I am wanting to run the gpcm.
 Linda K. Muthen posted on Sunday, June 11, 2017 - 4:50 pm
Please send the files and your license number to support@statmodel.com.
 Deniz  posted on Thursday, August 03, 2017 - 5:58 am
Dear Drs. Muthen,
I am specifying a manifest-latent model (M2) as suggested by Marsh et al. (2009; DOI: 10.1080/0027317090333366). My factor indicators are ordered and I have, thus, computed a median across the items on the within-level. In some cases four items are used to calculate the median and the resulting medians are consequently not all integers. As mplus does not accept float values as categorical values, I thought about rounding the values, but I am not sure if that is appropriate. How would you suggest to treat the float values in this case?
Thank you so much in advance
 Bengt O. Muthen posted on Thursday, August 03, 2017 - 5:36 pm
If you compute a median, you would treat the variable as continuous, not categorical.
 Deniz  posted on Friday, August 04, 2017 - 3:57 am
Thank you for your answer.
Just to make sure, you would suggest that I treat the medians as continuous variables and therefore conduct a linear multilevel regression? If this is the case, could I also interpret standardized results?
Thank you so much.
 Bengt O. Muthen posted on Friday, August 04, 2017 - 2:27 pm
Yes and yes.
 Medea Cusati Müller posted on Tuesday, August 08, 2017 - 10:23 am
Dear Dr Muthen

I am specifing a multilevel model
Dependent Variable - categorical 0 and 1; missing -99.


Trying to run the error occures categorical variable contains non-integer values.
I checked data. Everything is ok.

Many thanks
 Bengt O. Muthen posted on Tuesday, August 08, 2017 - 1:16 pm
Send output and data to Support along with your license number.
 Melissa Reynolds Weber posted on Thursday, June 07, 2018 - 7:41 am
Hello Drs. Muthen,

I'm experiencing a similar issue as reported by Aiden and Martin above. I keep getting the following error message:
*** ERROR in VARIABLE command
Categorical variable Y34 contains invalid and/or non-integer values.
Problem with: PCM

The variables are ordered categorical and I confirmed that they take on only values (0 1 2 3 4 5 6 7). Missing are . and listwise = on.

Thank you so much
 Bengt O. Muthen posted on Thursday, June 07, 2018 - 5:45 pm
Send your full output to Support along with your license number.
 Bhuban Dhakal posted on Monday, March 25, 2019 - 1:30 pm
Dear Mplus support team

When I used the following R3STEP code to identify latent classes the Mplus reported the class variable on non-integer value [e.g. 1.000]. Can you please advise me problem in the following code?

Variable: Names are a0 y18-y25 sex race ageexp drug ;
Missing are . ;
USEVARIABLES = y18-y25 ;
Count = y18-y25 (nb);
Classes = c(3);
Auxiliary= a0 Sex (R3STEP) race (R3STEP) ageexp (R3STEP) drug(R3STEP);

Analysis: TYPE=MIXTURE; starts=100;

Model:
%Overall%
%c#1%
[y18-y25 *-1];

%c#2%
[y18-y25 *1];

%c#3%
[y18-y21 *-1];
[y23-y25 *1];


Savedata:
File is 3Stp192S5.dat;
save = cprobabilities;
 Bhuban Dhakal posted on Monday, March 25, 2019 - 2:22 pm
Further clarification on the above post:

When I used the Class variable output of 1st estimation step as input of 3rd estimation step, I got the following error message.

"*** ERROR
Nominal variable C contains non-integer values."

I opened the data file and found the classes were reported on non-integer values [e.g 2.000, 4.000).

Note:A typo error in the above post "[y23-y25 *1]"; It should be [y22-y25 *1];

Thanking in advance.
 Bengt O. Muthen posted on Monday, March 25, 2019 - 5:01 pm
Send to Support the outputs from the first and last step plus the data used in the last step along with your license number.
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: