# Linear regression when Y is bounded and discrete

The question is straightforward: Is it appropriate to use linear regression when Y is bounded and discrete (e.g. the test score 1~100, some pre-defined ranking 1~17)? In this case, is it "not good" to use linear regression, or it's totally wrong to use it?

When a response or outcome $$Y$$ is bounded, various questions arise in fitting a model, including the following:

1. Any model that could predict values for the response outside those bounds is in principle dubious. Hence a linear model might be problematic as there are no bounds on $$\hat Y = Xb$$ for predictors $$X$$ and coefficients $$b$$ whenever the $$X$$ are themselves unbounded in one or both directions. However, the relationship might be weak enough for this not to bite and/or predictions might well remain within bounds over the observed or plausible range of the predictors. At one extreme, if the response is some mean $$+$$ noise it hardly matters which model one fits.

2. As the response can't exceed its bounds, a nonlinear relationship is often more plausible with predicted responses tailing off to approach bounds asymptotically. Sigmoid curves or surfaces such as those predicted by logit or probit models are attractive in this regard and are now not difficult to fit. A response such as literacy (or fraction adopting any new idea) often shows such a sigmoid curve in time and plausibly with almost any other predictor.

3. A bounded response can't have the variance properties expected in plain or vanilla regression. Necessarily as the mean response approaches lower and upper bounds, the variance always approaches zero.

A model should be chosen according to what works and knowledge of the underlying generating process. Whether the client or audience knows about particular model families may also guide practice.

Note that I am deliberately avoiding blanket judgments such as good/not good, appropriate/not appropriate, right/wrong. All models are approximations at best and which approximation appeals, or is good enough for a project, isn't so easy to predict. I typically favour logit models as first choice for bounded responses myself, but even that preference is based partly on habit (e.g. my avoiding probit models for no very good reason) and partly on where I will report results, usually to readerships that are, or should be, statistically well informed.

Your examples of discrete scales are for scores 1-100 (in assignments I mark, 0 is certainly possible!) or rankings 1-17. For scales like that, I would usually think of fitting continuous models to responses scaled to [0, 1]. There are, however, practitioners of ordinal regression models who would happily fit such models to scales with a fairly large number of discrete values. I am happy if they reply if they are so minded.

I work in health services research. We collect patient-reported outcomes, e.g. physical function or depressive symptoms, and they are frequently scored in the format you mentioned: a 0 to N scale generated by summing up all the individual questions in the scale.

The vast majority of the literature I've reviewed has just used a linear model (or a hierarchical linear model if the data stem from repeat observations). I've yet to see anyone use @NickCox's suggestion for a (fractional) logit model, although it is a perfectly plausible model.

Item response theory strikes me as another plausible statistical model to apply. This is where you assume some latent trait $$\theta$$ causes responses to the questions using a logistic or ordered logistic model. That inherently handles the issues of boundedness and possible non-linearity that Nick raised.

The graph below stems from my forthcoming dissertation work. This is where I fit a linear model (red) to a depressive symptom question score that's been converted to Z-scores, and an (explanatory) IRT model in blue to the same questions. Basically, the coefficients for both model are on the same scale (i.e. in standard deviations). There's actually a fair bit of agreement in the size of the coefficients. As Nick alluded to, all models are wrong. But the linear model may not be too wrong to use. That said, a fundamental assumption of almost all current IRT models is that the trait in question is bipolar, i.e. its support is $$-\infty$$ to $$\infty$$. That's probably not true of depressive symptoms. Models for unipolar latent traits are still under development, and standard software can't fit them. A lot of the traits in health services research that we're interested in are likely to be unipolar, e.g. depressive symptoms, other aspects of psychopathology, patient satisfaction. So the IRT model may also be wrong as well.

(Note: the model above was fit usint Phil Chalmers' mirt package in R. Graph produced using ggplot2 and ggthemes. Color scheme draws from the Stata default color scheme.)

• Just because linear models are widely used, does not mean they are appropriate. Many people use linear models because that is only what they know or are comfortable with.
– qwr
Mar 5, 2019 at 5:46
• The medical literature is especially rife with poor practice that's propagated by "this is what this field/journal does" type ideaology. As a general rule, I would not use or fail to use something just because of it's appearance, however common, in medical research.
– LSC
Mar 5, 2019 at 11:38

Take a look at the predicted values and check if they have roughly the same distribution as the original Ys. If this is the case, linear regression is probably fine. and you will gain little by improving your model.

A linear regression may "adequately" describe such data, but it's unlikely. Many assumptions of linear regression tend to be violated in this type of data to such a degree that linear regression becomes ill-advised. I'll just choose a few assumptions as examples,

1. Normality - Even ignoring the discreteness of such data, such data tends to exhibit extreme violations of normality because the distributions are "cut off" by the bounds.
2. Homoscedasticity - This type of data tends to violate homoscedasticity. Variances tend to be larger when the actual mean is towards the center of the range, as compared to the edges.
3. Linearity - Since the range of Y is bounded, the assumption is automatically violated.

The violations of these assumptions are mitigated if the data tends to fall around the center of the range, away from the edges. But really, linear regression is not the optimal tool for this kind of data. Much better alternatives might be binomial regression, or poisson regression.

• It's hard to see that Poisson regression is a candidate for doubly bounded responses. Mar 4, 2019 at 17:20

use a cdf (cumulative distribution function from statistics). if your model is y=xb+e, then change it to y=cdf(xb+e). You will need to rescale your dependent variable data to fall between 0 and 1. If it's positive numbers, divide by them max, and take your model predictions and multiply by the same number. Then go check the fit and see if the bounded predictions improve things.

You probably want to use a canned algorithm to take care of the statistics for you.

• This seems to confuse two facts: (1) bounded responses should be scaled to between 0 and 1 for logit, probit and similar models to apply (2) cdfs also vary between 0 and 1. In treating a fractional response as such, you aren't modelling its cdf. Mar 5, 2019 at 13:08

If the response only takes a few categories, you may be able to use classification methods or ordinal regression if your response variable is ordinal.

Plain linear regression will neither give you discrete categories nor bounded response variables. The latter can be fixed by using a logit model like in logistic regression. For something like a test score with 100 categories 1-100, you might as well simplify your prediction and use a bounded response variable.