Introduction

This presentation uses an exploratory dataset analysis on cars. This contains two files. The first file, cars_multi, contains information for the mpg, cylinders, displacement, horsepower, weight, acceleration, model, origin, and name of the car. The second file, cars_price, contains the price of every car in the dataframe according to their ID. For our purposes, these two dataframes must be merged into one.

The Dataframe in Use

The merged dataframe can be created as such:

cars = read.csv('~/Downloads/cars_multi.csv', header=TRUE)
carsPrice = read.csv('~/Downloads/cars_price.csv', header=TRUE)

carsData <- merge(cars,carsPrice, by= "ID")
carsData
##      ID  mpg cylinders displacement horsepower weight acceleration model origin
## 1     1 18.0         8        307.0        130   3504         12.0    70      1
## 2     2 15.0         8        350.0        165   3693         11.5    70      1
## 3     3 18.0         8        318.0        150   3436         11.0    70      1
## 4     4 16.0         8        304.0        150   3433         12.0    70      1
## 5     5 17.0         8        302.0        140   3449         10.5    70      1
## 6     6 15.0         8        429.0        198   4341         10.0    70      1
## 7     7 14.0         8        454.0        220   4354          9.0    70      1
## 8     8 14.0         8        440.0        215   4312          8.5    70      1
## 9     9 14.0         8        455.0        225   4425         10.0    70      1
## 10   10 15.0         8        390.0        190   3850          8.5    70      1
## 11   11 15.0         8        383.0        170   3563         10.0    70      1
## 12   12 14.0         8        340.0        160   3609          8.0    70      1
## 13   13 15.0         8        400.0        150   3761          9.5    70      1
## 14   14 14.0         8        455.0        225   3086         10.0    70      1
## 15   15 24.0         4        113.0         95   2372         15.0    70      3
## 16   16 22.0         6        198.0         95   2833         15.5    70      1
## 17   17 18.0         6        199.0         97   2774         15.5    70      1
## 18   18 21.0         6        200.0         85   2587         16.0    70      1
## 19   19 27.0         4         97.0         88   2130         14.5    70      3
## 20   20 26.0         4         97.0         46   1835         20.5    70      2
## 21   21 25.0         4        110.0         87   2672         17.5    70      2
## 22   22 24.0         4        107.0         90   2430         14.5    70      2
## 23   23 25.0         4        104.0         95   2375         17.5    70      2
## 24   24 26.0         4        121.0        113   2234         12.5    70      2
## 25   25 21.0         6        199.0         90   2648         15.0    70      1
## 26   26 10.0         8        360.0        215   4615         14.0    70      1
## 27   27 10.0         8        307.0        200   4376         15.0    70      1
## 28   28 11.0         8        318.0        210   4382         13.5    70      1
## 29   29  9.0         8        304.0        193   4732         18.5    70      1
## 30   30 27.0         4         97.0         88   2130         14.5    71      3
## 31   31 28.0         4        140.0         90   2264         15.5    71      1
## 32   32 25.0         4        113.0         95   2228         14.0    71      3
## 33   33 25.0         4         98.0          ?   2046         19.0    71      1
## 34   34 19.0         6        232.0        100   2634         13.0    71      1
## 35   35 16.0         6        225.0        105   3439         15.5    71      1
## 36   36 17.0         6        250.0        100   3329         15.5    71      1
## 37   37 19.0         6        250.0         88   3302         15.5    71      1
## 38   38 18.0         6        232.0        100   3288         15.5    71      1
## 39   39 14.0         8        350.0        165   4209         12.0    71      1
## 40   40 14.0         8        400.0        175   4464         11.5    71      1
## 41   41 14.0         8        351.0        153   4154         13.5    71      1
## 42   42 14.0         8        318.0        150   4096         13.0    71      1
## 43   43 12.0         8        383.0        180   4955         11.5    71      1
## 44   44 13.0         8        400.0        170   4746         12.0    71      1
## 45   45 13.0         8        400.0        175   5140         12.0    71      1
## 46   46 18.0         6        258.0        110   2962         13.5    71      1
## 47   47 22.0         4        140.0         72   2408         19.0    71      1
## 48   48 19.0         6        250.0        100   3282         15.0    71      1
## 49   49 18.0         6        250.0         88   3139         14.5    71      1
## 50   50 23.0         4        122.0         86   2220         14.0    71      1
## 51   51 28.0         4        116.0         90   2123         14.0    71      2
## 52   52 30.0         4         79.0         70   2074         19.5    71      2
## 53   53 30.0         4         88.0         76   2065         14.5    71      2
## 54   54 31.0         4         71.0         65   1773         19.0    71      3
## 55   55 35.0         4         72.0         69   1613         18.0    71      3
## 56   56 27.0         4         97.0         60   1834         19.0    71      2
## 57   57 26.0         4         91.0         70   1955         20.5    71      1
## 58   58 24.0         4        113.0         95   2278         15.5    72      3
## 59   59 25.0         4         97.5         80   2126         17.0    72      1
## 60   60 23.0         4         97.0         54   2254         23.5    72      2
## 61   61 20.0         4        140.0         90   2408         19.5    72      1
## 62   62 21.0         4        122.0         86   2226         16.5    72      1
## 63   63 13.0         8        350.0        165   4274         12.0    72      1
## 64   64 14.0         8        400.0        175   4385         12.0    72      1
## 65   65 15.0         8        318.0        150   4135         13.5    72      1
## 66   66 14.0         8        351.0        153   4129         13.0    72      1
## 67   67 17.0         8        304.0        150   3672         11.5    72      1
## 68   68 11.0         8        429.0        208   4633         11.0    72      1
## 69   69 13.0         8        350.0        155   4502         13.5    72      1
## 70   70 12.0         8        350.0        160   4456         13.5    72      1
## 71   71 13.0         8        400.0        190   4422         12.5    72      1
## 72   72 19.0         3         70.0         97   2330         13.5    72      3
## 73   73 15.0         8        304.0        150   3892         12.5    72      1
## 74   74 13.0         8        307.0        130   4098         14.0    72      1
## 75   75 13.0         8        302.0        140   4294         16.0    72      1
## 76   76 14.0         8        318.0        150   4077         14.0    72      1
## 77   77 18.0         4        121.0        112   2933         14.5    72      2
## 78   78 22.0         4        121.0         76   2511         18.0    72      2
## 79   79 21.0         4        120.0         87   2979         19.5    72      2
## 80   80 26.0         4         96.0         69   2189         18.0    72      2
## 81   81 22.0         4        122.0         86   2395         16.0    72      1
## 82   82 28.0         4         97.0         92   2288         17.0    72      3
## 83   83 23.0         4        120.0         97   2506         14.5    72      3
## 84   84 28.0         4         98.0         80   2164         15.0    72      1
## 85   85 27.0         4         97.0         88   2100         16.5    72      3
## 86   86 13.0         8        350.0        175   4100         13.0    73      1
## 87   87 14.0         8        304.0        150   3672         11.5    73      1
## 88   88 13.0         8        350.0        145   3988         13.0    73      1
## 89   89 14.0         8        302.0        137   4042         14.5    73      1
## 90   90 15.0         8        318.0        150   3777         12.5    73      1
## 91   91 12.0         8        429.0        198   4952         11.5    73      1
## 92   92 13.0         8        400.0        150   4464         12.0    73      1
## 93   93 13.0         8        351.0        158   4363         13.0    73      1
## 94   94 14.0         8        318.0        150   4237         14.5    73      1
## 95   95 13.0         8        440.0        215   4735         11.0    73      1
## 96   96 12.0         8        455.0        225   4951         11.0    73      1
## 97   97 13.0         8        360.0        175   3821         11.0    73      1
## 98   98 18.0         6        225.0        105   3121         16.5    73      1
## 99   99 16.0         6        250.0        100   3278         18.0    73      1
## 100 100 18.0         6        232.0        100   2945         16.0    73      1
## 101 101 18.0         6        250.0         88   3021         16.5    73      1
## 102 102 23.0         6        198.0         95   2904         16.0    73      1
## 103 103 26.0         4         97.0         46   1950         21.0    73      2
## 104 104 11.0         8        400.0        150   4997         14.0    73      1
## 105 105 12.0         8        400.0        167   4906         12.5    73      1
## 106 106 13.0         8        360.0        170   4654         13.0    73      1
## 107 107 12.0         8        350.0        180   4499         12.5    73      1
## 108 108 18.0         6        232.0        100   2789         15.0    73      1
## 109 109 20.0         4         97.0         88   2279         19.0    73      3
## 110 110 21.0         4        140.0         72   2401         19.5    73      1
## 111 111 22.0         4        108.0         94   2379         16.5    73      3
## 112 112 18.0         3         70.0         90   2124         13.5    73      3
## 113 113 19.0         4        122.0         85   2310         18.5    73      1
## 114 114 21.0         6        155.0        107   2472         14.0    73      1
## 115 115 26.0         4         98.0         90   2265         15.5    73      2
## 116 116 15.0         8        350.0        145   4082         13.0    73      1
## 117 117 16.0         8        400.0        230   4278          9.5    73      1
## 118 118 29.0         4         68.0         49   1867         19.5    73      2
## 119 119 24.0         4        116.0         75   2158         15.5    73      2
## 120 120 20.0         4        114.0         91   2582         14.0    73      2
## 121 121 19.0         4        121.0        112   2868         15.5    73      2
## 122 122 15.0         8        318.0        150   3399         11.0    73      1
## 123 123 24.0         4        121.0        110   2660         14.0    73      2
## 124 124 20.0         6        156.0        122   2807         13.5    73      3
## 125 125 11.0         8        350.0        180   3664         11.0    73      1
## 126 126 20.0         6        198.0         95   3102         16.5    74      1
## 127 127 21.0         6        200.0          ?   2875         17.0    74      1
## 128 128 19.0         6        232.0        100   2901         16.0    74      1
## 129 129 15.0         6        250.0        100   3336         17.0    74      1
## 130 130 31.0         4         79.0         67   1950         19.0    74      3
## 131 131 26.0         4        122.0         80   2451         16.5    74      1
## 132 132 32.0         4         71.0         65   1836         21.0    74      3
## 133 133 25.0         4        140.0         75   2542         17.0    74      1
## 134 134 16.0         6        250.0        100   3781         17.0    74      1
## 135 135 16.0         6        258.0        110   3632         18.0    74      1
## 136 136 18.0         6        225.0        105   3613         16.5    74      1
## 137 137 16.0         8        302.0        140   4141         14.0    74      1
## 138 138 13.0         8        350.0        150   4699         14.5    74      1
## 139 139 14.0         8        318.0        150   4457         13.5    74      1
## 140 140 14.0         8        302.0        140   4638         16.0    74      1
## 141 141 14.0         8        304.0        150   4257         15.5    74      1
## 142 142 29.0         4         98.0         83   2219         16.5    74      2
## 143 143 26.0         4         79.0         67   1963         15.5    74      2
## 144 144 26.0         4         97.0         78   2300         14.5    74      2
## 145 145 31.0         4         76.0         52   1649         16.5    74      3
## 146 146 32.0         4         83.0         61   2003         19.0    74      3
## 147 147 28.0         4         90.0         75   2125         14.5    74      1
## 148 148 24.0         4         90.0         75   2108         15.5    74      2
## 149 149 26.0         4        116.0         75   2246         14.0    74      2
## 150 150 24.0         4        120.0         97   2489         15.0    74      3
## 151 151 26.0         4        108.0         93   2391         15.5    74      3
## 152 152 31.0         4         79.0         67   2000         16.0    74      2
## 153 153 19.0         6        225.0         95   3264         16.0    75      1
## 154 154 18.0         6        250.0        105   3459         16.0    75      1
## 155 155 15.0         6        250.0         72   3432         21.0    75      1
## 156 156 15.0         6        250.0         72   3158         19.5    75      1
## 157 157 16.0         8        400.0        170   4668         11.5    75      1
## 158 158 15.0         8        350.0        145   4440         14.0    75      1
## 159 159 16.0         8        318.0        150   4498         14.5    75      1
## 160 160 14.0         8        351.0        148   4657         13.5    75      1
## 161 161 17.0         6        231.0        110   3907         21.0    75      1
## 162 162 16.0         6        250.0        105   3897         18.5    75      1
## 163 163 15.0         6        258.0        110   3730         19.0    75      1
## 164 164 18.0         6        225.0         95   3785         19.0    75      1
## 165 165 21.0         6        231.0        110   3039         15.0    75      1
## 166 166 20.0         8        262.0        110   3221         13.5    75      1
## 167 167 13.0         8        302.0        129   3169         12.0    75      1
## 168 168 29.0         4         97.0         75   2171         16.0    75      3
## 169 169 23.0         4        140.0         83   2639         17.0    75      1
## 170 170 20.0         6        232.0        100   2914         16.0    75      1
## 171 171 23.0         4        140.0         78   2592         18.5    75      1
## 172 172 24.0         4        134.0         96   2702         13.5    75      3
## 173 173 25.0         4         90.0         71   2223         16.5    75      2
## 174 174 24.0         4        119.0         97   2545         17.0    75      3
## 175 175 18.0         6        171.0         97   2984         14.5    75      1
## 176 176 29.0         4         90.0         70   1937         14.0    75      2
## 177 177 19.0         6        232.0         90   3211         17.0    75      1
## 178 178 23.0         4        115.0         95   2694         15.0    75      2
## 179 179 23.0         4        120.0         88   2957         17.0    75      2
## 180 180 22.0         4        121.0         98   2945         14.5    75      2
## 181 181 25.0         4        121.0        115   2671         13.5    75      2
## 182 182 33.0         4         91.0         53   1795         17.5    75      3
## 183 183 28.0         4        107.0         86   2464         15.5    76      2
## 184 184 25.0         4        116.0         81   2220         16.9    76      2
## 185 185 25.0         4        140.0         92   2572         14.9    76      1
## 186 186 26.0         4         98.0         79   2255         17.7    76      1
## 187 187 27.0         4        101.0         83   2202         15.3    76      2
## 188 188 17.5         8        305.0        140   4215         13.0    76      1
## 189 189 16.0         8        318.0        150   4190         13.0    76      1
## 190 190 15.5         8        304.0        120   3962         13.9    76      1
## 191 191 14.5         8        351.0        152   4215         12.8    76      1
## 192 192 22.0         6        225.0        100   3233         15.4    76      1
## 193 193 22.0         6        250.0        105   3353         14.5    76      1
## 194 194 24.0         6        200.0         81   3012         17.6    76      1
## 195 195 22.5         6        232.0         90   3085         17.6    76      1
## 196 196 29.0         4         85.0         52   2035         22.2    76      1
## 197 197 24.5         4         98.0         60   2164         22.1    76      1
## 198 198 29.0         4         90.0         70   1937         14.2    76      2
## 199 199 33.0         4         91.0         53   1795         17.4    76      3
## 200 200 20.0         6        225.0        100   3651         17.7    76      1
## 201 201 18.0         6        250.0         78   3574         21.0    76      1
## 202 202 18.5         6        250.0        110   3645         16.2    76      1
## 203 203 17.5         6        258.0         95   3193         17.8    76      1
## 204 204 29.5         4         97.0         71   1825         12.2    76      2
## 205 205 32.0         4         85.0         70   1990         17.0    76      3
## 206 206 28.0         4         97.0         75   2155         16.4    76      3
## 207 207 26.5         4        140.0         72   2565         13.6    76      1
## 208 208 20.0         4        130.0        102   3150         15.7    76      2
## 209 209 13.0         8        318.0        150   3940         13.2    76      1
## 210 210 19.0         4        120.0         88   3270         21.9    76      2
## 211 211 19.0         6        156.0        108   2930         15.5    76      3
## 212 212 16.5         6        168.0        120   3820         16.7    76      2
## 213 213 16.5         8        350.0        180   4380         12.1    76      1
## 214 214 13.0         8        350.0        145   4055         12.0    76      1
## 215 215 13.0         8        302.0        130   3870         15.0    76      1
## 216 216 13.0         8        318.0        150   3755         14.0    76      1
## 217 217 31.5         4         98.0         68   2045         18.5    77      3
## 218 218 30.0         4        111.0         80   2155         14.8    77      1
## 219 219 36.0         4         79.0         58   1825         18.6    77      2
## 220 220 25.5         4        122.0         96   2300         15.5    77      1
## 221 221 33.5         4         85.0         70   1945         16.8    77      3
## 222 222 17.5         8        305.0        145   3880         12.5    77      1
## 223 223 17.0         8        260.0        110   4060         19.0    77      1
## 224 224 15.5         8        318.0        145   4140         13.7    77      1
## 225 225 15.0         8        302.0        130   4295         14.9    77      1
## 226 226 17.5         6        250.0        110   3520         16.4    77      1
## 227 227 20.5         6        231.0        105   3425         16.9    77      1
## 228 228 19.0         6        225.0        100   3630         17.7    77      1
## 229 229 18.5         6        250.0         98   3525         19.0    77      1
## 230 230 16.0         8        400.0        180   4220         11.1    77      1
## 231 231 15.5         8        350.0        170   4165         11.4    77      1
## 232 232 15.5         8        400.0        190   4325         12.2    77      1
## 233 233 16.0         8        351.0        149   4335         14.5    77      1
## 234 234 29.0         4         97.0         78   1940         14.5    77      2
## 235 235 24.5         4        151.0         88   2740         16.0    77      1
## 236 236 26.0         4         97.0         75   2265         18.2    77      3
## 237 237 25.5         4        140.0         89   2755         15.8    77      1
## 238 238 30.5         4         98.0         63   2051         17.0    77      1
## 239 239 33.5         4         98.0         83   2075         15.9    77      1
## 240 240 30.0         4         97.0         67   1985         16.4    77      3
## 241 241 30.5         4         97.0         78   2190         14.1    77      2
## 242 242 22.0         6        146.0         97   2815         14.5    77      3
## 243 243 21.5         4        121.0        110   2600         12.8    77      2
## 244 244 21.5         3         80.0        110   2720         13.5    77      3
## 245 245 43.1         4         90.0         48   1985         21.5    78      2
## 246 246 36.1         4         98.0         66   1800         14.4    78      1
## 247 247 32.8         4         78.0         52   1985         19.4    78      3
## 248 248 39.4         4         85.0         70   2070         18.6    78      3
## 249 249 36.1         4         91.0         60   1800         16.4    78      3
## 250 250 19.9         8        260.0        110   3365         15.5    78      1
## 251 251 19.4         8        318.0        140   3735         13.2    78      1
## 252 252 20.2         8        302.0        139   3570         12.8    78      1
## 253 253 19.2         6        231.0        105   3535         19.2    78      1
## 254 254 20.5         6        200.0         95   3155         18.2    78      1
## 255 255 20.2         6        200.0         85   2965         15.8    78      1
## 256 256 25.1         4        140.0         88   2720         15.4    78      1
## 257 257 20.5         6        225.0        100   3430         17.2    78      1
## 258 258 19.4         6        232.0         90   3210         17.2    78      1
## 259 259 20.6         6        231.0        105   3380         15.8    78      1
## 260 260 20.8         6        200.0         85   3070         16.7    78      1
## 261 261 18.6         6        225.0        110   3620         18.7    78      1
## 262 262 18.1         6        258.0        120   3410         15.1    78      1
## 263 263 19.2         8        305.0        145   3425         13.2    78      1
## 264 264 17.7         6        231.0        165   3445         13.4    78      1
## 265 265 18.1         8        302.0        139   3205         11.2    78      1
## 266 266 17.5         8        318.0        140   4080         13.7    78      1
## 267 267 30.0         4         98.0         68   2155         16.5    78      1
## 268 268 27.5         4        134.0         95   2560         14.2    78      3
## 269 269 27.2         4        119.0         97   2300         14.7    78      3
## 270 270 30.9         4        105.0         75   2230         14.5    78      1
## 271 271 21.1         4        134.0         95   2515         14.8    78      3
## 272 272 23.2         4        156.0        105   2745         16.7    78      1
## 273 273 23.8         4        151.0         85   2855         17.6    78      1
## 274 274 23.9         4        119.0         97   2405         14.9    78      3
## 275 275 20.3         5        131.0        103   2830         15.9    78      2
## 276 276 17.0         6        163.0        125   3140         13.6    78      2
## 277 277 21.6         4        121.0        115   2795         15.7    78      2
## 278 278 16.2         6        163.0        133   3410         15.8    78      2
## 279 279 31.5         4         89.0         71   1990         14.9    78      2
## 280 280 29.5         4         98.0         68   2135         16.6    78      3
## 281 281 21.5         6        231.0        115   3245         15.4    79      1
## 282 282 19.8         6        200.0         85   2990         18.2    79      1
## 283 283 22.3         4        140.0         88   2890         17.3    79      1
## 284 284 20.2         6        232.0         90   3265         18.2    79      1
## 285 285 20.6         6        225.0        110   3360         16.6    79      1
## 286 286 17.0         8        305.0        130   3840         15.4    79      1
## 287 287 17.6         8        302.0        129   3725         13.4    79      1
## 288 288 16.5         8        351.0        138   3955         13.2    79      1
## 289 289 18.2         8        318.0        135   3830         15.2    79      1
## 290 290 16.9         8        350.0        155   4360         14.9    79      1
## 291 291 15.5         8        351.0        142   4054         14.3    79      1
## 292 292 19.2         8        267.0        125   3605         15.0    79      1
## 293 293 18.5         8        360.0        150   3940         13.0    79      1
## 294 294 31.9         4         89.0         71   1925         14.0    79      2
## 295 295 34.1         4         86.0         65   1975         15.2    79      3
## 296 296 35.7         4         98.0         80   1915         14.4    79      1
## 297 297 27.4         4        121.0         80   2670         15.0    79      1
## 298 298 25.4         5        183.0         77   3530         20.1    79      2
## 299 299 23.0         8        350.0        125   3900         17.4    79      1
## 300 300 27.2         4        141.0         71   3190         24.8    79      2
## 301 301 23.9         8        260.0         90   3420         22.2    79      1
## 302 302 34.2         4        105.0         70   2200         13.2    79      1
## 303 303 34.5         4        105.0         70   2150         14.9    79      1
## 304 304 31.8         4         85.0         65   2020         19.2    79      3
## 305 305 37.3         4         91.0         69   2130         14.7    79      2
## 306 306 28.4         4        151.0         90   2670         16.0    79      1
## 307 307 28.8         6        173.0        115   2595         11.3    79      1
## 308 308 26.8         6        173.0        115   2700         12.9    79      1
## 309 309 33.5         4        151.0         90   2556         13.2    79      1
## 310 310 41.5         4         98.0         76   2144         14.7    80      2
## 311 311 38.1         4         89.0         60   1968         18.8    80      3
## 312 312 32.1         4         98.0         70   2120         15.5    80      1
## 313 313 37.2         4         86.0         65   2019         16.4    80      3
## 314 314 28.0         4        151.0         90   2678         16.5    80      1
## 315 315 26.4         4        140.0         88   2870         18.1    80      1
## 316 316 24.3         4        151.0         90   3003         20.1    80      1
## 317 317 19.1         6        225.0         90   3381         18.7    80      1
## 318 318 34.3         4         97.0         78   2188         15.8    80      2
## 319 319 29.8         4        134.0         90   2711         15.5    80      3
## 320 320 31.3         4        120.0         75   2542         17.5    80      3
## 321 321 37.0         4        119.0         92   2434         15.0    80      3
## 322 322 32.2         4        108.0         75   2265         15.2    80      3
## 323 323 46.6         4         86.0         65   2110         17.9    80      3
## 324 324 27.9         4        156.0        105   2800         14.4    80      1
## 325 325 40.8         4         85.0         65   2110         19.2    80      3
## 326 326 44.3         4         90.0         48   2085         21.7    80      2
## 327 327 43.4         4         90.0         48   2335         23.7    80      2
## 328 328 36.4         5        121.0         67   2950         19.9    80      2
## 329 329 30.0         4        146.0         67   3250         21.8    80      2
## 330 330 44.6         4         91.0         67   1850         13.8    80      3
## 331 331 40.9         4         85.0          ?   1835         17.3    80      2
## 332 332 33.8         4         97.0         67   2145         18.0    80      3
## 333 333 29.8         4         89.0         62   1845         15.3    80      2
## 334 334 32.7         6        168.0        132   2910         11.4    80      3
## 335 335 23.7         3         70.0        100   2420         12.5    80      3
## 336 336 35.0         4        122.0         88   2500         15.1    80      2
## 337 337 23.6         4        140.0          ?   2905         14.3    80      1
## 338 338 32.4         4        107.0         72   2290         17.0    80      3
## 339 339 27.2         4        135.0         84   2490         15.7    81      1
## 340 340 26.6         4        151.0         84   2635         16.4    81      1
## 341 341 25.8         4        156.0         92   2620         14.4    81      1
## 342 342 23.5         6        173.0        110   2725         12.6    81      1
## 343 343 30.0         4        135.0         84   2385         12.9    81      1
## 344 344 39.1         4         79.0         58   1755         16.9    81      3
## 345 345 39.0         4         86.0         64   1875         16.4    81      1
## 346 346 35.1         4         81.0         60   1760         16.1    81      3
## 347 347 32.3         4         97.0         67   2065         17.8    81      3
## 348 348 37.0         4         85.0         65   1975         19.4    81      3
## 349 349 37.7         4         89.0         62   2050         17.3    81      3
## 350 350 34.1         4         91.0         68   1985         16.0    81      3
## 351 351 34.7         4        105.0         63   2215         14.9    81      1
## 352 352 34.4         4         98.0         65   2045         16.2    81      1
## 353 353 29.9         4         98.0         65   2380         20.7    81      1
## 354 354 33.0         4        105.0         74   2190         14.2    81      2
## 355 355 34.5         4        100.0          ?   2320         15.8    81      2
## 356 356 33.7         4        107.0         75   2210         14.4    81      3
## 357 357 32.4         4        108.0         75   2350         16.8    81      3
## 358 358 32.9         4        119.0        100   2615         14.8    81      3
## 359 359 31.6         4        120.0         74   2635         18.3    81      3
## 360 360 28.1         4        141.0         80   3230         20.4    81      2
## 361 361 30.7         6        145.0         76   3160         19.6    81      2
## 362 362 25.4         6        168.0        116   2900         12.6    81      3
## 363 363 24.2         6        146.0        120   2930         13.8    81      3
## 364 364 22.4         6        231.0        110   3415         15.8    81      1
## 365 365 26.6         8        350.0        105   3725         19.0    81      1
## 366 366 20.2         6        200.0         88   3060         17.1    81      1
## 367 367 17.6         6        225.0         85   3465         16.6    81      1
## 368 368 28.0         4        112.0         88   2605         19.6    82      1
## 369 369 27.0         4        112.0         88   2640         18.6    82      1
## 370 370 34.0         4        112.0         88   2395         18.0    82      1
## 371 371 31.0         4        112.0         85   2575         16.2    82      1
## 372 372 29.0         4        135.0         84   2525         16.0    82      1
## 373 373 27.0         4        151.0         90   2735         18.0    82      1
## 374 374 24.0         4        140.0         92   2865         16.4    82      1
## 375 375 23.0         4        151.0          ?   3035         20.5    82      1
## 376 376 36.0         4        105.0         74   1980         15.3    82      2
## 377 377 37.0         4         91.0         68   2025         18.2    82      3
## 378 378 31.0         4         91.0         68   1970         17.6    82      3
## 379 379 38.0         4        105.0         63   2125         14.7    82      1
## 380 380 36.0         4         98.0         70   2125         17.3    82      1
## 381 381 36.0         4        120.0         88   2160         14.5    82      3
## 382 382 36.0         4        107.0         75   2205         14.5    82      3
## 383 383 34.0         4        108.0         70   2245         16.9    82      3
## 384 384 38.0         4         91.0         67   1965         15.0    82      3
## 385 385 32.0         4         91.0         67   1965         15.7    82      3
## 386 386 38.0         4         91.0         67   1995         16.2    82      3
## 387 387 25.0         6        181.0        110   2945         16.4    82      1
## 388 388 38.0         6        262.0         85   3015         17.0    82      1
## 389 389 26.0         4        156.0         92   2585         14.5    82      1
## 390 390 22.0         6        232.0        112   2835         14.7    82      1
## 391 391 32.0         4        144.0         96   2665         13.9    82      3
## 392 392 36.0         4        135.0         84   2370         13.0    82      1
## 393 393 27.0         4        151.0         90   2950         17.3    82      1
## 394 394 27.0         4        140.0         86   2790         15.6    82      1
## 395 395 44.0         4         97.0         52   2130         24.6    82      2
## 396 396 32.0         4        135.0         84   2295         11.6    82      1
## 397 397 28.0         4        120.0         79   2625         18.6    82      1
## 398 398 31.0         4        119.0         82   2720         19.4    82      1
##                                 car_name     price
## 1              chevrolet chevelle malibu 25561.591
## 2                      buick skylark 320 24221.423
## 3                     plymouth satellite 27240.844
## 4                          amc rebel sst 33684.969
## 5                            ford torino 20000.000
## 6                       ford galaxie 500 30000.000
## 7                       chevrolet impala 35764.335
## 8                      plymouth fury iii 25899.466
## 9                       pontiac catalina 32882.537
## 10                    amc ambassador dpl 32617.059
## 11                   dodge challenger se 30000.000
## 12                    plymouth 'cuda 340 33034.923
## 13                 chevrolet monte carlo 30000.000
## 14               buick estate wagon (sw) 26608.328
## 15                 toyota corona mark ii 36927.067
## 16                       plymouth duster 12561.103
## 17                            amc hornet 24260.622
## 18                         ford maverick 14228.304
## 19                          datsun pl510 15802.239
## 20          volkswagen 1131 deluxe sedan 27471.292
## 21                           peugeot 504 40000.000
## 22                           audi 100 ls 35897.440
## 23                              saab 99e 16905.843
## 24                              bmw 2002 15047.989
## 25                           amc gremlin 14045.895
## 26                             ford f250 25797.485
## 27                             chevy c20 40000.000
## 28                            dodge d200 24928.420
## 29                              hi 1200d 45072.569
## 30                          datsun pl510 16992.082
## 31                   chevrolet vega 2300 13206.433
## 32                         toyota corona 27078.798
## 33                            ford pinto 26417.435
## 34                           amc gremlin 30000.000
## 35             plymouth satellite custom 44534.971
## 36             chevrolet chevelle malibu 40000.000
## 37                       ford torino 500 30000.000
## 38                           amc matador 33970.666
## 39                      chevrolet impala 40000.000
## 40             pontiac catalina brougham 33793.723
## 41                      ford galaxie 500 30000.000
## 42                     plymouth fury iii 15358.863
## 43                     dodge monaco (sw) 23414.417
## 44              ford country squire (sw) 44211.912
## 45                   pontiac safari (sw) 20000.000
## 46            amc hornet sportabout (sw) 33328.427
## 47                   chevrolet vega (sw) 20000.000
## 48                      pontiac firebird 20000.000
## 49                          ford mustang 40000.000
## 50                    mercury capri 2000 27435.396
## 51                             opel 1900 20000.000
## 52                           peugeot 304 36587.119
## 53                             fiat 124b 23790.829
## 54                   toyota corolla 1200 30000.000
## 55                           datsun 1200 40000.000
## 56                  volkswagen model 111 30000.000
## 57                      plymouth cricket 40000.000
## 58                 toyota corona hardtop 40000.000
## 59                    dodge colt hardtop 20000.000
## 60                     volkswagen type 3 26196.505
## 61                        chevrolet vega 33019.208
## 62                   ford pinto runabout 36453.301
## 63                      chevrolet impala 40000.000
## 64                      pontiac catalina 26062.794
## 65                     plymouth fury iii 34663.839
## 66                      ford galaxie 500 20000.000
## 67                    amc ambassador sst 20000.000
## 68                       mercury marquis 16223.268
## 69                  buick lesabre custom  5975.710
## 70            oldsmobile delta 88 royale 40000.000
## 71                chrysler newport royal 33048.801
## 72                       mazda rx2 coupe 25558.031
## 73                      amc matador (sw)  1598.073
## 74      chevrolet chevelle concours (sw) 20000.000
## 75                 ford gran torino (sw) 30000.000
## 76        plymouth satellite custom (sw) 26693.718
## 77                       volvo 145e (sw) 30000.000
## 78                   volkswagen 411 (sw) 40000.000
## 79                      peugeot 504 (sw) 16035.297
## 80                       renault 12 (sw) 44239.249
## 81                       ford pinto (sw) 20000.000
## 82                       datsun 510 (sw) 36556.744
## 83           toyouta corona mark ii (sw) 30000.000
## 84                       dodge colt (sw) 20000.000
## 85              toyota corolla 1600 (sw) 35088.029
## 86                     buick century 350 20000.000
## 87                           amc matador 30000.000
## 88                      chevrolet malibu 24364.522
## 89                      ford gran torino 50306.153
## 90                  dodge coronet custom 30000.000
## 91              mercury marquis brougham 30000.000
## 92             chevrolet caprice classic 35052.192
## 93                              ford ltd 36489.401
## 94              plymouth fury gran sedan 53745.938
## 95          chrysler new yorker brougham 40000.000
## 96              buick electra 225 custom 26260.635
## 97               amc ambassador brougham 40000.000
## 98                      plymouth valiant 23283.525
## 99                 chevrolet nova custom 30000.000
## 100                           amc hornet 30000.000
## 101                        ford maverick 33726.808
## 102                      plymouth duster 25211.028
## 103              volkswagen super beetle 35994.526
## 104                     chevrolet impala 24794.074
## 105                         ford country 20000.000
## 106               plymouth custom suburb 34078.914
## 107             oldsmobile vista cruiser 34538.974
## 108                          amc gremlin 17410.015
## 109                        toyota carina 40000.000
## 110                       chevrolet vega 43478.058
## 111                           datsun 610 20000.000
## 112                            maxda rx3 47897.350
## 113                           ford pinto 40000.000
## 114                     mercury capri v6 30000.000
## 115                 fiat 124 sport coupe 20000.000
## 116              chevrolet monte carlo s 26355.640
## 117                   pontiac grand prix 27104.012
## 118                             fiat 128 30000.000
## 119                           opel manta 30000.000
## 120                           audi 100ls 36717.904
## 121                          volvo 144ea 30000.000
## 122                    dodge dart custom 40000.000
## 123                            saab 99le 30000.000
## 124                       toyota mark ii 30000.000
## 125                     oldsmobile omega  9006.649
## 126                      plymouth duster 20000.000
## 127                        ford maverick 36836.739
## 128                           amc hornet 30000.000
## 129                       chevrolet nova 34166.890
## 130                          datsun b210 30000.000
## 131                           ford pinto 40000.000
## 132                  toyota corolla 1200 50430.443
## 133                       chevrolet vega 30000.000
## 134    chevrolet chevelle malibu classic 20000.000
## 135                          amc matador 35815.107
## 136           plymouth satellite sebring 30000.000
## 137                     ford gran torino 27027.841
## 138             buick century luxus (sw) 20000.000
## 139            dodge coronet custom (sw) 30000.000
## 140                ford gran torino (sw) 43956.273
## 141                     amc matador (sw) 30000.000
## 142                             audi fox 27392.704
## 143                    volkswagen dasher 40000.000
## 144                           opel manta 10064.418
## 145                        toyota corona 20000.000
## 146                           datsun 710 22599.021
## 147                           dodge colt 30000.000
## 148                             fiat 128 36359.772
## 149                          fiat 124 tc 24285.003
## 150                          honda civic 30000.000
## 151                               subaru 26414.508
## 152                            fiat x1.9  8068.232
## 153              plymouth valiant custom 20000.000
## 154                       chevrolet nova 35725.202
## 155                      mercury monarch 12388.960
## 156                        ford maverick 30000.000
## 157                     pontiac catalina 40000.000
## 158                    chevrolet bel air  8844.147
## 159                  plymouth grand fury  7250.279
## 160                             ford ltd 40000.000
## 161                        buick century 43913.818
## 162            chevroelt chevelle malibu 16545.010
## 163                          amc matador 25349.777
## 164                        plymouth fury 30000.000
## 165                        buick skyhawk 34085.806
## 166                  chevrolet monza 2+2 30000.000
## 167                      ford mustang ii 34458.387
## 168                       toyota corolla 30000.000
## 169                           ford pinto 16968.556
## 170                          amc gremlin 22601.178
## 171                        pontiac astro 30000.000
## 172                        toyota corona  5579.396
## 173                    volkswagen dasher 34295.657
## 174                           datsun 710 24359.886
## 175                           ford pinto 40000.000
## 176                    volkswagen rabbit 23555.606
## 177                            amc pacer 25780.198
## 178                           audi 100ls 16577.463
## 179                          peugeot 504 30000.000
## 180                          volvo 244dl 40000.000
## 181                            saab 99le 17080.979
## 182                     honda civic cvcc 25436.922
## 183                             fiat 131 37495.996
## 184                            opel 1900 23325.547
## 185                             capri ii 30000.000
## 186                           dodge colt 33128.294
## 187                         renault 12tl 30000.000
## 188    chevrolet chevelle malibu classic 25546.687
## 189               dodge coronet brougham 20000.000
## 190                          amc matador 20000.000
## 191                     ford gran torino 47075.035
## 192                     plymouth valiant 40000.000
## 193                       chevrolet nova 44633.994
## 194                        ford maverick 50179.779
## 195                           amc hornet 13136.848
## 196                   chevrolet chevette 40000.000
## 197                      chevrolet woody 30000.000
## 198                            vw rabbit 20000.000
## 199                          honda civic 40000.000
## 200                       dodge aspen se 30000.000
## 201                    ford granada ghia 26411.473
## 202                   pontiac ventura sj 26090.279
## 203                        amc pacer d/l 30000.000
## 204                    volkswagen rabbit 23640.679
## 205                         datsun b-210 34072.299
## 206                       toyota corolla 22682.074
## 207                           ford pinto 40000.000
## 208                            volvo 245 40000.000
## 209           plymouth volare premier v8 22781.281
## 210                          peugeot 504 26121.736
## 211                       toyota mark ii 14501.049
## 212                   mercedes-benz 280s 24937.676
## 213                     cadillac seville 16557.225
## 214                            chevy c10 30000.000
## 215                            ford f108 20000.000
## 216                           dodge d100 20000.000
## 217                    honda accord cvcc 16288.278
## 218              buick opel isuzu deluxe 25530.810
## 219                        renault 5 gtl 20000.000
## 220                    plymouth arrow gs 30000.000
## 221                datsun f-10 hatchback 30000.000
## 222            chevrolet caprice classic 30000.000
## 223           oldsmobile cutlass supreme 30000.000
## 224                dodge monaco brougham 40000.000
## 225              mercury cougar brougham 20000.000
## 226                   chevrolet concours 20000.000
## 227                        buick skylark 30000.000
## 228               plymouth volare custom 26631.006
## 229                         ford granada 36453.916
## 230                pontiac grand prix lj 16330.963
## 231         chevrolet monte carlo landau 40000.000
## 232                     chrysler cordoba 20000.000
## 233                     ford thunderbird 40000.000
## 234             volkswagen rabbit custom 44398.390
## 235                pontiac sunbird coupe 22768.363
## 236              toyota corolla liftback 24051.712
## 237                  ford mustang ii 2+2 30000.000
## 238                   chevrolet chevette 40000.000
## 239                       dodge colt m/m 36578.745
## 240                            subaru dl 32735.658
## 241                    volkswagen dasher 20000.000
## 242                           datsun 810 42883.256
## 243                             bmw 320i 23927.442
## 244                           mazda rx-4 23761.784
## 245      volkswagen rabbit custom diesel 30000.000
## 246                          ford fiesta 30000.000
## 247                     mazda glc deluxe 32914.193
## 248                       datsun b210 gx 40000.000
## 249                     honda civic cvcc 30000.000
## 250    oldsmobile cutlass salon brougham 30000.000
## 251                       dodge diplomat 40000.000
## 252                 mercury monarch ghia 34088.830
## 253                   pontiac phoenix lj 30000.000
## 254                     chevrolet malibu 20000.000
## 255                 ford fairmont (auto) 30000.000
## 256                  ford fairmont (man) 40000.000
## 257                      plymouth volare 30000.000
## 258                          amc concord 30000.000
## 259                buick century special 40000.000
## 260                       mercury zephyr 33560.688
## 261                          dodge aspen 33043.991
## 262                      amc concord d/l 25625.972
## 263         chevrolet monte carlo landau 50024.689
## 264      buick regal sport coupe (turbo) 20000.000
## 265                          ford futura 35375.464
## 266                      dodge magnum xe 26331.123
## 267                   chevrolet chevette 49295.848
## 268                        toyota corona 30000.000
## 269                           datsun 510 35110.420
## 270                           dodge omni 24166.911
## 271            toyota celica gt liftback 14511.795
## 272                     plymouth sapporo 36338.235
## 273               oldsmobile starfire sx 30000.000
## 274                        datsun 200-sx 47709.821
## 275                            audi 5000 43261.830
## 276                          volvo 264gl 44815.879
## 277                           saab 99gle 47597.903
## 278                        peugeot 604sl 23051.895
## 279                  volkswagen scirocco 30000.000
## 280                      honda accord lx 20000.000
## 281                    pontiac lemans v6 20000.000
## 282                     mercury zephyr 6 37443.856
## 283                      ford fairmont 4 20000.000
## 284                     amc concord dl 6 12840.579
## 285                        dodge aspen 6 26927.116
## 286            chevrolet caprice classic 30000.000
## 287                      ford ltd landau 52480.068
## 288                mercury grand marquis 13073.585
## 289                      dodge st. regis  8766.445
## 290              buick estate wagon (sw) 24606.122
## 291             ford country squire (sw) 25696.089
## 292        chevrolet malibu classic (sw) 26157.235
## 293 chrysler lebaron town @ country (sw) 14944.488
## 294                     vw rabbit custom 40000.000
## 295                     maxda glc deluxe 20000.000
## 296          dodge colt hatchback custom 44271.593
## 297                        amc spirit dl 40000.000
## 298                   mercedes benz 300d 20000.000
## 299                    cadillac eldorado 44274.407
## 300                          peugeot 504 24639.374
## 301    oldsmobile cutlass salon brougham 33062.120
## 302                     plymouth horizon 30000.000
## 303                 plymouth horizon tc3 22906.701
## 304                           datsun 210 30000.000
## 305                   fiat strada custom 30000.000
## 306                buick skylark limited 33322.520
## 307                   chevrolet citation 30000.000
## 308            oldsmobile omega brougham 45923.536
## 309                      pontiac phoenix 49548.623
## 310                            vw rabbit 48911.314
## 311                toyota corolla tercel 20000.000
## 312                   chevrolet chevette  8400.697
## 313                           datsun 310 34035.285
## 314                   chevrolet citation 34799.282
## 315                        ford fairmont 17032.345
## 316                          amc concord 30000.000
## 317                          dodge aspen 30000.000
## 318                            audi 4000 40000.000
## 319               toyota corona liftback 40000.000
## 320                            mazda 626 27206.138
## 321                 datsun 510 hatchback 47697.077
## 322                       toyota corolla 30000.000
## 323                            mazda glc 30000.000
## 324                           dodge colt 52035.834
## 325                           datsun 210 26407.844
## 326                 vw rabbit c (diesel) 51239.144
## 327                   vw dasher (diesel) 40000.000
## 328                  audi 5000s (diesel) 44494.544
## 329                   mercedes-benz 240d 20000.000
## 330                  honda civic 1500 gl 20000.000
## 331                 renault lecar deluxe 32650.652
## 332                            subaru dl 35335.983
## 333                     vokswagen rabbit 30000.000
## 334                        datsun 280-zx 25944.325
## 335                        mazda rx-7 gs 44730.246
## 336                    triumph tr7 coupe 30000.000
## 337                   ford mustang cobra 24749.737
## 338                         honda accord 40000.000
## 339                     plymouth reliant 43221.372
## 340                        buick skylark 20000.000
## 341               dodge aries wagon (sw) 11460.906
## 342                   chevrolet citation 40000.000
## 343                     plymouth reliant 33838.413
## 344                       toyota starlet 30000.000
## 345                       plymouth champ 24040.393
## 346                     honda civic 1300 26717.101
## 347                               subaru 13900.615
## 348                       datsun 210 mpg 17268.170
## 349                        toyota tercel 50475.688
## 350                          mazda glc 4 49150.576
## 351                   plymouth horizon 4 30000.000
## 352                       ford escort 4w 20000.000
## 353                       ford escort 2h 20000.000
## 354                     volkswagen jetta 30000.000
## 355                          renault 18i 30000.000
## 356                        honda prelude 20000.000
## 357                       toyota corolla 30000.000
## 358                         datsun 200sx 30000.000
## 359                            mazda 626 40000.000
## 360            peugeot 505s turbo diesel 20000.000
## 361                         volvo diesel 40000.000
## 362                      toyota cressida 30000.000
## 363                    datsun 810 maxima 32646.400
## 364                        buick century 25571.469
## 365                oldsmobile cutlass ls 30000.000
## 366                      ford granada gl 30000.000
## 367               chrysler lebaron salon 23723.775
## 368                   chevrolet cavalier 27234.664
## 369             chevrolet cavalier wagon 42666.914
## 370            chevrolet cavalier 2-door 40000.000
## 371           pontiac j2000 se hatchback 27074.395
## 372                       dodge aries se 20000.000
## 373                      pontiac phoenix 33111.138
## 374                 ford fairmont futura 51186.915
## 375                       amc concord dl 37179.288
## 376                  volkswagen rabbit l 33472.791
## 377                   mazda glc custom l 44607.866
## 378                     mazda glc custom 34686.423
## 379               plymouth horizon miser 48111.102
## 380                       mercury lynx l 30000.000
## 381                     nissan stanza xe 34612.009
## 382                         honda accord 30000.000
## 383                       toyota corolla 30000.000
## 384                          honda civic 30000.000
## 385                   honda civic (auto) 30000.000
## 386                        datsun 310 gx 30000.000
## 387                buick century limited 25289.834
## 388    oldsmobile cutlass ciera (diesel)  9944.306
## 389           chrysler lebaron medallion 34986.218
## 390                       ford granada l 22973.019
## 391                     toyota celica gt 20000.000
## 392                    dodge charger 2.2 17421.627
## 393                     chevrolet camaro 12550.000
## 394                      ford mustang gl 13432.500
## 395                            vw pickup 37000.000
## 396                        dodge rampage 47800.000
## 397                          ford ranger 46000.000
## 398                           chevy s-10  9000.000

Five Number Summary of Weight

The following gives the mean, median, and five number summary of all of the weight values from the dataset:

mean(carsData$weight)
## [1] 2970.425
median(carsData$weight)
## [1] 2803.5
fivenum(carsData$weight)
## [1] 1613.0 2223.0 2803.5 3609.0 5140.0

Does Weight have any Outliers?

IQR <- IQR(carsData$weight)
IQR
## [1] 1384.25
Upperfence <- 3609.0 + 1.5*(IQR)
Upperfence
## [1] 5685.375
Lowerfence <- 2223.0 - 1.5*(IQR)
Lowerfence
## [1] 146.625

Both the upper and lower fence are outside the range of the data, so there are no outliers.

Compare Displacement to mpg, filtered by number of cylinders

## `geom_smooth()` using formula = 'y ~ x'

Weight Compared to Acceleration

## `geom_smooth()` using formula = 'y ~ x'

Price by Model

Horsepower, Weight, and mpg Viewed in a 3D Graph

Conclusions

From the previous slides, we obtain the following conclusions about the data:

  • The weight of cars is relatively consistent, given that there are no outliers.
  • Displacement and mpg have an inverse relation, and a higher number of cylinders generally results in higher displacement and lower mpg.
  • Weight and acceleration have an inverse relationship, though there are many points on the graph that do not follow the linear regression, so there are likely other factors that determine acceleration.
  • There is unlikely to be a relationship between price and model.
  • A higher weight is associated with higher horsepower but a lower mpg.