pScore: Transform p-values to continuous scores

Description Usage Arguments See Also Examples

View source: R/pScore.R

Description

The function wraps other functions to map p values ranging on (0,1] to continuous scores ranging on R in a number of ways.

Usage

1
pScore(p, sign = 1, method = c("qnorm", "absLog10"))

Arguments

p

p-value between (0,1]

sign

Sign of the score, either positive (in case of positive numbers), negative (in case of negative numbers), or zero. In case a logical vector, TRUE is interpreted as positive and FALSE is interpreted as negative.

method

Currently available methods include qnorm and absLog10.

See Also

pAbsLog10Score, pQnormScore

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
testPvals <- c(0.001, 0.01, 0.05, 0.1, 0.5, 1)
pScore(testPvals, method="absLog10")
pScore(testPvals, method="qnorm")
testPvalSign <- rep(c(-1,1), 3)
pScore(testPvals, sign=testPvalSign, method="absLog10")
pScore(testPvals, sign=testPvalSign, method="qnorm")
testLog <- rep(c(TRUE, FALSE),3)
pScore(testPvals, testLog, method="absLog10")
pScore(testPvals, testLog, method="qnorm")

testPvals <- 10^seq(-5, 0, 0.05)
plot(pScore(testPvals, method="qnorm"),
     pScore(testPvals, method="absLog10"),
     xlab="pQnormScore", ylab="pAbsLog10Score"); abline(0,1, col="red", lty=2)

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.