# Model percentiles without quantile regression

I have 5 variables predicting a total price for selling an item. I also want to be able to include interaction terms in the model. However, I want to sell the item at the 75th percentile in order to ensure my price is competitive.

I am under the impression that a regular simple linear regression model predicts the 100th percentile. How can I predict difference percentiles without using quantile regression? QR does not allow for interaction terms, and I need them in my model. Any help? I am using R if there's any advice for that program.

• I'd prefer to model this without the rq package since that is quantile regression. I want to find a way to model by using slr. – MEB Apr 23 '17 at 21:12
• If you want to predict percentiles, use quantile regression, period. Quantile regression is the regression for predicting percentiles. Linear regression does not predict percentiles. Quantile regression model can include interaction terms, if it does not in the software you use, chenge the software.... – Tim Apr 23 '17 at 21:16
• How can any method predict the 100th percentile? It could be infinity. – Michael R. Chernick Apr 23 '17 at 21:27
• @MichaelChernick See for example the German tank problem. – Kodiologist Apr 23 '17 at 21:30
• That problem has been brought up on this site before. I don't see what it has to do with estimating the 100th percentile with quantile regression or linear regression. – Michael R. Chernick Apr 23 '17 at 21:36

Linear regression does not predict the 100th percentile. Linear regression is more akin to predicting a mean, which doesn't translate into "percentiles".

And I just played around with the rq() function in R (in the quantreg package). It does indeed allow you to use interaction effects. Try something like:

m <- rq(y ~ x1 + x2 + x1:x2, tau = 0.75)

• I changed "simple linear regression" to just "linear regression" because the former term is specific to the special case where there's only one predictor. – Kodiologist Apr 23 '17 at 21:32
• Linear regression assumes that residuals are normally distributed - and under a normal distribution mean equals median. Then, or linear regression predictions translate into median or linear regression assumptions don't hold. – Pere Apr 23 '17 at 21:43
• @Pere actually normality assumption is needed only if you need confidence intervals, hypothesis tests, want to estimate regression using MLE rather then OLS etc. If you are simply minimizing the least squares to fit the regression line you do not need any normality assumption. – Tim Apr 23 '17 at 21:53

There's a good answer already but I wanted to mention some other possibilities.

If you're prepared to make a parametric assumption, any parametric model should let you get an approximate quantile.

For example, consider a GLM. At any combination of the predictors, you can calculate the conditional (fitted) distribution.

If you're doing out-of-sample prediction you can get an approximate predicted value -- though incorporating parameter estimation uncertainty is a bit more tricky, in cases where it's not tractable it can be done via approximation, such as treating the difference between the true parameters and the estimated parameters as if the asymptotic case applied (multivariate normal) and then simulating.

There's also bootstrapping approaches to obtaining quantiles for predictions in the cases where you don't want to make a parametric assumption. (The book by Davison & Hinkley Bootstrap methods and their application, has information on how to do bootstrapped prediction intervals. These days this would be regarded as a form of parametric bootstrap, though it's not necessarily to think of it that way)