Interaction term and sample selection

I have a dependent variable Y which is continuous. I want to study the impact of X on Y using OLS in a linear model, but I suspect the impact of X is more important for observations with a high value of Y compared to those with a low value of Y.

I could run a first regression using observations with Y values above the median of Y for instance, and another regression using observations with Y values below the median, but it would of course lead to a sample selection bias.

I suspect I would have the same bias if I were to interact X with a dummy equal to 1 for observations with a value of Y greater than the median of Y for instance. Is it true?

What are the solutions to study the effect of X on Y depending on the values of Y (i.e. high values of Y vs low values of Y). Are quantiles regressions the only solution?

• The problem with the first two approaches is that you really don't know what the true dividing line between "high" and "low" values of Y as far as the relationship between Y and X is concerned. You might think that divider is the median of Y, but what if it is the third quartile of the distribution of Y, say? At least quantile regression will enable you to look objectively at a pre-defined set of dividers. – Isabella Ghement Mar 4 '19 at 16:27
• Yes of course. But let's assume I know the dividing line, am I correct in saying that with the first two approaches I have a selection bias? Thanks a lot – user6441253 Mar 4 '19 at 16:43
• Can you explicitly define what you mean by selection bias in this context? – Isabella Ghement Mar 4 '19 at 16:46
• I mean running the regression using only specific observations, i.e. selecting specific observations. For instance, in the first approach, running two separate regressions, one for "high" values only, and one for "low" values only. If I remember correctly, the fact that we select observations using a threshold for the dependent variable creates a bias in the estimation. – user6441253 Mar 4 '19 at 16:49

Check out the package quantreg for formalized quantile regression approach. Using the function rq your are able to compute regression estimates at different quantiles of the outcome without dividing your sample.