# Linear Regression on sorted Dependent variable [duplicate]

This question may sound silly. Can we sort the dependent variable Y of a dataset and apply Linear Regression on it. What I think is, it introduces Bias on the model and it will perform poorly on unseen data. Please correct me if I'm wrong. What are all the other reasons on why we should not do it. Explain with an example.

Example: Matching $x_1, x_2, \ldots, x_n$ with $y_{(1)}, y_{(2)},\ldots, y_{(n)}$(sorted asc) where $y_{(j)}$ is the $jth$ smallest value of $y_1,\ldots, y_n$.

## marked as duplicate by Peter Flom - Reinstate Monica♦ regression StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 25 '17 at 10:43

• I thought it might be useful, even so. I think if you edit the question to make it clear that you're thinking of matching $x_1, x_2, \ldots, x_n$ with $y_{(1)}, y_{(2)},\ldots, y_{(n)}$, where $y_{(j)}$ is the $j$th smallest value of $y_1,\ldots, y_n$ it'll be quickly re-opened. It'd also help to explain how the values of the independent variable $x$ arise - fixed according to some scheme or other, or as a sample from a joint distribution with $Y$. – Scortchi - Reinstate Monica Jul 25 '17 at 16:39