# Finding a non-symmetric test for correlated random variables $A$ and $B$ where $B\ge A$

Let's say I randomly sample pairs of numbers, $$(A, B)$$, each within a range of 0 to 10. In every pair, $$B \ge A$$. If I were to graph these points, they would fill only the half of the square that lies above the bottom-left to top-right diagonal. If these points are uniformly distributed in the space and I test the correlation of these two variables, it will give a correlation coefficient of 0.5. However this does not adequately capture the structure of the data, which is that it is possible to be high in B without being high in A, but it is not possible to be high in A without being high in B. A hypothetical example of this relationship could be pairs of test scores and IQ scores. If all students perform at least as well as their IQ would indicate, but some students also perform much better, the data would demonstrate this relationship. What is the correct statistical test to show this?

My actual data demonstrates this property, although a small number of points also lie beneath but close to the diagonal. I have considered taking the number of points that lie above the bottom-left to top-right diagonal compared to those that lie below and demonstrating that there are many more points that lie above. I have also considered extending this notion to calculating the y-intercept of the line with slope = 1 that intersects each of the points, and showing the distribution of these y-intercepts is mostly positive or zero. Is there an existing name for this kind of test? Is there a better way to do this? I am specifically looking for a test that is not symmetric and will return a value with the opposite sign if I swap the order of the input variables.

Edit - This is some of my data, including a graph of the y-intercepts as described above:

These two variables correlate at 0.57, but clearly it is not a symmetrical correlation. I am trying to make an "All As are Bs but not all Bs are As" type argument with this data. I can say "well just look at it" but I am looking for something more rigorous. Is there no existing statistical test for this?

Edit 2 - The following data correlates at 0.66 but is more evenly distributed around the diagonal. I want a measurement that distinguishes these cases:

• What exactly are you trying to test? It's not clear to me from your description why "almost everything is above the $A=B$ line" isn't good enough. Commented Feb 5, 2023 at 1:56
• Or if you want to show that some values of $B$ are substantially higher than $A$ what is wrong with looking at a confidence interval for $\bar B - \bar A$ and seeing that $0$ is not in that interval? Commented Feb 5, 2023 at 2:06
• @jbowman I have added a data visualization an clarified why I am asking this question above. Commented Feb 5, 2023 at 2:39

Suppose you want to test against the null hypothesis that the points are above the $$A=B$$ line with a probability $$p$$, say equal to $$0.5$$. In that case, you are testing that the probability parameter of a $$\mathrm{Binomial}(N,p)$$ distribution equals $$0.5$$ ($$N$$ being the sample size.) With the number of points you have, you can use the Normal approximation to the distribution of the sample probability; more generally, if your null hypothesis is that the probability of a point being above the $$A=B$$ line equals $$p$$,
$$\hat{p} = {n_{above} \over N} \sim_{\mathrm{approx}} \mathrm{N}\left(\mu=p, \sigma=\sqrt{{p(1-p)\over N}}\right)$$
Your test statistic would be $$z=(\hat{p}-p) /\sigma$$, which has, approximately, a standard Normal distribution, and you would perform a one-sided test, since your alternative hypothesis is that $$p >$$ your assumed value, not that $$p \neq$$ your assumed value.