Recently, my colleague encountered a problem while working with a dataset, df_a
, which contains gene data. Each row represents a gene
(generally there are thousands, but for simplicity, let's assume there are 1,000
), and columns represent different samples that can be divided into two groups, A
and B
(50 samples for each group).
We utilized the t.test
to calculate the p-value for each row and performed a correction. Assuming we use p.adjust < 0.05
and we got 30
positive results.
This brings up a question: how can we ensure these 30 results are not generated by random events? (maybe the question is a question?)
We designed a process using permutation tests to address this question. The steps are:
(1) For df_a
, we randomly shuffled its columns labels, recalculated the p-value and p.adjust for each row, and counted the number of rows with p.adjust < 0.05
, denoted as Ki
.
(2) Repeat step 1 for 1,000
times to get K1, K2, K3, ..., K1000
.
(3) Count the number of Ki
that is greater than 30
, denoted as n
. Calculate n/1000
. If the value is less than 0.05, we consider that these 30 results are not generated by random events.
As a programmer, I realized that there seems to be a problem mathematically, but I can't provide a rigorous proof to my colleagues to correct it. I hope to get your help.
Update
What I want to update is, I think this permutation cannot provide meaningful additional information. Consider when you shuffle the column labels, for each row, it is equivalent to mixing groups A
and B
together, and then randomly drawing two groups A*
and B*
. Basic statistical principles tell us that there should be no difference between these two groups. Therefore, when you apply t.test
, all p.values < 0.05
are false positives, and the significant number is about 5%
. When you apply p.adjust
to these data (for example, using FDR), and again control p.adjust < 0.05, the Ki
here will be (always) very small (close to 0) that it is impossible to deny any results.
I'm not a mathematician, but it's easy to see this through program simulation. My point is when the number of permutations is finite (for example: 1000), the mathematical expectation of Ki
is a constant related to row
of data, and this value is very small
.
Please be sure to note the differences between our steps and the classic permutation test, they are very similar, but there are differences.
I don't know if this holds true in mathematics and how to prove it.