2D Visualization of Data Scatter and Box Vertices

Description

S3-generic plotting function for two-dimensional visualization of original data as well as predicted data scatter with cross-validated box vertices of a PRSP object. The scatter plot is for a given peeling step of the peeling sequence and in a given plane of the used covariates of the PRSP object, both specified by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  ## S3 method for class 'PRSP'
plot(x,
                      main = NULL,
                      proj = c(1,2), 
                      splom = TRUE, 
                      boxes = FALSE,
                      steps = x$cvfit$cv.nsteps,
                      pch = 16, 
                      cex = 0.5, 
                      col = 2:(length(steps)+1), 
                      col.box = 2:(length(steps)+1), 
                      lty.box = rep(2,length(steps)), 
                      lwd.box = rep(1,length(steps)),
                      add.legend = TRUE, 
                      device = NULL, 
                      file = "Scatter Plot", 
                      path=getwd(), 
                      horizontal = FALSE, 
                      width = 5, 
                      height = 5, ...)

Arguments

x

Object of class PRSP as generated by the main function sbh.

main

Character vector. Main Title. Defaults to NULL.

proj

Integer vector of length two, specifying the two dimensions of the projection plane of of the used covariates of the PRSP object. Defaults to first two dimensions: {1,2}.

splom

Logical scalar. Shall the scatter plot of points inside the box(es) be plotted? Default to TRUE.

boxes

Logical scalar. Shall the box vertices be plotted or just the scatter of points? Default to FALSE.

steps

Integer vector. Vector of peeling steps at which to plot the in-box samples and box vertices. Defaults to the last peeling step of PRSP object object.

pch

Integer scalar of symbol number for the scatter plot. Defaults to 16.

cex

Integer scalar of symbol expansion. Defaults to 0.5.

col

Integer vector specifying the symbol color for each step. Defaults to vector of colors of length the number of steps. The vector is reused cyclically if it is shorter than the number of steps.

col.box

Integer vector of line color of box vertices for each step. Defaults to vector of colors of length the number of steps. The vector is reused cyclically if it is shorter than the number of steps.

lty.box

Integer vector of line type of box vertices for each step. Defaults to vector of 2's of length the number of steps. The vector is reused cyclically if it is shorter than the number of steps.

lwd.box

Integer vector of line width of box vertices for each step. Defaults to vector of 1's of length the number of steps. The vector is reused cyclically if it is shorter than the number of steps.

add.legend

Logical scalar. Shall the legend of steps numbers be plotted? Defaults to TRUE.

device

Graphic display device in {NULL, "PS", "PDF"}. Defaults to NULL (standard output screen). Currently implemented graphic display devices are "PS" (Postscript) or "PDF" (Portable Document Format).

file

File name for output graphic. Defaults to "Scatter Plot".

path

Absolute path (without final (back)slash separator). Defaults to working directory path.

horizontal

Logical scalar. Orientation of the printed image. Defaults to FALSE, that is potrait orientation.

width

Numeric scalar. Width of the graphics region in inches. Defaults to 5.

height

Numeric scalar. Height of the graphics region in inches. Defaults to 5.

...

Generic arguments passed to other plotting functions.

Details

The scatterplot is drawn on a graphical device with geometrically equal scales on the X and Y axes.

Value

Invisible. None. Displays the plot(s) on the specified device.

Note

End-user plotting function.

Author(s)

Maintainer: "Jean-Eudes Dazard, Ph.D." jxd101@case.edu

Acknowledgments: This project was partially funded by the National Institutes of Health NIH - National Cancer Institute (R01-CA160593) to J-E. Dazard and J.S. Rao.

References

  • Dazard J-E., Choe M., LeBlanc M. and Rao J.S. (2015). "Cross-validation and Peeling Strategies for Survival Bump Hunting using Recursive Peeling Methods." Statistical Analysis and Data Mining (in press).

  • Dazard J-E., Choe M., LeBlanc M. and Rao J.S. (2014). "Cross-Validation of Survival Bump Hunting by Recursive Peeling Methods." In JSM Proceedings, Survival Methods for Risk Estimation/Prediction Section. Boston, MA, USA. American Statistical Association IMS - JSM, p. 3366-3380.

  • Dazard J-E., Choe M., LeBlanc M. and Rao J.S. (2015). "R package PRIMsrc: Bump Hunting by Patient Rule Induction Method for Survival, Regression and Classification." In JSM Proceedings, Statistical Programmers and Analysts Section. Seattle, WA, USA. American Statistical Association IMS - JSM, (in press).

  • Dazard J-E. and J.S. Rao (2010). "Local Sparse Bump Hunting." J. Comp Graph. Statistics, 19(4):900-92.

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
#===================================================
# Loading the library and its dependencies
#===================================================
library("PRIMsrc")

#=================================================================================
# Simulated dataset #1 (n=250, p=3)
# Non Replicated Combined Cross-Validation (RCCV)
# Peeling criterion = LRT
# Optimization criterion = LRT
#=================================================================================
CVCOMB.synt1 <- sbh(dataset = Synthetic.1, 
                    cvtype = "combined", cvcriterion = "lrt",
                    B = 1, K = 5, 
                    vs = TRUE, cpv = FALSE, 
                    decimals = 2, probval = 0.5, 
                    arg = "beta=0.05,
                           alpha=0.1,
                           minn=10,
                           L=NULL,
                           peelcriterion=\"lr\"",
                    parallel = FALSE, conf = NULL, seed = 123)

plot(x = CVCOMB.synt1,
     main = paste("Scatter plot for model #1", sep=""),
     proj = c(1,2), splom = TRUE, boxes = TRUE,
     steps = CVCOMB.synt1$cvfit$cv.nsteps,
     pch = 16, cex = 0.5, col = 2,
     col.box = 2, lty.box = 2, lwd.box = 1,
     add.legend = TRUE, device = NULL)