Learn R Programming

Compack (version 0.1.0)

plot.cv.compCL: Plot the cross-validation curve produced by "cv.compCL" object.

Description

Plot the cross-validation curve with its upper and lower standard deviation curves.

Usage

# S3 method for cv.compCL
plot(x, xlab = c("log", "-log", "lambda"), trim = FALSE, ...)

Arguments

x

fitted "cv.compCL" object.

xlab

what is on the X-axis, "log" plots against log(lambda) (default), "-log" against -log(lambda), and "lambda" against lambda.

trim

logical; whether to use the trimmed result. Default is FALSE.

...

other graphical parameters.

Value

No return value. Side effect is a base R plot.

Details

A cross-validation curve is produced.

References

Lin, W., Shi, P., Peng, R. and Li, H. (2014) Variable selection in regression with compositional covariates, https://academic.oup.com/biomet/article/101/4/785/1775476. Biometrika 101 785-979.

See Also

cv.compCL and compCL, and coef and plot methods for "cv.compCL" object.

Examples

Run this code
# NOT RUN {
p = 30
n = 50
beta = c(1, -0.8, 0.6, 0, 0, -1.5, -0.5, 1.2)
beta = c(beta, rep(0, times = p - length(beta)))
Comp_data = comp_Model(n = n, p = p, intercept = FALSE)
cvm1 <- cv.compCL(y = Comp_data$y, Z = Comp_data$X.comp,
                  Zc = Comp_data$Zc, intercept = Comp_data$intercept)
plot(cvm1)
plot(cvm1, xlab = "-log")

# }

Run the code above in your browser using DataLab