Free Access Week - Data Engineering + BI
Data engineering and BI courses are free!
Free Access Week - Jun 2-8

CSUV (version 0.1.1)

plot.csuv: Graphical illustration of selection uncertainty

Description

Graphical illustration of selection uncertainty

Usage

# S3 method for csuv
plot(
  x,
  with.unconditional = FALSE,
  compare.method.fit = NULL,
  cv.mod = NULL,
  with.thr = TRUE,
  with.violin = FALSE,
  to.shade = TRUE,
  ci.method = "conditional",
  level = 0.1,
  var.freq.thr = 0.1,
  log.level = NULL,
  ...
)

Arguments

x

fitted results from CSUV::csuv()

with.unconditional

TRUE to get a unconditonal boxplot on the same graph. Default is FALSE

compare.method.fit

(optional) fitted results from CSUV::lm.compare.methods(). Alternatively, user can provide a data frame with each row contains the estimated coefficients from a method. The name of each row should be corresponding to the name of the method. The first value of each row should be the value of the intercept

cv.mod

(optional) a vector of estimated coefficients from cross validation. The first value should be the value of the intercept

with.thr

whether the selection by the CSUV should be show. Default is TRUE

with.violin

whether the graph with violin plot

to.shade

whether to shade the graph by the relative frequency calculated by CSUV. Default is TRUE

ci.method

how the confidence interval should be calculated. Default is "conditional"

level

the significant level of the whiskers. Default is 0.1

var.freq.thr

minimum variable frequency to show, default is 0.1

log.level

log level to set. Default is NULL, which means no change in log level. See the function CSUV::set.log.level for more details

...

additional argument for plot

Value

a ggplot object

Examples

Run this code
# NOT RUN {
X = matrix(rnorm(1000), nrow = 100)
Y = rowSums(X[,1:3])+rnorm(100)
mod.0 = csuv(X, Y, intercept = FALSE, q = 0, method.names = NULL)
cv.mod = lm.cv(X, Y, intercept = FALSE, fit.percent = 0.5, num.repeat = 50)
compare.mod = lm.compare.method(X, Y, intercept = FALSE)
plot(mod.0, compare.method.fit = compare.mod, cv.mod = cv.mod$est.b)
# }

Run the code above in your browser using DataLab