0
$\begingroup$

I have a conceptual question.

I have a dataset with a categorical response variable (integers from 1 till 10) and numerical predictors (independent variables).

I want to be able to predict the value (rank, perhaps) from 1 to 10 depending on the values of predictors.

Logistic regression with a family = binomial will not work because the response variable is not binary.

I can think of several options:

  1. Convert response variable into a factor variable and run a linear regression

  2. keep response variable numeric but round the predictions to the nearest integer using linear regression

  3. Try to use multinom() but not sure if it changes anything relative to the approaches above.

What would you recommend for R?

$\endgroup$
4
  • 5
    $\begingroup$ If the integers are genuinely ranks then you need ordinal regression. If they are integer counts then you can use glm with family = poisson $\endgroup$ Mar 4, 2022 at 17:20
  • $\begingroup$ Seconding what Allan mentioned. If they are ranks, this package might be useful to you: cran.r-project.org/web/packages/ordinal/vignettes/… $\endgroup$
    – sjp
    Mar 4, 2022 at 17:40
  • $\begingroup$ Count me as another vote for ordinal regression. However, if you find yourself having multiple unordered categories (e.g., dog, cat, horse, alligator), the analogue of logistic regression is multinomial logistic regression, which uses a multinomial response variable instead of a binomial. $\endgroup$
    – Dave
    Mar 4, 2022 at 23:55
  • $\begingroup$ The response variable is an integer number on the scale from 1 to 10: 1 - the worst, 10 - the best. I call them ranks. Of course, it might be better to group 10 ranks into 3 groups: bad, medium, good. That might be advantageous if SVV, KNN or Trees are used. What do you think? $\endgroup$
    – Toly
    Mar 6, 2022 at 0:52

1 Answer 1

1
$\begingroup$

As pointed out in the comments, you need ordinal regression. Here's how you can fit it in R using the polr (proportional odds logistic regression) from the MASS library:

library(MASS)

ordinal_model <- polr(factor(rank_response_variable) ~ indep_var1 + indep_var2, data = data)

summary(ordinal_model)

The model output of cumulative logit models for ordinal responses can be a bit tricky to interpret so feel free to ask for more help in the comments if you need it.

$\endgroup$
2
  • $\begingroup$ Luz - The response variable is an integer number on the scale from 1 to 10: 1 - the worst, 10 - the best. I call them ranks. Of course, it might be better to group 10 ranks into 3 groups: bad, medium, good. That might be advantageous if SVV, KNN or Trees are used. What do you think? $\endgroup$
    – Toly
    Mar 6, 2022 at 0:52
  • $\begingroup$ @Toly I think you should use ordinal regression. By taking into account the ordering of the response categories you can have improved model parsimony and power. $\endgroup$
    – Adrià Luz
    Mar 7, 2022 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.