Question: RegioneR library in R
0
gravatar for panacotaforcota
7 weeks ago by
Russia
panacotaforcota0 wrote:

Hello!

I try to use regioneR library in R for permutation test. I get result, where z-score is equal to 79 or -90 and p-value is equal to 0.002 for both z-scores. Number of permutations is 500. I don't understand how those z-score and p-value are calculated.

Thanks!

permutation test R • 131 views
ADD COMMENTlink modified 7 weeks ago by ATpoint34k • written 7 weeks ago by panacotaforcota0

Did you check their publication?

regioneR: an R/Bioconductor package for the association analysis of genomic regions based on permutation tests

ADD REPLYlink written 7 weeks ago by venu6.6k

Yes, and there are no explanation why for different z-score there are the same p-value.

ADD REPLYlink modified 7 weeks ago • written 7 weeks ago by panacotaforcota0

They are not the same z-score.

ADD REPLYlink written 7 weeks ago by Kevin Blighe60k
0
gravatar for ATpoint
7 weeks ago by
ATpoint34k
Germany
ATpoint34k wrote:

These are bootstraping p-values. The second formula on this page here gives a reference where this comes from.

From the source code of the regioneR package (permTest function) they implement it as:

pval <- (sum(orig.ev >= rand.ev, na.rm = TRUE) + 1) / (num.valid.values + 1)

So the p-value, here testing that the overlap (or whatever you test) is greater for the observed events compared to the randomly-permutated events, is the number of times that the observed event is larger or equal divided by the number of permutations.

The Z-score is the deviation of the observed events by the mean of the permutated events (corrected for standard deviation) so basically a significant event should have a large Z-score since the observed event should be quite different from the mean of the random events.

zscore <- round((orig.ev - mean(rand.ev, na.rm = TRUE))/stats::sd(rand.ev,  na.rm = TRUE), 4)
ADD COMMENTlink written 7 weeks ago by ATpoint34k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1260 users visited in the last hour