Exercise solutions

Exercise Solution for Chapter 12

Exercise 12.2 from Modern Statistics for Modern Biologists Use glmnet for a prediction of a continous variable, i.e., for regression. Use the prostate cancer data from Chapter 3 of (Hastie, Tibshirani, and Friedman 2008). The data are available in the CRAN package ElemStatLearn. Explore the effects of using Ridge versus Lasso penalty. Here are the packages that need to be installed. library(dplyr) library(ggplot2) library(glmnet) # perform generalize linear models library(GGally) # used for ggpairs function library(superheat) # used to show correlation between variables Data for the exercise The ElemStatPackage isn’t on CRAN anymore.