Learn R Programming

ncvreg (version 3.8-0)

fir: False inclusion rates for ncvreg

Description

Estimates false inclusion rates (FIR) for penalized regression models.

Usage

fir(fit)

Arguments

fit
An ncvreg or ncvsurv object.

Value

An object with S3 class fir inheriting from data.frame and containing:

Details

The function estimates the false inclusion rate (FIR) for a penalized regression model. The estimate tends to be accurate in most settings, but will be slightly conservative if predictors are highly correlated. For an alternative way of estimating the false inclusion rate, typically more accurate in highly correlated cases, see perm.ncvreg.

See Also

ncvreg, ncvsurv, plot.fir, perm.ncvreg

Examples

Run this code

#### Linear regression -----------------------------
data(prostate)
X <- as.matrix(prostate[,1:8])
y <- prostate$lpsa
fit <- ncvreg(X, y)

obj <- fir(fit)
obj[1:10,]

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

#### Logistic regression ---------------------------
data(heart)
X <- as.matrix(heart[,1:9])
y <- heart$chd
fit <- ncvreg(X, y, family="binomial")
obj <- fir(fit)
head(obj)
plot(obj)
plot(obj, type="EF")

#### Cox regression --------------------------------
data(Lung)
X <- Lung$X
y <- Lung$y
fit <- ncvsurv(X, y)
obj <- fir(fit)
head(obj)
plot(obj)
plot(obj, type="EF")

Run the code above in your browser using DataLab