We will not have time to discuss code in class. But here is some R code illustrating concepts we will cover in the course. Although entirely optional, I encourage you to go over it. It is taken from the excellent second edition of An Introduction to Statistical Learning by James et al. The textbook is available for download here and comes with a lot of datasets and code.

An introduction to R and linear regression

A good place to start is the labs of Chapters 2 and 3.

Principal components analysis

PCA and other unsupervised learning methods are covered in the lab of Chapter 12.

Multiple testing

Multiple testing is covered in the lab of Chapter 13. For background on the resampling approach discussed in Section 13.6.4, see the lab of Chapter 5.

Sparse linear regression

The Lasso is covered in the lab of Chapter 6.