Brief description of your project.
| #The spreadsheets we are working with collected data on 615 vehicles in 2014 and 336 vehicles in 2018. For each vechicle the Make, Model, Combined Gas Mileage, City Gas Mileage, Highway Gas Mileage, Engine Displacement, Cylinder Count, Sales Area, Underhood Idenfication Number, Transmission Type, Drivetrain, Fuel Type, Emissions Standard Code, Vehicle Class, Smog Rating, Greenhouse Gas Rating, and SmartWay Rating were collected. All of these measures are assumed to have an effect on gas mileage. SmartWay is a program of the Environmental Protection Agency that acts as a source to benchmark, measure, and improve upon the efficency of freight transportation. #Patterns: Greenhouse Gas Rating appears to be a large driver of Combined MPG. The top 3 drivers of Combined MPG are Greenhouse Gas Rating and Engine Displacment, Greenhouse Gas Rating and Vehicle Class, and Greenhouse Gas Rating and Fuel Type. The most popular Engine Displacment by Vehicle Type is second largest category. All vehicle classes have at least one model with an Engine Displacment between 2.34-2.92 liters. 5 vehicle classes have at least one model with an engine displacment between 1.76-2.34 liters, 2.92-3.5 liters, or an electric motor. The most popular Values for Transmission Type are Semi-Automatic 6 speed with 117 vehicles, Manual 6 speed with 103 vehicles, and then Continously Variable Clutch with 99. #Descriptive Statisticstics: The model surveyed most was the Mazada 3 for 16 vehicles followed by the Honda Accord for 13 vehicles and then the Honda Civic for 12 vehicles. The most popular displacement was 2 liters for 146 vehicles followed by 1.6 liters for 103 vehicles and 1.8 liters for 92 vehicles. SemiAuto-6 for 117 vehicles, Man-6 for 103 vehicles, and CVT for 99 vehicles were the most popular transmissions. There were way more 2WD vehicles at 519 than 4WD vehicles at 78. The most popular fuel for vehicles was gasoline at 527, then Electricity at 28, and finally Gasoline/Electricity at 18. U2 was most widely used standarad for fuel emission for 192 vehicles. This was followed by B5 for 102 vehicles and then PZEV for 77 vehicles. There were mostly small cars surveyed at 312, followed by midsize cars at 187, and then small SUV at 42. Median and mean smog ratings were 6 and 6.732 respectively, with the max value being 10 and the minimum value being 5. The smog rating data has a positve skew across the surveyed vehicles. The Combined MPG that was most popular was 30 for 100 vehicles, then 26 for 86 vehicles, and finally 31 for 64 vehicles. The Greenhouse Gas Rating was a minimum value of 7 and a maximum value of 10, with the mean being 7.898 and a median of 8. The Greenhouse Gas Rating data is evenly distributed across the survey models. All of the vehicles are SmartWay certified and 40 of those vehicles are Elite SmartWay certified. ## Resources Packages Use on this notebook |
Install required packages
# Here we are checking if the package is installed
if(!require("tidyverse")){
# If the package is not in the system then it will be install
install.packages("tidyverse", dependencies = TRUE)
# Here we are loading the package
library("tidyverse")
}
Loading required package: tidyverse
[30m-- [1mAttaching packages[22m --------------------------------------- tidyverse 1.2.1 --[39m
[30m[32mv[30m [34mggplot2[30m 2.2.1 [32mv[30m [34mpurrr [30m 0.2.4
[32mv[30m [34mtibble [30m 1.4.2 [32mv[30m [34mdplyr [30m 0.7.4
[32mv[30m [34mtidyr [30m 0.8.0 [32mv[30m [34mstringr[30m 1.2.0
[32mv[30m [34mreadr [30m 1.1.1 [32mv[30m [34mforcats[30m 0.2.0[39m
[30m-- [1mConflicts[22m ------------------------------------------ tidyverse_conflicts() --
[31mx[30m [34mdplyr[30m::[32mfilter()[30m masks [34mstats[30m::filter()
[31mx[30m [34mdplyr[30m::[32mlag()[30m masks [34mstats[30m::lag()[39m
# Here we are checking if the package is installed
if(!require("corrplot")){
# If the package is not in the system then it will be install
install.packages("corrplot", dependencies = TRUE)
# Here we are loading the package
library("corrplot")
}
Loading required package: corrplot
package <U+393C><U+3E31>corrplot<U+393C><U+3E32> was built under R version 3.4.4corrplot 0.84 loaded
Loading required package: lpSolveAPI
mydata=read.csv("Original SmartWay Vehicle List for MY 2014.csv")
head(mydata)
summary(mydata)
Model Displ Cyl Trans Drive
:1300 :1300 :1300 :1300 :1300
MAZDA 3 : 16 2 : 162 2 : 2 SemiAuto-6: 117 2WD: 535
VOLKSWAGEN Jetta : 14 1.6 : 103 3 : 14 Man-6 : 111 4WD: 79
HONDA Accord : 13 1.8 : 92 4 : 525 CVT : 99
HONDA Civic : 12 2.5 : 59 5 : 8 Auto-6 : 53
VOLKSWAGEN Beetle: 10 2.4 : 44 6 : 35 Man-5 : 49
(Other) : 549 (Other): 154 N/A: 30 (Other) : 185
Fuel Sales.Area Stnd
:1300 :1300 :1300
Gasoline : 527 CA: 350 U2 : 192
Electricity : 28 FA: 212 B5 : 102
Diesel : 27 FC: 52 PZEV : 77
Gasoline/Electricity: 18 B3 : 68
Ethanol/Gas : 10 B4 : 54
(Other) : 4 (Other): 121
Stnd.Description Underhood.ID Veh.Class
:1300 :1300 :1300
California LEV-II ULEV: 192 EBMXV01.6N18: 44 large car : 22
Federal Tier 2 Bin 5 : 102 EBMXV01.6N16: 26 midsize car : 189
California PZEV : 77 EVWXV02.03PA: 24 small car : 324
Federal Tier 2 Bin 3 : 68 EBMXJ02.0N20: 20 small SUV : 42
Federal Tier 2 Bin 4 : 54 EGMXV01.8011: 20 standard SUV : 8
(Other) : 121 (Other) : 480 station wagon: 29
Smog.Rating City.MPG Hwy.MPG Cmb.MPG Greenhouse.Gas.Rating
:1300 :1300 :1300 :1300 :1300
6 : 258 26 : 71 35 : 101 30 : 102 10 : 59
5 : 110 27 : 69 36 : 56 26 : 86 7 : 241
9 : 99 25 : 65 37 : 53 31 : 65 8 : 235
7 : 70 24 : 60 34 : 48 28 : 62 9 : 62
10 : 30 28 : 57 33 : 43 27 : 48 Mod: 17
(Other): 47 (Other): 292 (Other): 313 (Other): 251
SmartWay
:1300
Elite: 40
yes : 1
Yes : 573
#Descriptive Statisticstics: The model surveyed most was the Mazada 3 for 16 vehicles followed by the Volkswagen Jetta for 14 vehicles and then the Honda Accord for 13 vehicles. The most popular displacement was 2 liters for 162 vehicles followed by 1.6 liters for 103 vehicles and 1.8 liters for 92 vehicles. SemiAuto-6 for 117 vehicles, Man-6 for 111 vehicles, and CVT for 99 vehicles were the most popular transmissions. The most popular cylinder count was 4 at 525, then 5 at 35, and N/A at 30. There were way more 2WD vehicles at 535 than 4WD vehicles at 79. The most popular fuel for vehicles was gasoline at 527, then Electricity at 28, and finally Diesel at 27. The most popular sales was CA 350, then FA at 212, and FC at 212. U2 was most widely used standarad for fuel emission for 192 vehicles. This was followed by B5 for 102 vehicles and then PZEV for 77 vehicles. The most popular standard decription will be California LEV-II at 192, then 121 for (other), and finally 102 for Federal Tier 2 Bin 5. The underhood had a most popular type of EBMXV01.6N18 at 44, EBXV01.6N16 at 26, and finally EVWXV02.03PA at 24. There were mostly small cars surveyed at 324, followed by midsize cars at 189, and then small SUV at 42. The most popular smog rating was 6 at 258, and then 5 at 110, and finally 9 at 99. 26 was the most popular city MPG at 71. 27 was second most popular city MPG at 69, and finally the third most popular 25 at 65. The most popular highway MPG was 35 at 101, 36 at 56, and 37 at 53. The Combined MPG that was most popular was 30 for 102 vehicles, then 26 for 86 vehicles, and finally 31 for 65 vehicles. The Greenhouse gas rating of 7 was most popular at 241, the rating of 8 was second most popular at 235, and the rating of 9 was thrid most popular at 62. Only 574 cars are Smartway Certified, and 40 of those SmartWay certified cars are elite.