# A question about quantile regression curves

I have a dataset something like this (y variable vs Age, please ignore the green lines)

I want to add the quantile regression curves (0.025,0.05,0.5,0.95,0.975) to my plot. The problem is that the nature of observations between 0 to 1 (birth to one year old age) is completely different from (one year to 18 years). Any idea regarding working with this data set to calculate the reference curves?

Your best bet might be to fit different quantile regressions for your two regimes, essentially treating your data as a mixture. For the part near zero, it looks like you may simply want straight quantiles, not a quantile regression per se, especially if there is really only very little happening in terms of the $x$ coordinate.
• lprq sounds like a good idea for "larger" ages. Or simply use a low-order spline transformation of age and feed it into rq. For "smaller" ages (and you will need to take a good look at where to set the cutoff; 1 doesn't seem very good), I don't think you want to do a regression as such - simply take quantiles. – Stephan Kolassa Jan 7 '18 at 16:33
• bs is a good choice. You may want to look into Frank Harrell's Regression Modeling Strategies, which has a good discussion of splines. Regarding the optimal choice of knots and their locations, Harrell's textbook has a few rules of thumb, or alternatively, you could look to cross validation. – Stephan Kolassa Jan 8 '18 at 15:31