Learn R Programming

ncvreg (version 3.4-0)

plot.fir: Plot false inclusion rate curves

Description

Plot false inclusion rate curves from an "fir" or "perm.ncvreg" object.

Usage

## S3 method for class 'fir':
plot(x, type=c("FIR", "EF"), log.l=FALSE, legend=TRUE,
...)

Arguments

x
A "perm.ncvreg" or "fir" object.
type
What to plot on the vertical axis. FIR plots the false inclusion rate; EF plots the expected number of false inclusions along with the actual number of variables included in the model.
log.l
Should horizontal axis be on the log scale? Default is FALSE.
legend
For type="EF" plots, draw a legend to indicate which line is for the actual selections and which line is for the expected number of false inclusions? Default is TRUE.
...
Other graphical parameters to pass to plot

See Also

fir, perm.ncvreg

Examples

Run this code
data(prostate)
X <- as.matrix(prostate[,1:8])
y <- prostate$lpsa
fit <- ncvreg(X, y)

f <- fir(fit)
cbind(EF=f$EF, S=f$S, FIR=f$FIR)[1:10,]

## Comparison with perm.ncvreg
par(mfrow=c(2,2))
plot(f)
plot(f, type="EF")
pmfit <- perm.ncvreg(X, y)
plot(pmfit)
plot(pmfit, type="EF")
## Note that fir() is more conservative

Run the code above in your browser using DataLab