Date: Jan 27, 2013 8:08 PM
Author: Ray Koopman
Subject: Re: two-sample nonparametric test on quantiles
On Jan 27, 2:19 am, Anonymous wrote:

> Hello,

> I have two random samples (each of them i.i.d. with continuous

> distribution) and I need to test, whether they come from

> distributions which have the same 100p% quantile (for p=5%).

> What I need is some generalisation of two-sample Mann-Whitney

> test on equality of medians.

>

> I would also need to have non-parametric confidence intervals

> for empirical quantiles of some sort.

>

> I intuitively understand, that I would need to have quite large

> samples for p close to zero to reject the null (q1=q2) hypothesis.

>

> Any reference to literature and/or software implementation that

> would solve these problems would be appreciated.

Let x_1,...,x_m and y_1,...,y_n be the two sets of observations.

Unless you make some assumptions about the forms of their true

distributions, you have no basis for distinguishing among values

that lie between successive order statistics of the pooled data.

Let Z refer to the set of midpoints of the intervals between

successive order statistics of the pooled data.

Now suppose you want test the hypothesis that some particular value

z is the q'th quantile of both the X and Y parent distributions.

(Note that you must specify both z and q.) Compute

t[z,q] = (n*(#{x < z} - m*q)^2 + m*(#{y < z} - n*q)^2)/(m*n*q*(1-q)).

If the hypothesis is true and if min{m,n}*min{q,1-q} is "sufficiently

large" -- say >= 5, certainly >= 1 -- then t should be distributed

approximately as chi-square with 2 df.

To get a 100p% CI for the q'th quantile, find the subset of Z for

which t[z,q] < the p'th quantile of the chi-square(2) distribution.

(The subset may be empty if the sample x and y distributions are

very different from one another.)