# How can I predict a continuous variable using only ordinal covariates? [duplicate]

I have a quite large data set (approximately 1500 individuals, with very few missing values). My goal would be to predict age (thus, a positive, continuous outcome) using approximately 10 ordinal variables representing biological/developmental indicators. Each ordinal variable has exactly 8 stages. What method would be best suited for such a question?

In particular:

• I think there are few methods that natively handle ordinal variables. So, should I treat the ordinal predictors as numerical, or as nominal?
• Is there some way of using simply a linear regression here? (Maybe in combination with some penalization method?)
• Ideally, I would like to get not only a point estimate of age, but also a prediction interval.

I've already tried random forests, which perform quite correctly, but I wonder about possibly better alternatives in this use case.

• Just noting that for linear regression, there is a compromise position between treating ordinal predictors as numerical (which is often inappropriate) and nominal (which can tend to overfitting). You can model these predictors as having monotonic effects. The R package brms has a software implementation: cran.r-project.org/web/packages/brms/vignettes/… Commented Oct 12, 2022 at 7:28
• @Lachlan: the key question is then whether we can assume that predictors have monotonic effects, or potentially U-shaped ones (I can think of quite a few attributes whose relationship to age is U-shaped). Do you know of anything that would allow that? Feeding the predictors in as numerics and using low order poly transforms, or splines, would do the trick - but require that pesky numericalness. That said, your comment looks like an answer, want to post it as such? Commented Oct 12, 2022 at 8:18
• @StephanKolassa: good point! We can safely assume that the predictors involved here have monotonic effects. And the other comment is indeed useful, thanks. Commented Oct 12, 2022 at 8:21
• @StephanKolassa Yes, agreed, monotonicity is not always a good functional form assumption for ordinal predictors (though obviously more flexible than an assumption of linearity). Given that the assumption is reasonable in this case, I'll expand this into a proper answer shortly. Commented Oct 12, 2022 at 8:29
• You can also use ordinal encoding, see stats.stackexchange.com/q/574761/60613 Commented Oct 12, 2022 at 9:40

Treating ordinal predictors as categorical/unordered can also be problematic for several reasons. Firstly, the information contained in the natural ordering of the predictor is lost. Secondly, because $$n - 1$$ coefficients are estimated for each predictor, where $$n$$ is the number of categories, the estimates can be noisy and the model prone to overfitting, especially when data are sparse within some categories.
In short, the method involves estimating a coefficient $$b$$, which expresses, similar to a typical regression coefficient, the expected average difference in the response variable between two adjacent categories of the ordinal predictor. In addition, a simplex vector $$\zeta$$ is estimated which describes the normalized distances between consecutive predictor categories, thus providing the shape of the monotonic effect.