Hitters <- na.omit(Hitters)
X <- model.matrix(Salary ~ ., Hitters)[, -1]
y <- Hitters$Salary
liu.mod <- liureg(X, y, seq(0, 1, 0.01))
# Liu coefficient paths
plot(liu.mod)
# Bias-variance trade-off
plot(liu.mod, type="biasvar")
Run the code above in your browser using DataLab