plot.sbh: 2D Visualization of Data Scatter and Encapsulating Box

View source: R/PRIMsrc.r

plot.sbhR Documentation

2D Visualization of Data Scatter and Encapsulating Box

Description

S3-method plot function for two-dimensional visualization of scatter of data points and cross-validated encapsulating box of a sbh object. The box represents a Bump Hunting search either between higher-risk (in-bump) versus lower-risk (out-bump) observations (bump difference, PRSP algorithm), or between two specified fixed groups (group difference, PRGSP algorithm). The scatter plot is done for a given peeling step (or number of steps) of the peeling sequence (inner loop of our PRSP or PRGSP), and in a given projection plane of the used covariates of the sbh object, both specified by the user.

Usage

  ## S3 method for class 'sbh'
plot(x,
     main = "Scatter Plot",
     proj = x$cvfit$cv.used[c(1,2)], 
     steps = x$cvfit$cv.nsteps,
     pch = 16, 
     cex = 0.5, 
     col = c(1,2), 
     boxes = TRUE,
     asp = NA,
     col.box = rep(2,length(steps)), 
     lty.box = rep(2,length(steps)), 
     lwd.box = rep(1,length(steps)),
     add.caption.box = boxes,
     text.caption.box = paste("Step: ", steps, sep=""),
     pch.group = c(1,1),
     cex.group = c(1,1),
     col.group = c(3,4),
     add.caption.group = ifelse(test = (x$cvarg$peelcriterion == "grp"), 
                              yes = TRUE, 
                              no = FALSE),
     text.caption.group = levels(x$groups), 
     device = NULL, 
     file = "Scatter Plot", 
     path = getwd(), 
     horizontal = FALSE, 
     width = 5, 
     height = 5, ...)

Arguments

x

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

main

Character vector. Main Title. Defaults to "Scatter Plot".

proj

Integer vector of length two, specifying the two used (selected) covariates in which the scatter plot is to be plotted. See details. Defaults to first two used (selected) covariates.

steps

Integer vector. Vector of peeling steps at which to plot the inbox samples and box vertices. Defaults to the last peeling step of sbh object x.

pch

Integer scalar specifying the symbol for the outbox and inbox data points (Defaults to 16 for both).

cex

Numeric scalar specifying the symbol expansion for the outbox and inbox data points (Defaults to 0.5 for both).

col

Integer vector specifying the symbol color for the outbox and inbox data points (Defaults to "black" and "red", respectively).

boxes

Logical scalar. Shall the encapsulating box(es) be plotted as well? Default to TRUE.

asp

Numeric scalar giving the y/x aspect ratio. Default to asp=NA i.e. a regular plot. See details.

col.box

Integer vector of line color of box vertices for each step. Defaults to vector of 2's (red) 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.caption.box

Logical scalar. Shall the caption be plotted? Defaults to boxes value.

text.caption.box

Character vector of caption content. Defaults to paste("Step: ", steps, sep="").

pch.group

Integer vector specifying the symbol for the two groups data points (Defaults to 0.5 for both).

cex.group

Numeric vector specifying the symbol expansion for the two groups data points (Defaults to 0.5 for both).

col.group

Integer vector specifying the symbol color for the two groups data points (Defaults to "green" and "blue").

add.caption.group

Logical scalar. Shall the caption be plotted? Defaults to TRUE or FALSE, depending on x$cvarg$peelcriterion.

text.caption.group

Character vector of caption content. Defaults to levels(x$groups).

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

Use graphical parameter asp=1 for a plotting a proportional scatter plot on the graphical device with geometrically equal scales on the x and y axes. In that case, it produces a proportional scatter plot where distances between points are represented accurately on screen. The window is set up so that one data unit in the x direction is equal in length to one data unit in the y direction.

The two dimensions (proj) of the projection plane in which the scatter plot is to be plotted, must be a subset (in the large sense) of the used (selected) covariates of sbh object x. If the number of used covariates in the sbh object is zero, the scatterplot will not be plotted. If the number of used covariates is one, the scatterplot will be plotted using the specified covariate and an arbitrary dimension, both specified by the user.

Value

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

Acknowledgments

This work made use of the High Performance Computing Resource in the Core Facility for Advanced Research Computing at Case Western Reserve University. 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.

Note

End-user plotting function.

Author(s)

Maintainer: "Jean-Eudes Dazard, Ph.D." jean-eudes.dazard@case.edu

References

  • Dazard J-E. and Rao J.S. (2021a). "Variable Selection Strategies for High-Dimensional Recursive Peeling-Based Survival Bump Hunting Models." (in prep).

  • Dazard J-E. and Rao J.S. (2021b). "Group Bump Hunting by Recursive Peeling-Based Methods: Application to Survival/Risk Predictive Models." (in prep).

  • Dazard J-E., Choe M., Pawitan Y., and Rao J.S. (2021c). "Identification and Characterization of Informative Prognostic Subgroups by Survival Bump Hunting." (in prep).

  • Rao J.S., Huilin Y., and Dazard J-E. (2020). "Disparity Subtyping: Bringing Precision Medicine Closer to Disparity Science." Cancer Epidemiology Biomarkers & Prevention, 29(6 Suppl):C018.

  • Yi C. and Huang J. (2017). "Semismooth Newton Coordinate Descent Algorithm for Elastic-Net Penalized Huber Loss Regression and Quantile Regression." J. Comp Graph. Statistics, 26(3):547-557.

  • Dazard J-E., Choe M., LeBlanc M., and Rao J.S. (2016). "Cross-validation and Peeling Strategies for Survival Bump Hunting using Recursive Peeling Methods." Statistical Analysis and Data Mining, 9(1):12-42.

  • 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, p. 650-664.

  • 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.


jedazard/PRIMsrc documentation built on July 16, 2022, 10:56 p.m.