BoxROC: Compare Boxplots with ROC Curve

Description Usage Arguments Value Author(s) Examples

View source: R/statVisual.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 data that indicates the two subject groups. It also indicates the color of the two boxplots.

y

character. The column name of data that indicates the variable, for which the box will be drawn.

box.xlab

character. boxplot x axis label (default: group.var)

box.ylab

character. boxplot y axis label (default: y)

box.group.lab

character. boxplot legend label (default: group.var)

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: Specificities)

roc.ylab

character. roc curve y axis label (default: Sensitivities)

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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)

statVisual documentation built on Feb. 21, 2020, 1:08 a.m.