Learn R Programming

rqPen (version 4.1.3)

bytau.plot.rq.pen.seq.cv: Plot of coefficients varying by quantiles for rq.pen.seq.cv object

Description

Produces plots of how coefficient estimates vary by quantile for models selected by using cross validation.

Usage

# S3 method for rq.pen.seq.cv
bytau.plot(
  x,
  septau = ifelse(x$fit$penalty != "gq", TRUE, FALSE),
  cvmin = TRUE,
  useDefaults = TRUE,
  vars = NULL,
  ...
)

Value

Returns plots of coefficient estimates varying by quantile.

Arguments

x

An rq.pen.seq.cv object

septau

Whether optimal tuning parameters are estimated separately for each quantile.

cvmin

Whether the minimum cv error should be used or the one standard error rule.

useDefaults

Set to FALSE if you want to use something besides minimum cv or 1se.

vars

Index of the variables to plot with 1 being the intercept, 2 being the first predictor, etc. Default is to include all variables.

...

Additional parameters sent to coef()

Author

Ben Sherwood, ben.sherwood@ku.edu

Examples

Run this code
 set.seed(1)
 x <- matrix(runif(800),nrow=100)
 y <- 1 + x[,1] - 3*x[,5] + (1+x[,4])*rnorm(100)
 lmcv <- rq.pen.cv(x,y,tau=seq(.1,.9,.1))
 bytau.plot(lmcv)

Run the code above in your browser using DataLab