MIDTERM HOMEWORK

Author

Harshada

library(ISLR2) library(MASS)

Attaching package: ‘MASS’

The following object is masked from ‘package:ISLR2’:

Boston

Chapter 2 — Problem 9 (Auto Dataset) (a) Quantitative vs Qualitative Predictors

data(Auto) Auto <- na.omit(Auto) str(Auto)

‘data.frame’: 392 obs. of 9 variables:

$ mpg : num 18 15 18 16 17 15 14 14 14 15 …

$ cylinders : int 8 8 8 8 8 8 8 8 8 8 …

$ displacement: num 307 350 318 304 302 429 454 440 455 390 …

$ horsepower : int 130 165 150 150 140 198 220 215 225 190 …

$ weight : int 3504 3693 3436 3433 3449 4341 4354 4312 4425 3850 …

$ acceleration: num 12 11.5 11 12 10.5 10 9 8.5 10 8.5 …

$ year : int 70 70 70 70 70 70 70 70 70 70 …

$ origin : int 1 1 1 1 1 1 1 1 1 1 …

$ name : Factor w/ 304 levels “amc ambassador brougham”,..: 49 36 231 14 161 141 54 223 241 2 …

- attr(*, “na.action”)= ‘omit’ Named int [1:5] 33 127 331 337 355

..- attr(*, “names”)= chr [1:5] “33” “127” “331” “337” …