# Linear regression or ordinal logistic regression to predict wine rating (from 0 and 10)

I have the wine data from here which consists of 11 numerical independent variables with a dependent rating associated with each entry with values between 0 and 10. This makes it a great dataset to use a regression model to investigate the relation between the variables and the associated rating. However, would linear regression be appropriate, or is it better to use multinomial/ordered logistic regression?

Logistic regression seems better given specific categories, i.e. not a continuous dependent variable but (1) there are 11 categories (a bit too many?) and (2) upon inspection, there's only data for 6-7 of those categories, i.e. the remaining 5-4 categories have no example in the dataset.

On the other hand, linear regression should linearly estimate a rating between 0-10 which seems closer to what I'm trying to find out; yet the dependent variable is not continuous in the dataset.

Which is the better approach? Note: I am using R for the analysis

• There is no business goal as this is actually for a university course. The task is to analyze a dataset of choice whichever way I see fit.
• The distribution of the ratings looks normal (histogram/qq-plot). The actual values in the dataset are between 3-8 (even though technically 0-10).

An ordered logit model is more appropriate as you have a dependent variable which is a ranking, 7 is better than 4 for instance. So there is a clear order.

This allows you to obtain a probability for each bin. There are few assumptions that you need to take into account. You can have a look here.

One of the assumptions underlying ordinal logistic (and ordinal probit) regression is that the relationship between each pair of outcome groups is the same. In other words, ordinal logistic regression assumes that the coefficients that describe the relationship between, say, the lowest versus all higher categories of the response variable are the same as those that describe the relationship between the next lowest category and all higher categories, etc. This is called the proportional odds assumption or the parallel regression assumption.

Some code:

library("MASS")
## fit ordered logit model and store results 'm'
m <- polr(Y ~ X1 + X2 + X3, data = dat, Hess=TRUE)

## view a summary of the model
summary(m)


You can have further explanations here, here,here or here.

Keep in mind that you will need to transform your coefficients to odds ratio and then to probabilities to have a clear interpretation in terms of probabilities.

In a straightforward (and simplistic manner) you can compute these by:

$exp(\beta_{i})=Odds Ratio$

$\frac{exp(\beta_{1})}{\sum exp(\beta_{i})} = Probability$

(Don't want to be too technical)

I would like to provide another view to the problem: In real world, it is less likely to encounter the this question, because what to do is depending on business needs.

The essential question in real world is what to do after getting the prediction?

• Suppose business wants to trash "low quality" wine. Then, we need some definition of "how bad is bad" (say quality below $2$). With the definition, binary logistic regression should be used, because the decision is binary. (trash or keep, there is nothing in middle).

• Suppose business wants to select some fine wine to send to three types restaurants. Then, multi-class classification will be needed.

In sum, I want to argue that what to do is really depending on the needs after getting the prediction, instead of just looking at the attribute of the response variable.

Although an ordered logit model (as detailed by @adrian1121) would be most appropriate in terms of model assumptions, I think multiple linear regression has some advantages as well.

1. Ease of interpretation. Linear models are easier to interpret than ordered logit models.
2. Stakeholder comfort. Users of the model may be more comfortable with linear regression because they are more likely to know what it is.
3. More parsimonious (simpler). The simpler model may perform just as well, see related topic.

The fact that most of the responses are between 3-8, suggests to me that a linear model may perform suitably for your needs. I'm not saying it's "better", but it may be a more practical approach.

In principle ordered logit model seems appropriate, but 10 (or even 7) categories is quite a lot.

1/ Eventually would it make sense to do some re-coding (e.g., ratings 1-4 would be merged into 1 single modality, say "low rating")?

2/ What is the distribution of the ratings? If pretty well normally distributed, then a linear regression would do a good job (see linear probability model).

3/ Otherwise I would go for something completely different called "beta regression" - A 11-points rating scale is something pretty detailed compared to classical 5-points scale - I think it would be acceptable to consider the rating scale as an "intensity" scale where 0 = Null and 1 = Full/Perfect - By doing this you would basically assume that your scale is interval type (rather than ordinal one), but to me it sounds acceptable.

• Why are 10 (or 7) categories a lot? Is there some fundamental technical reason why 10 categories will not behave appropriately in an ordered logit model, or are you speaking from a purely practical perspective? (e.g. similar considerations to the answer hxd1011 gave.) – R.M. May 25 '17 at 22:32
• No there is no technical reason as long as the data allow estimating an ordered logit (OL) with "so many" categories. However specifying an OL model with 11 categories implies estimating 10 "constant" terms (i.e., threshold parameters) - It sounds a lot to me, especially if some categories are not well represented in the database - My gut feeling is that an OL model for 11 categories is a bit over-killed, I would either treat the ratings as continuous variables or collapse some modalities to specify a more parsimonious (and perhaps more meaningful) OL model. – Umka May 25 '17 at 22:54

I am not a specialist of logistic regression, but I would say that you want to use multinomial because of your discrete dependent variable.

A linear regression could output coefficients that can be extrapolated out of the possible boundaries of your dependent variable (i.e an increase of independent variable would lead to a dependent variable out of your boundary for the given regression coefficient).

The multinomial regression will gives the different probabilities for the differents outcomes of your dependent variable (i.e the coefficient of your regression will give you how they increase their probability to give a better score, without the score beeing out of bounds).

• Multinomial is good for multiple unordered categories. Ordinal logistic (what OP proposes in the question) is good for multiple ordered categories. – Gregor May 25 '17 at 23:22

Another possibility is to use a Random Forest. There are two ways to measure the "importance" of a variable under a Random Forest:

1. Permutation: the importance of input variable $X_j$ is proportional to the average increase in error rate cause by randomly shuffling that variable. Randomly shuffling $X_j$ destroys the relationship between $X_j$ and $Y$, as well as all the other $X$s.
2. Node impurity: the importance of input variable $X_j$ is proportional to the total decrease in node impurity due to splitting on $X_j$ across all trees.

Random Forests are also amenable to a type of data visualization called a "partial dependence plot". See this in-depth tutorial for more detail.

Partial dependence and permutation importance are not specific to Random Forest models, but their popularity grew along with the popularity of Random Forests because of how efficient it is to compute them for Random Forest models.

• I know it's a somewhat tangential answer, but I'd like to know why this was downvoted. Is it incorrect? – shadowtalker May 31 '17 at 1:24