ANOVA (Error in Levels (x) [x]: Only 0's may be mixed w/ neg. subscripts)

I keep receiving the following error when attempting to perform the ANOVA test on 1 continuous and 1 categorical variable in a very large dataset (n= greater than 50,000). The independent variable is drop in insulin level (4 levels) and the dependent variable is number of medications prescribed.

Error in levels(x)[x] : only 0's may be mixed with negative subscripts

I used the following command:

aov.out = aov(num_medications ~ insulin, data=diabetic_data)

Can any of you tell me why this is happening? As far as I'm concerned, there are no negative values in this data set.

Thank you

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.