# Quantile regression versus OLS with dummies

I want to regress a variable Y on another variable X (with appropriate control variables and fixed effects) in a panel data setting. Two approaches come to mind:

1. Use quantile regression;

2. Use OLS regression to regress Y on the quartiles of X by using interaction terms, that is, multiplying X by an indicator variable that takes value 1 if the observation belongs to a certain quartile. So basically we would have y = intercept + D0.5*X + D0.75*X + D1.0*X + controls, where D0.5 is the indicator variable for the second quartile, D0.75 is the indicator variable for the third quartile, and so on.

What is the difference between the two approaches and in which cases would one be more appropriate than the other?

1. I am trying to see how X impacts Y for given quartiles of X. I expect that the impact of X on Y varies significantly across the quartiles of X. This is basically the hypothesis.

2. The observations are country-years. I expect X to only have an important impact on Y for high values of X (and for another variable, say X',I expect the opposite to hold). The idea is to check this hypothesis. What would you recommend?

3. Maybe it helps if I am more specific. X is an input factor in a country-year (hence panel data specification) and X' is another input factor. One theory suggests that X and X' should both have a statistically significant and positive impact on Y (dependent variable). Another suggests that X should have negative impact (becoming more negative for larger values of Y) and that X' should have a positive impact and larger as Y increases. The idea is to see how both these variables affect Y along the quantiles of Y and to test both theories. Both theories support that the direction of causality is from X to Y and not from Y to X.

• What ate you trying to do? Why do you want this? – Repmat Dec 30 '15 at 16:56
• OLS with a piecewise linear spline does not have more in common with quantile regression (qr) than OLS without splines. Both methods are not fit for panel data though. – Michael M Dec 30 '15 at 17:02
• You are creating a model with option 2) that is guaranteed not to fit the data, because there will be unexplained heterogeneity in $Y$ within quartiles of $X$. Binning of continuous variables is almost never a good idea. I'm not clear on why option 1) wasn't OLS with no binning. Note that if you want to take care of interactions between two continuous predictors, study tensor splines. – Frank Harrell Dec 30 '15 at 17:13
• Please register & merge your accounts (you can find information on how to do this in the My Account section of our help center), then you will be able to edit & comment on your own question. – gung - Reinstate Monica Dec 30 '15 at 17:22
• @Frank: The dummies seem to be derived from $X$ and then multiplied with $X$ to get something like a linear spline. So no information loss compared to using $X$ alone. – Michael M Dec 30 '15 at 18:46