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:
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.
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.
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
ggthemes. Color scheme draws from the Stata default color scheme.)
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,
- 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.
- 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.
- 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.
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.
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.