# Test whether (x,y) of one set of data points is significantly greater than the (x,y) of another set of data points

What's the most suitable statistical test for testing whether the distribution of the (x,y) coordinates of the blue points is significantly different from the distribution of the (x,y) coordinates of the red points. I'd also want to know the directionality of this difference. The colored data points are those data points with labels with the label for blue being distinct from the label for red. White data points are just unlabeled, so could very well be ignored.

-
I don't know if this means you are satisfied with my answer to the nonlinear association question and therefore are searching for an example that doesn't have an existing method. – Michael Chernick Sep 8 '12 at 0:14
I don't really understnad your question. What do you mean by significantly greater? Are you trying to get at a test for a data set having a stronger correlation than another? What is the reason for the white dots? Are they just there to obscure the pattern? – Michael Chernick Sep 8 '12 at 0:17
It looks to me like the red dots form a pattern similar to the parabolic shape in your previous post but not with a single location to separate monotonic pieces and the blue look sort of linear with a little scatter from a line. – Michael Chernick Sep 8 '12 at 0:19
@MichaelChernick this question is independent of my previous post although that doesn't discount the possibility of overlap in answers. – user1447630 Sep 8 '12 at 11:47

A typical way to test if two one-dimensional distribution functions are different is with the Kolmogorov-Smirnov test which is based on the statistic:

\begin{align*} \underset{x}{\operatorname{sup}}\:|F_1(x) - F_2(x)| \end{align*}

The problem is that in higher dimensions there are $2^d-1$ ways to define a distribution function. There are a number of papers on higher dimensional KS tests. Below is a link for one that discusses some efficient methods carrying out such a test.

Two-Dimensional KS Test

-
Is there some way of implementing a 2D KS test (any variation) in R? Package? – user1447630 Sep 9 '12 at 17:42
One popular implementation is based on Fasano, Franceschini (1987) this site contains the references and some matlab code subcortex.net/research/code/…. I don't know of any implementations in R. – muratoa Sep 9 '12 at 20:40

Given the small sample size in your graph, the Wilcoxon rank-sum test seems appropriate to compare the y values in the red and blue groups.

-
The OP is not comparing the distributions of two one-dimensional variables. He is comparing two curves based on two-dimensional points. That is why I find the term "significantly greater" unclear. – Michael Chernick Sep 8 '12 at 5:16
Also from the context of previous post I think he is referring to measures of correlation and he want to know which data set exhibits the highest correlation in some "nonlinear sense". – Michael Chernick Sep 8 '12 at 5:29
@MichaelChernick that's correct. I want to compare two curves based on two-dimensional points. However, I've rephrased my question to reflect the fact that basically I want to know whether the distribution of the (x,y) coordinates of the blue points is significantly different from the distribution of the (x,y) coordinates of the red points. I'd also want to know the directionality of this difference. – user1447630 Sep 8 '12 at 11:44
@user1447630 My comments were directed toward RobertF who in answering your question interpreted "significantly greater" to mean numerically higher in aone-dimensional sense when you acyually meant something different. – Michael Chernick Sep 8 '12 at 12:01