HW3

Electric Vehicle Data Analysis

Nasko
2022-06-10

Data Overview

 [1] "ID"                                               
 [2] "VIN (1-10)"                                       
 [3] "County"                                           
 [4] "City"                                             
 [5] "State"                                            
 [6] "ZIP Code"                                         
 [7] "Model Year"                                       
 [8] "Make"                                             
 [9] "Model"                                            
[10] "Electric Vehicle Type"                            
[11] "Clean Alternative Fuel Vehicle (CAFV) Eligibility"
[12] "Electric Range"                                   
[13] "Base MSRP"                                        
[14] "Legislative District"                             
[15] "DOL Vehicle ID"                                   
[16] "Vehicle Location"                                 
[17] "Electric Utility"                                 
[18] "Expected Price ($1k)"                             
      ID             VIN (1-10)           County         
 Length:64353       Length:64353       Length:64353      
 Class :character   Class :character   Class :character  
 Mode  :character   Mode  :character   Mode  :character  
                                                         
                                                         
                                                         
                                                         
     City              State              ZIP Code       Model Year  
 Length:64353       Length:64353       Min.   :  745   Min.   :1993  
 Class :character   Class :character   1st Qu.:98052   1st Qu.:2017  
 Mode  :character   Mode  :character   Median :98121   Median :2018  
                                       Mean   :98143   Mean   :2018  
                                       3rd Qu.:98370   3rd Qu.:2021  
                                       Max.   :99701   Max.   :2022  
                                       NA's   :6       NA's   :7     
     Make              Model           Electric Vehicle Type
 Length:64353       Length:64353       Length:64353         
 Class :character   Class :character   Class :character     
 Mode  :character   Mode  :character   Mode  :character     
                                                            
                                                            
                                                            
                                                            
 Clean Alternative Fuel Vehicle (CAFV) Eligibility Electric Range 
 Length:64353                                      Min.   :  0.0  
 Class :character                                  1st Qu.: 14.0  
 Mode  :character                                  Median : 73.0  
                                                   Mean   :106.9  
                                                   3rd Qu.:215.0  
                                                   Max.   :337.0  
                                                                  
   Base MSRP      Legislative District DOL Vehicle ID     
 Min.   :     0   Min.   : 0.00        Min.   :     4385  
 1st Qu.:     0   1st Qu.:19.00        1st Qu.:137286488  
 Median :     0   Median :34.00        Median :175377597  
 Mean   :  2525   Mean   :29.95        Mean   :197290491  
 3rd Qu.:     0   3rd Qu.:43.00        3rd Qu.:229903894  
 Max.   :845000   Max.   :49.00        Max.   :478934571  
                  NA's   :169                             
 Vehicle Location   Electric Utility   Expected Price ($1k)
 Length:64353       Length:64353       Min.   :   0.00     
 Class :character   Class :character   1st Qu.:  22.86     
 Mode  :character   Mode  :character   Median :  40.00     
                                       Mean   :  45.45     
                                       3rd Qu.:  65.90     
                                       Max.   :1100.00     
                                       NA's   :13          

VIN (1-10) - The 1st 10 characters of each vehicle’s Vehicle Identification Number (VIN).
County - The county in which the registered owner resides.
City - The city in which the registered owner resides.
State- The state in which the registered owner resides.
ZIP Code - The 5-digit zip code in which the registered owner resides.
Model Year - The model year of the vehicle is determined by decoding the Vehicle Identification Number (VIN).
Make - The manufacturer of the vehicle, determined by decoding the Vehicle Identification Number (VIN).
Model- The model of the vehicle is determined by decoding the Vehicle Identification Number (VIN).
Electric Vehicle Type - This distinguishes the vehicle as all-electric or a plug-in hybrid.
Clean Alternative Fuel Vehicle (CAFV) Eligibility - This categorizes vehicles as Clean Alternative Fuel Vehicles (CAFVs) based on the fuel requirement and electric-only range requirement.
Electric Range - Describes how far a vehicle can travel purely on its electric charge.
Base MSRP - This is the lowest Manufacturer’s Suggested Retail Price (MSRP) for any trim level of the model in question.
Legislative District - The specific section of Washington State that the vehicle’s owner resides in, as represented in the state legislature.
DOL Vehicle ID - Unique number assigned to each vehicle by the Department of Licensing for identification purposes.
Vehicle Location - The center of the ZIP Code for the registered vehicle.
Electric Utility - This is the electric power retail service territory serving the address of the registered vehicle.
Expected Price - This is the expected price of the vehicle.

Research Question

Based on the visualizations and data wrangling, I am interested in exploring the relationship between the electric range of a vehicle and its expected price. I will look into the effect of Model and Make on the price and how this may vary across cities and states. Another area of interest is to generate a heatmap overlay onto a geospatial layer (map) displaying the most popular EV brands across the country. Finally, I will explore how potentil EV buyers may maximize their utility by purchasing a vehicle which fits their personal criteria by writing a function that takes certain parameters such as Electric Range and Expected Price and yields the optimal result.

# A tibble: 6 × 18
  ID     `VIN (1-10)` County City  State `ZIP Code` `Model Year` Make 
  <chr>  <chr>        <chr>  <chr> <chr>      <dbl>        <dbl> <chr>
1 EV331… 5YJ3E1EC6L   Snoho… LYNN… WA         98037         2020 TESLA
2 EV402… JN1AZ0CP8B   Skagit BELL… WA         98229         2011 NISS…
3 EV122… WBY1Z2C56F   Pierce TACO… WA         98422         2015 BMW  
4 EV557… 1G1RD6E44D   King   REDM… WA         98053         2013 CHEV…
5 EV287… 1G1FY6S05K   Pierce PUYA… WA         98375         2019 CHEV…
6 EV498… KMHE24L10G   Clark  VANC… WA         98683         2016 HYUN…
# … with 10 more variables: Model <chr>,
#   `Electric Vehicle Type` <chr>,
#   `Clean Alternative Fuel Vehicle (CAFV) Eligibility` <chr>,
#   `Electric Range` <dbl>, `Base MSRP` <dbl>,
#   `Legislative District` <dbl>, `DOL Vehicle ID` <dbl>,
#   `Vehicle Location` <chr>, `Electric Utility` <chr>,
#   `Expected Price ($1k)` <dbl>

This histogram tells us that the median TSLA price is in the $60-$70K range.

# A tibble: 16,156 × 6
# Groups:   Make, Model [28]
   Model   Make     `Electric Vehi…` `Clean Alterna…` `Electric Range`
   <chr>   <chr>    <chr>            <chr>                       <dbl>
 1 LEAF    NISSAN   Battery Electri… Clean Alternati…               73
 2 I3      BMW      Battery Electri… Clean Alternati…               81
 3 BOLT EV CHEVROL… Battery Electri… Clean Alternati…              259
 4 LEAF    NISSAN   Battery Electri… Clean Alternati…              107
 5 LEAF    NISSAN   Battery Electri… Clean Alternati…               84
 6 LEAF    NISSAN   Battery Electri… Clean Alternati…               75
 7 I3      BMW      Plug-in Hybrid … Clean Alternati…               97
 8 I3      BMW      Plug-in Hybrid … Clean Alternati…               72
 9 NIRO    KIA      Battery Electri… Clean Alternati…              239
10 SOUL EV KIA      Battery Electri… Clean Alternati…              111
# … with 16,146 more rows, and 1 more variable:
#   `Expected Price ($1k)` <dbl>

This dataset give the Vehicles whose electric range is over 50 miles with a single charge and their expected price does not exceed 35K. This may be helpful when comparing affordable and pragmatic EV options.

Conclusion

The visualizations and data wrangling displayed here are an initial step in analyzing and drawing insights from the EV dataset.