0

I have a vector as below , I like to convert q-value to p-value (estimate p-value base on q-value).

data<-c(0.35,0.52,0.12,0.46)

I used below code for converting but I am not sure about it:(I take this code from here "https://stats.stackexchange.com/questions/51070/how-can-i-convert-a-q-value-distribution-to-a-p-value-distribution")

qvalues<-as.numeric(as.character(data))

convert.qval.pval = function(qvalues) {
    pi0 = max(qvalues)
    m0 = length(qvalues) * pi0
    return(qvalues * rank(qvalues) / m0)
}

qval_pval <- convert.qval.pval(qvalues)
qval_pval
[1] 0.33653846 1.00000000 0.05769231 0.66346154

Also, I like use "q-value" R package and but for this package I have to have a simulated or data-resampled (e.g., bootstrap, permutation) "null statistics", but I do not know how can I make it.

Code for converting using Q_value:

stat <- data
stat0 <- "creat using bootstar" ?!!!
p.testspecific <- empPvals(stat=state, stat0=stat0, pool=FALSE)
Community
  • 1
  • 1
star
  • 743
  • 1
  • 7
  • 19
  • 1
    What did you try? Why did it not work? If you had only one q-value, how would you convert it to a p-value? – Heroka Feb 26 '16 at 11:36
  • 1
    possible [duplicate](http://stats.stackexchange.com/questions/51070/how-can-i-convert-a-q-value-distribution-to-a-p-value-distribution) ? – Sotos Feb 26 '16 at 11:37
  • 1
    you would have more chance on Cross Validated, which is dedicated to statistics and data. Your problem is not much of a programming issue – Mathieu B Feb 26 '16 at 11:54

0 Answers0