Transform p-values to continuous scores with the quantile function of the normal distribution
Source:R/pScore.R
pQnormScore.RdQuantile function, also known as the inverse of cumulative distribution function of the normal
distribution, is used to map p-values to continuous scores raging on \(R\). The signs of the
resulting scores are positive by default and are determined by the parameter sign.
Arguments
- p
p-value(s) between \((0,1]\)
- sign
Signs of the scores, either positive (in case of positive numbers), negative (in case of negative numbers), or zero. In case of a logical vector,
TRUEis interpreted as positive andFALSEis interpreted as negative.- replaceZero
Logical, whether to replace zero p-values with the minimal double value specified by the machine. Default is
TRUE. If set toFALSE, results will contain infinite values.
Examples
testPvals <- c(0.001, 0.01, 0.05, 0.1, 0.5, 1)
pQnormScore(testPvals)
#> [1] 3.2905267 2.5758293 1.9599640 1.6448536 0.6744898 0.0000000
testPvalSign <- rep(c(-1,1), 3)
pQnormScore(testPvals, sign=testPvalSign)
#> [1] -3.2905267 2.5758293 -1.9599640 1.6448536 -0.6744898 0.0000000
testLog <- rep(c(TRUE, FALSE),3)
pQnormScore(testPvals, testLog)
#> [1] 3.2905267 -2.5758293 1.9599640 -1.6448536 0.6744898 0.0000000