BoxROC {statVisual} | R Documentation |
Compare Boxplots with ROC Curve
Description
Compare boxplots with ROC curve.
The value of the variable y
will be jittered shown on the boxplots. The area under ROC curve will also be calculated and shown in the plot of ROC curve.
Usage
BoxROC(
data,
group.var,
y,
box.xlab = group.var,
box.ylab = y,
box.group.lab = group.var,
jitter.alpha = 0.8,
jitter.width = 0.1,
point.size = 3,
roc.xlab = "Specificity",
roc.ylab = "Sensitivity",
addThemeFlag = TRUE)
Arguments
data |
A data frame. Rows are subjects; Columns are variables describing the subjects. |
group.var |
character. The column name of |
y |
character. The column name of |
box.xlab |
character. boxplot x axis label (default: |
box.ylab |
character. boxplot y axis label (default: |
box.group.lab |
character. boxplot legend label (default: |
jitter.alpha |
numeric. transparency of jitters |
jitter.width |
numeric. width of jitters |
point.size |
size of a jitter point |
roc.xlab |
character. roc curve x axis label (default: |
roc.ylab |
character. roc curve y axis label (default: |
addThemeFlag |
logical. Indicates if light blue background and white grid should be added to the figure. |
Value
A list with the following 12 elements: grobs
, layout
,
widths
, heights
, respect
, rownames
,
colnames
, name
,
gp
, vp
, children
, childrenOrder
.
Author(s)
Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>
Examples
library(dplyr)
library(gridExtra)
data(esSim)
print(esSim)
# expression data
dat = exprs(esSim)
print(dim(dat))
print(dat[1:2,])
# phenotype data
pDat = pData(esSim)
print(dim(pDat))
print(pDat[1:2,])
# feature data
fDat = fData(esSim)
print(dim(fDat))
print(fDat[1:2,])
# choose the first probe which is over-expressed in cases
pDat$probe1 = dat[1,]
# check histograms of probe 1 expression in cases and controls
print(table(pDat$grp, useNA = "ifany"))
statVisual(type = 'BoxROC',
data = pDat,
group = 'grp',
y = 'probe1',
point.size = 1)
BoxROC(
data = pDat,
group = 'grp',
y = 'probe1',
point.size = 1)