# How to test that a set of distributions are located in a given order?

I have a set of population distributions; I obtained them empirically, computing histograms from very large populations (about 1 million per distribution). The population distributions might not have the same shape. The populations are all continuous or all discrete.

I want to test if the distributions are located according to a certain order.

More formally, let $D_i,\ldots,D_k$ be our populations, ordered according to a given criteria. We want to test if their distributions (probability density function) $f_i, \ldots, f_k$ are located according to the order.

I temporarily formulated the problem as testing that $f_i$ is shifted to the left of $f_j$, for each pair of populations $(D_i,D_j)$ with $i <j$,

So far, I performed a Wilcoxon rank-sum test for each pair of populations; using the version for large samples and the correction for ties, I performed the test on the population distributions. However, my distributions do not have the same shape.

I am wondering weather there is a better way to check the orders of distributions.

• If the distributions might not have the same shape, I'm having trouble figuring out what "order" means. It made sense in the context of one being a "shift" of another but outside of that, I'm confused. Jun 19, 2012 at 12:49
• @Macro, Igor's definition makes sense even when the distributions have different shapes. His concern about using the Wilcoxon test is valid: although it tests exactly this kind of ordering, it assumes the distributions are merely location-shifted. What I wonder is whether there is any issue here at all: the question says that the $f_i$ are population distributions, not sample distributions, so it appears that no inference is necessary and all one has to do is compute the relevant probabilities. Igor, is this the case, or do you actually have (large) samples of the populations?
– whuber
Jun 19, 2012 at 13:10
• Yes, Igor, except (perhaps because I don't know what your $f_i$ mean) that integral formula does not look right to me. A brute-force calculation to compare a dataset $(x_i)$ to another dataset $(y_j)$ would count all pairs $(i,j)$ where $x_i\lt y_j$, add half the count where $x_i=y_j$, and divide by the total number of pairs. An efficient way to do this comes down to manipulation of rank sums within the combined dataset: in effect, the Wilcoxon test statistic already tells you what you need to know.
– whuber
Jun 19, 2012 at 14:57
• Comparing/ranking variables using the stress-strength coefficient $P(X<Y)$ might not be a good choice. This has been discussed in terms of the Pitman closeness because this method leads to paradoxes and might not be transitive.
– user10525
Jun 20, 2012 at 12:41
• Do you want to test for stochastic ordering, specifically, first order stochastic ordering: $X \leq_{st} Y$ if $P(x\geq u) \leq P(y\geq u) \forall u \in(-\infty,\infty)$? Jun 20, 2012 at 22:44

That is, where the Kruskal-Wallis tests against a general alternative "at least one $\neq$", J-T tests against a specified order ($\theta_1 \leq \theta_2 \leq \ldots \leq \theta_k$), with "at least one $<$".
The test statistic basically consists of counting all the times the pairs of values (across groups) are in the anticipated order (the order specified in $H_1$), minus the times that pairs are "in the opposite order", though there are other, equivalent calculations (any calculation that yields a statistic with the same partial order will be equivalent).