I have a dataset with around 5000 observations. I have an independent variable 'passed' which is number of tests passed. This variable ranges from 0 to 6, but only has 9 observations in category 6. I'm unsure if I should treat is as a factor or as a numerical variable.
Reasons for continuous:
- Plotting estimated mean log odds against 'passed' with 95% CIs gives a liner graph, apart from the last point. The last point has a huge CI (estimated by delta method which might not be applicable as only 9 observations) and is a bit higher than expected.
- If I treat it as continuous, my model ends up having a lower AIC.
Reasons for categorical
- I can group up the data from 5 and 6 tests passed to get rid of an issue with only 9 samples, so my plot with CIs is much more clean.
- The data only takes discrete values.
I understand that treating the data as categorical removes ordering, but wouldn't the order be reflected in the coefficients for the categorical variables? Moreover, my main aim is to interpret my model for my dataset, and not to predict for observations that have 'passed' > 6.