Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Quantile regression: determine to which quantile an individual belongs

From   Alex Olssen <>
Subject   Re: st: Quantile regression: determine to which quantile an individual belongs
Date   Thu, 18 Apr 2013 21:38:59 +1000

Thanks for the link; I knew that the binary representation for 0.01 was non-terminating, but I didn't know of this faq.

On 18/04/13 9:25 PM, Nick Cox wrote:
We agree on the main point.

But -round(whatever, 0.01)- is not an especially good idea because
most multiples of 0.01 can not be held exactly in binary and people
who don't understand that get into awkward small messes.

A more systematic approach is explained at

FAQ     . . . . . . . . . . Calculating percentile ranks or plotting positions
         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
         7/02    How can I calculate percentile ranks?
                 How can I calculate plotting positions?


On 18 April 2013 12:20, Alex Olssen <> wrote:
I also am unclear on what you wish to achieve.  You said that you wanted to
know the quantile of each person's residual.  I can suggest a way to
calculate this, but I am unsure why you want it.

sysuse auto, clear
reg price length
predict res, res
sort res
gen quantile = round(_n/_N, 0.01)

On 18/04/13 9:12 PM, Nick Cox wrote:

I can't see that "the quantile each individual belongs to" is a
well-defined concept.

Clearly you  can work out a percentile rank for each response, without
regard to the predictors. Or you can see where individual residuals
lie in the distribution of residuals.

But I don't think that either is what you are seeking.

I am not clear whether you are thinking of a point or an interval, but
that's secondary.

Stripping it down to a minimal example: We have a quantile regression
for weight versus height. I am a data point with a certain weight and
height. What quantile do I belong to? What's your definition?
On 18 April 2013 11:50, Maria Juul Hansen <> wrote:

Thank you for your comment and reference!
I am aware of the endogeneity problem. However, the purpose is not to
establish causal effects, just to control for the variables of interest.

Do you have any recommendations regarding the problem of identifying the
quantiles each individual belongs to?
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index