1.3 Exercises

1.3.1 Auto dataset

  • Install the R package ISLR and load the dataset Auto. Be careful, as R is case-sensitive.
  • Query the help file for information about the dataset.
  • Look at the first lines of Auto
  • Create an explanatory variable x with horsepower and mileage per gallon as response y.
  • Create a scatterplot of y against x. Is there evidence of a linear relationship between the two variables?
  • Append a column vector of ones to x and create a projection matrix.
  • Check that the resulting projection matrix is symmetric and idempotent.