# Testing a hypothesis involving ranks with an unequality in the null hypothesis

Here's a toy example of the problem I'm dealing with

I have gene expression data from two patients' multiple tissues

    p1t1    p2t1    p1t2    p2t2 ...
g1  24.1    54.1    42.4    81.2
g2  52.5    62.5    2.1     8.3
g3  90.6    81.4    10.9    40.1
g4  2.3     32.1    83.3    1.4


Where pitj refers to sample tissue j from patient i. And the rows g1...g4 refer to genes measurements in each sample. I want to determine if the corresponding tissues from each patient have similar gene expression patterns. Now, because of different experimental protocols, the values in column p1tj will be different than the values in column p2tj. So to account for this, I'd like to instead compare the ranks of the genes in p1tj to p2tj. If the ranks of the genes are similar between the two, then I might be able to reasonably say that they have similar expression patterns. For example, t1 seems to have similar expression pattern in both patients, even though the magnitude and relative differences between the genes in each column are different. The ranks are the same. For tissue 2, the ranks are different. And though the magnitude of the genes are similar, I would consider these two samples to not have similar expression.

So I'd like to take the above matrix and calculate the ranks of each gene in each column

    p1t1    p2t1    p1t2    p2t2 ...
g1  2       2       3       4
g2  3       3       1       2
g3  4       4       2       3
g4  1       1       4       1


Here, it's more obvious that the first two columns (which correspond to the same tissue in the patients) have the same ranks. And the 3rd and 4th columns (corresponding to the same tissues in the patients) have different ranks. So I want to be able to say that t1 is the same in both patients, and tissue 2 is different.

This seems like a hypothesis test. But what would the null and alternative hypotheses be?

• Null: The two two tissues are different
• Alternative: The two tissues are the same

Is this right? Because this would correspond to there being a $$\neq$$ in the null hypothesis, which I don't think I've ever seen. Also, how would I calculate the p-value for such a hypothesis test?

This seems like a Mann-Whitney test, but there, the null is usually that the two groups are the same (i.e. the revers of my null and alternative hypotheses). The reason I chose my null this way, is because I want the test to provide sufficient evidence against them being different, so I can reasonably say they are the same. I guess this is opposite to the usual use case for the test (where you usually want evidence against the two groups being the same, like in treatment groups). So is there some way to tweak the Mann-Whitney test? Or is there another type of test I can do where the null hypothesis can contain a $$\neq$$?

I really appreciate the help here. Thank you

• It sounds like what you want to do is equivalence testing. – Dave Apr 11 at 3:49
• Specifically, it sounds like you want to conduct something like a repeated measures ANOVA equivalence test on ranked data (something like an equivalence test variation of the Friedman test. I do not know of such a beast, but the 1st few hits say some folks have been thinking about the parametric version of such a test. Perhaps you could apply one of these methods to ranked data. – Alexis Apr 11 at 5:14
• Incidentally, here is a very brief orientation to a simple form of equivalence tests as @Dave mentioned. Instead of posing $\text{H}_{0}: \theta_1 \ne \theta_2$, you pose $\text{H}_{0}: |\theta_1 - \theta_2| \ge \Delta$, and if you reject, then $-\Delta < \theta_{1} - \theta_2 <\Delta$. Where $\Delta$ is a priori the smallest difference (i.e. the smallest effect size) that you think matters (e.g., $\Delta=$1 case of disease per 100,000 per year). So you null is that a difference at least $\Delta$ big exists. – Alexis Apr 11 at 5:15
• @Alexis Thank you for this. I do indeed need some rank-based test so TOST won't work. I will continue looking into it. But if anything comes to mind, I'd appreciate it if you could let me know. – The_Questioner Apr 11 at 7:53
• Thanks @Dave. Equivalence testing is indeed what I need. I didn't know that was a thing. – The_Questioner Apr 11 at 7:54