rowpAUCs-methods | R Documentation |
Methods for fast rowwise computation of ROC curves and
(partial) area under the curve (pAUC) using the simple classification
rule x > theta
, where theta
is a value in the range of
x
rowpAUCs(x, fac, p=0.1, flip=TRUE, caseNames=c("1", "2"))
x |
|
fac |
A |
p |
Numeric |
flip |
Logical. If |
caseNames |
The class names that are used when plotting the
data. If |
Rowwise calculation of Receiver Operating Characteristic (ROC) curves
and the corresponding partial area under the curve (pAUC) for a given
data matrix or ExpressionSet
. The function is implemented in C
and thus reasonably fast and memory efficient. Cutpoints (theta
are calculated before the first, in between and after the last data
value. By default, both classification rules x > theta
and
x < theta
are tested and the (partial) area under the curve of
the better one of the two is returned. This is only valid for
symmetric cases, where the classification is independent of the
magnitude of x
(e.g., both over- and under-expression of
different genes in the same class). For unsymmetric cases in which
you expect x to be consistently higher/lower in of of the two classes
(e.g. presence or absence of a single biomarker) set flip=FALSE
or use the functionality provided in the ROC
package. For
better control over the classification (i.e., the choice of "Disease"
and "Control" class in the sense of the Pepe et al paper), argument
fac
can be an integer in [0,1]
where 1 indicates
"Disease" and 0 indicates "Control".
An object of class rowROC
with the
calculated specificities and sensitivities for each row and the
corresponding pAUCs and AUCs values. See
rowROC
for details.
Methods exist for rowPAUCs
:
signature(x="matrix", fac="factor")
signature(x="matrix", fac="numeric")
signature(x="ExpressionSet")
signature(x="ExpressionSet", fac="character")
Florian Hahne <fhahne@fhcrc.org>
Pepe MS, Longton G, Anderson GL, Schummer M.: Selecting differentially expressed genes from microarray experiments. Biometrics. 2003 Mar;59(1):133-42.
rocdemo.sca,
pAUC, rowROC
library(Biobase)
data(sample.ExpressionSet)
r1 = rowttests(sample.ExpressionSet, "sex")
r2 = rowpAUCs(sample.ExpressionSet, "sex", p=0.1)
plot(area(r2, total=TRUE), r1$statistic, pch=16)
sel <- which(area(r2, total=TRUE) > 0.7)
plot(r2[sel])
## this compares performance and output of rowpAUCs to function pAUC in
## package ROC
if(require(ROC)){
## performance
myRule = function(x)
pAUC(rocdemo.sca(truth = as.integer(sample.ExpressionSet$sex)-1 ,
data = x, rule = dxrule.sca), t0 = 0.1)
nGenes = 200
cat("computation time for ", nGenes, "genes:\n")
cat("function pAUC: ")
print(system.time(r3 <- esApply(sample.ExpressionSet[1:nGenes, ], 1, myRule)))
cat("function rowpAUCs: ")
print(system.time(r2 <- rowpAUCs(sample.ExpressionSet[1:nGenes, ],
"sex", p=1)))
## compare output
myRule2 = function(x)
pAUC(rocdemo.sca(truth = as.integer(sample.ExpressionSet$sex)-1 ,
data = x, rule = dxrule.sca), t0 = 1)
r4 <- esApply(sample.ExpressionSet[1:nGenes, ], 1, myRule2)
plot(r4,area(r2), xlab="function pAUC", ylab="function rowpAUCs",
main="pAUCs")
plot(r4, area(rowpAUCs(sample.ExpressionSet[1:nGenes, ],
"sex", p=1, flip=FALSE)), xlab="function pAUC", ylab="function rowpAUCs",
main="pAUCs")
r4[r4<0.5] <- 1-r4[r4<0.5]
plot(r4, area(r2), xlab="function pAUC", ylab="function rowpAUCs",
main="pAUCs")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.