R/mfdr-tcga.R

Defines functions Fig6.6

Documented in Fig6.6

#' Reproduce Figure 6.6
#'
#' Reproduces Figure 6.6 from the book.  If you specify any options, your results may look different.
#'
#' @param fit    \code{ncvreg} fit to the TCGA data; see examples
#'
#' @examples
#' attachData(bcTCGA)
#'
#' fit <- ncvreg(X, y, penalty="lasso")
#' obj <- mfdr(fit)
#' tail(subset(obj, mFDR < .1))
#' plot(obj)
#'
#' # Lasso figure
#' Fig6.6(fit)
#'
#' # An MCP figure
#' fit <- ncvreg(X, y)
#' Fig6.6(fit)
#'
#' @export

Fig6.6 <- function(fit) {
  obj <- mfdr(fit)
  par(mar=c(5,5,5,0.5), mfrow=c(1,2))
  plot(obj, lwd=3, log.l=TRUE, bty="n")
  plot(obj, type="EF", lwd=3, log.l=TRUE, bty="n")
}
pbreheny/hdrm documentation built on Jan. 17, 2024, 8:53 p.m.