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) summary(aov.out)
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.