In America, automobile prices slightly fluctuate at all times throughout the year for various reasons, but significant changes in the automobile market can be analyzed and interpreted in order to determine the effects of large-scale events on the car market. Data on the automobile market is fairly extensive but is usually only compared when the cars are new and compared among each other to determine which car is superior in certain aspects. The goal of this project is to analyze used car data along with new car sales data to better understand the effects large scale events, especially the recent COVID-19 pandemic, on the car market and to see if any differences or trends in the analysis are noteworthy.
Data from analyzing the car market is useful in determining what factors can affect the car market and finding any trends in both used and new cars sold. This information can be extremely important and helpful to both manufacturers in determining the best way to improve profits and to consumers in determining which car to purchase.
These are only some aspects of how data science is useful in the automobile industry, you can find some more information here: https://www.datacamp.com/community/blog/automotive-data-science
The goal of this tutorial will be to obtain used car information of previous years and sales data of recent years in order to generate graphs and models that can help visualize the direction and key aspects of automobile market in America
To start this project, we will need to import some libraries in order to collect the necessary data. If any of these library packages are not installed already, just use following code to install them:
pip install {package name}
import requests
import statsmodels.formula.api as smf
from sklearn.linear_model import LinearRegression
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
import datetime
import lxml
Then we will download the used car csv data from kaggle.com, specifically https://www.kaggle.com/austinreese/craigslist-carstrucks-data. This data is raw postings of used cars from craigslist that needs to be modified/proccessed before we can reliably use it for data analyzing.
We make use of Pandas and NumPy to manipulate our data in dataframes. Below is the documentation of these libraries that provide more in depth functionality notes:
First, we read the data from vehicles.csv into a dataframe
df_used = pd.read_csv('vehicles.csv')
df_used
| id | url | region | region_url | price | year | manufacturer | model | condition | cylinders | ... | size | type | paint_color | image_url | description | county | state | lat | long | posting_date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 7222695916 | https://prescott.craigslist.org/cto/d/prescott... | prescott | https://prescott.craigslist.org | 6000 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | az | NaN | NaN | NaN | 
| 1 | 7218891961 | https://fayar.craigslist.org/ctd/d/bentonville... | fayetteville | https://fayar.craigslist.org | 11900 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | ar | NaN | NaN | NaN | 
| 2 | 7221797935 | https://keys.craigslist.org/cto/d/summerland-k... | florida keys | https://keys.craigslist.org | 21000 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | fl | NaN | NaN | NaN | 
| 3 | 7222270760 | https://worcester.craigslist.org/cto/d/west-br... | worcester / central MA | https://worcester.craigslist.org | 1500 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | ma | NaN | NaN | NaN | 
| 4 | 7210384030 | https://greensboro.craigslist.org/cto/d/trinit... | greensboro | https://greensboro.craigslist.org | 4900 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | nc | NaN | NaN | NaN | 
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | 
| 426875 | 7301591192 | https://wyoming.craigslist.org/ctd/d/atlanta-2... | wyoming | https://wyoming.craigslist.org | 23590 | 2019.0 | nissan | maxima s sedan 4d | good | 6 cylinders | ... | NaN | sedan | NaN | https://images.craigslist.org/00o0o_iiraFnHg8q... | Carvana is the safer way to buy a car During t... | NaN | wy | 33.786500 | -84.445400 | 2021-04-04T03:21:31-0600 | 
| 426876 | 7301591187 | https://wyoming.craigslist.org/ctd/d/atlanta-2... | wyoming | https://wyoming.craigslist.org | 30590 | 2020.0 | volvo | s60 t5 momentum sedan 4d | good | NaN | ... | NaN | sedan | red | https://images.craigslist.org/00x0x_15sbgnxCIS... | Carvana is the safer way to buy a car During t... | NaN | wy | 33.786500 | -84.445400 | 2021-04-04T03:21:29-0600 | 
| 426877 | 7301591147 | https://wyoming.craigslist.org/ctd/d/atlanta-2... | wyoming | https://wyoming.craigslist.org | 34990 | 2020.0 | cadillac | xt4 sport suv 4d | good | NaN | ... | NaN | hatchback | white | https://images.craigslist.org/00L0L_farM7bxnxR... | Carvana is the safer way to buy a car During t... | NaN | wy | 33.779214 | -84.411811 | 2021-04-04T03:21:17-0600 | 
| 426878 | 7301591140 | https://wyoming.craigslist.org/ctd/d/atlanta-2... | wyoming | https://wyoming.craigslist.org | 28990 | 2018.0 | lexus | es 350 sedan 4d | good | 6 cylinders | ... | NaN | sedan | silver | https://images.craigslist.org/00z0z_bKnIVGLkDT... | Carvana is the safer way to buy a car During t... | NaN | wy | 33.786500 | -84.445400 | 2021-04-04T03:21:11-0600 | 
| 426879 | 7301591129 | https://wyoming.craigslist.org/ctd/d/atlanta-2... | wyoming | https://wyoming.craigslist.org | 30590 | 2019.0 | bmw | 4 series 430i gran coupe | good | NaN | ... | NaN | coupe | NaN | https://images.craigslist.org/00Y0Y_lEUocjyRxa... | Carvana is the safer way to buy a car During t... | NaN | wy | 33.779214 | -84.411811 | 2021-04-04T03:21:07-0600 | 
426880 rows × 26 columns
Next, we will scrape www.goodcarbadcar.net using the requests library in order to gain sales records of cars in 2019 and 2020 and up to Sept 2021. Use following header to act as a browser when making request in order to have access to the site to scrape data
URL = "https://www.goodcarbadcar.net/2020-us-vehicle-sales-figures-by-model/"
header = {
  "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
  "X-Requested-With": "XMLHttpRequest"
}
r = requests.get(URL, headers=header)
tables = pd.read_html(r.text,match="Model")
df2020 = tables[0]
URL = "https://www.goodcarbadcar.net/2019-us-vehicle-sales-figures-by-model/"
header = {
  "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
  "X-Requested-With": "XMLHttpRequest"
}
r = requests.get(URL, headers=header)
tables = pd.read_html(r.text,match="Model")
df2019 = tables[1]
URL = "https://www.goodcarbadcar.net/2021-us-vehicle-sales-figures-by-model/"
header = {
  "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
  "X-Requested-With": "XMLHttpRequest"
}
r = requests.get(URL, headers=header)
tables = pd.read_html(r.text,match="Model")
df2021 = tables[1]
We need to change the type of posting date to datetime, remove unnecessary columns, remove blank cells, and create a new column called supertype for better analysis We accomplish all of this in the following code blocks.
# Vehicles Data:
# drop first 29 rows as they are junk
dfu = df_used.iloc[30:]
# keep only necessary columns of used vehicles data and rename manufacturer to make
dfu = dfu[['price','year','manufacturer','model','condition','fuel','transmission','type','state','posting_date']]
dfu = dfu.rename(columns={'manufacturer': 'Make', 'model': 'Model'})
# remove cells with NAN/blank for make, model, price, or year
# Note: There are nan conditions,these are probably cars that are in poor or average condition(bias), 
#       because sellers/posters would be more likely to include condition in posting if the car were in good or excellent condition
dfu.replace(r'^\s*$', np.nan, regex=True)
dfu = dfu[dfu['Make'].notna()]
dfu = dfu[dfu['Model'].notna()]
dfu = dfu[dfu['year'].notna()]
dfu.head()
| price | year | Make | Model | condition | fuel | transmission | type | state | posting_date | |
|---|---|---|---|---|---|---|---|---|---|---|
| 30 | 30990 | 2017.0 | toyota | tundra double cab sr | good | gas | other | pickup | al | 2021-05-04T10:41:31-0500 | 
| 31 | 15000 | 2013.0 | ford | f-150 xlt | excellent | gas | automatic | truck | al | 2021-05-03T14:02:03-0500 | 
| 32 | 27990 | 2012.0 | gmc | sierra 2500 hd extended cab | good | gas | other | pickup | al | 2021-05-03T13:41:25-0500 | 
| 33 | 34590 | 2016.0 | chevrolet | silverado 1500 double | good | gas | other | pickup | al | 2021-05-03T12:41:33-0500 | 
| 34 | 35000 | 2019.0 | toyota | tacoma | excellent | gas | automatic | truck | al | 2021-05-03T12:12:59-0500 | 
# change the way posting date is stored to datetime objects so they are comparable (Long exectution time)
dfu['posting_date'] = dfu['posting_date'].apply(lambda x: pd.to_datetime(x))
print(dfu['posting_date'][200000])
print(type(dfu['posting_date'][200000]))
2021-04-04 21:54:57-04:00 <class 'pandas._libs.tslibs.timestamps.Timestamp'>
# add supertype column to differentiate trucks, suvs, and cars
#SUV - SUV, minivan, wagon
#CAR - sedan, hatchback, coupe, convertible
#TRUCK - truck, pickup
#other - other, offroad, van, bus
#NAN - nan
dfu.loc[dfu["type"] == "SUV", "supertype"] = "SUV"
dfu.loc[dfu["type"] == "mini-van", "supertype"] = "SUV"
dfu.loc[dfu["type"] == "wagon", "supertype"] = "SUV"
dfu.loc[dfu["type"] == "sedan", "supertype"] = "CAR"
dfu.loc[dfu["type"] == "coupe", "supertype"] = "CAR"
dfu.loc[dfu["type"] == "hatchback", "supertype"] = "CAR"
dfu.loc[dfu["type"] == "convertible", "supertype"] = "CAR"
dfu.loc[dfu["type"] == "truck", "supertype"] = "TRUCK"
dfu.loc[dfu["type"] == "pickup", "supertype"] = "TRUCK"
dfu.loc[dfu["type"] == "other", "supertype"] = "OTHER"
dfu.loc[dfu["type"] == "offroad", "supertype"] = "OTHER"
dfu.loc[dfu["type"] == "van", "supertype"] = "OTHER"
dfu.loc[dfu["type"] == "bus", "supertype"] = "OTHER"
dfu.loc[dfu["type"] == np.nan, "supertype"] = np.nan
dfu.head()
| price | year | Make | Model | condition | fuel | transmission | type | state | posting_date | supertype | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 30 | 30990 | 2017.0 | toyota | tundra double cab sr | good | gas | other | pickup | al | 2021-05-04 10:41:31-05:00 | TRUCK | 
| 31 | 15000 | 2013.0 | ford | f-150 xlt | excellent | gas | automatic | truck | al | 2021-05-03 14:02:03-05:00 | TRUCK | 
| 32 | 27990 | 2012.0 | gmc | sierra 2500 hd extended cab | good | gas | other | pickup | al | 2021-05-03 13:41:25-05:00 | TRUCK | 
| 33 | 34590 | 2016.0 | chevrolet | silverado 1500 double | good | gas | other | pickup | al | 2021-05-03 12:41:33-05:00 | TRUCK | 
| 34 | 35000 | 2019.0 | toyota | tacoma | excellent | gas | automatic | truck | al | 2021-05-03 12:12:59-05:00 | TRUCK | 
# Remove likely incorrect or impossible data points such as price being over 1 million and year being above 2021. 
# Also remove data that is too old to be relevent to current car pricing, which in this case will be quantified as any year 1990
dfu = dfu[dfu.year < 2022]
dfu = dfu[dfu.year > 1990]
dfu = dfu[dfu.price < 1000000]
dfu = dfu[dfu.price > 500]
# Remove any remaining outliers in price and year
q = dfu["price"].quantile(0.99)
dfu = dfu[dfu["price"] < q]
q = dfu["price"].quantile(0.01)
dfu = dfu[dfu["price"] > q]
q = dfu["year"].quantile(0.01)
dfu = dfu[dfu["year"] > q]
To process and clean the sales data, we need to remove junk rows, convert object type data into integers and strings and split up the car's name into its make and model. We will also be discarding the 2021 sales data past September, as those are still being uploaded and not completely accounted for. Currently, the data is formatted so that each row is a car, and each column is its monthly sales. Instead, we will be making each row a singular sale observation, so we will need to melt the data. Finally, we will merge all of the sales data into one master dataframe.
# Sales Data:
# Last 2 rows need to be dropped as they are sum of sales and nans
df2019 = df2019.iloc[:-2]
df2020 = df2020.iloc[:-2]
df2021 = df2021.iloc[:-2]
# remove oct-dec columns of the 2021 data set as they are still in progress of being uploaded
df2021 = df2021[df2021.columns[:10]]
# Convert sales data types from objects to integers
df2019['Jan'] = pd.to_numeric(df2019['Jan']);
df2019['Feb'] = pd.to_numeric(df2019['Feb']);
df2019['Mar'] = pd.to_numeric(df2019['Mar']);
df2019['Apr'] = pd.to_numeric(df2019['Apr']);
df2019['May'] = pd.to_numeric(df2019['May']);
df2019['Jun'] = pd.to_numeric(df2019['Jun']);
df2019['Jul'] = pd.to_numeric(df2019['Jul']);
df2019['Aug'] = pd.to_numeric(df2019['Aug']);
df2019['Sep'] = pd.to_numeric(df2019['Sep']);
df2019['Oct'] = pd.to_numeric(df2019['Oct']);
df2019['Nov'] = pd.to_numeric(df2019['Nov']);
df2019['Dec'] = pd.to_numeric(df2019['Dec']);
df2020['Jan'] = pd.to_numeric(df2020['Jan']);
df2020['Feb'] = pd.to_numeric(df2020['Feb']);
df2020['Mar'] = pd.to_numeric(df2020['Mar']);
df2020['Apr'] = pd.to_numeric(df2020['Apr']);
df2020['May'] = pd.to_numeric(df2020['May']);
df2020['Jun'] = pd.to_numeric(df2020['Jun']);
df2020['Jul'] = pd.to_numeric(df2020['Jul']);
df2020['Aug'] = pd.to_numeric(df2020['Aug']);
df2020['Sep'] = pd.to_numeric(df2020['Sep']);
df2020['Oct'] = pd.to_numeric(df2020['Oct']);
df2020['Nov'] = pd.to_numeric(df2020['Nov']);
df2020['Dec'] = pd.to_numeric(df2020['Dec']);
df2021['Jan'] = pd.to_numeric(df2021['Jan']);
df2021['Feb'] = pd.to_numeric(df2021['Feb']);
df2021['Mar'] = pd.to_numeric(df2021['Mar']);
df2021['Apr'] = pd.to_numeric(df2021['Apr']);
df2021['May'] = pd.to_numeric(df2021['May']);
df2021['Jun'] = pd.to_numeric(df2021['Jun']);
df2021['Jul'] = pd.to_numeric(df2021['Jul']);
df2021['Aug'] = pd.to_numeric(df2021['Aug']);
df2021['Sep'] = pd.to_numeric(df2021['Sep']);
# Add year columns for later differentiation
df2019['year'] = 2019
df2020['year'] = 2020
df2021['year'] = 2021
# Combine all three dataframes
frames = [df2019, df2020]
df19a20 = pd.concat(frames, ignore_index=True)
colnames = df19a20.columns.tolist()
colnames = [colnames[0]] + colnames[-1:] + colnames[1:-1]
df19a20 = df19a20[colnames]
# Check for blank cells and create NAN
df19a20.replace(r'^\s*$', np.nan, regex=True)
df19a20.replace(0, np.nan, regex=True)
# Change goodcarbadcar data model column to 'make' and 'model' seperate columns
df19a20[['Make', 'Model']] = df19a20['Model'].str.split(' ', 1, expand=True)
colnames = df19a20.columns.tolist()
colnames = colnames[-1:] + colnames[:-1]
df19a20 = df19a20[colnames]
df19a20.loc[(df19a20.Make == 'Alfa'),'Make']='Alfa Romeo'
df19a20.loc[(df19a20.Make == 'Alfa Romeo'),'Model']= df19a20['Model'].str.split(n=1).str[1]
df19a20.loc[(df19a20.Make == 'Land'),'Make']='Land Rover'
df19a20.loc[(df19a20.Make == 'Land Rover'),'Model']= df19a20['Model'].str.split(n=1).str[1]
# Quantify and melt the months into rows
df_sales_master = df19a20
df19a20 = df19a20.rename(columns={'Jan': '1', 'Feb': '2', 'Mar': '3', 'Apr': '4', 'May': '5', 'Jun': '6', 'Jul': '7', 'Aug': '8', 'Sep': '9', 'Oct': '10', 'Nov': '11', 'Dec': '12'})
df19a20 = pd.melt(df19a20, id_vars=['Make', 'Model', 'year'])
# Create a date column that formats the year and month into the datetime format
df19a20.insert(2, 'date', (df19a20[['year', 'variable']].astype(str).agg('-'.join, 1)), True)
df19a20['date'] = pd.to_datetime(df19a20['date'], format='%Y-%m').dt.strftime('%Y-%m')
df19a20 = df19a20.rename(columns={'value': 'sales'})
df19a20 = df19a20.drop(columns=['year', 'variable'])
# Perform the same changes on the 2021 data separately as it has a different number of columns
# Splitting
df2021[['Make', 'Model']] = df2021['Model'].str.split(' ', 1, expand=True)
colnames = df2021.columns.tolist()
colnames = colnames[-1:] + colnames[:-1]
df2021 = df2021[colnames]
df2021.loc[(df2021.Make == 'Alfa'),'Make']='Alfa Romeo'
df2021.loc[(df2021.Make == 'Alfa Romeo'),'Model']= df2021['Model'].str.split(n=1).str[1]
df2021.loc[(df2021.Make == 'Land'),'Make']='Land Rover'
df2021.loc[(df2021.Make == 'Land Rover'),'Model']= df2021['Model'].str.split(n=1).str[1]
# Melting
df2021 = df2021.rename(columns={'Jan': '1', 'Feb': '2', 'Mar': '3', 'Apr': '4', 'May': '5', 'Jun': '6', 'Jul': '7', 'Aug': '8', 'Sep': '9'})
df2021 = pd.melt(df2021, id_vars=['Make', 'Model', 'year'])
df2021.insert(2, 'date', (df2021[['year', 'variable']].astype(str).agg('-'.join, 1)), True)
df2021['date'] = pd.to_datetime(df2021['date'], format='%Y-%m').dt.strftime('%Y-%m')
df2021 = df2021.rename(columns={'value': 'sales'})
df2021 = df2021.drop(columns=['year', 'variable'])
frames = [df19a20, df2021]
df_sales_master = pd.concat(frames)
# Sort dataframe by date
df_sales_master = df_sales_master.sort_values(by='date')
# Reset index
df_sales_master = df_sales_master.reset_index(drop=True)
df_sales_master
df_sales_master
| Make | Model | date | sales | |
|---|---|---|---|---|
| 0 | Acura | ILX | 2019-01 | 805 | 
| 1 | Mercedes-Benz | AMG GT | 2019-01 | 83 | 
| 2 | Mercedes-Benz | A-Class | 2019-01 | 0 | 
| 3 | Mazda | MX-5 Miata | 2019-01 | 347 | 
| 4 | Mazda | CX-9 | 2019-01 | 1860 | 
| ... | ... | ... | ... | ... | 
| 9994 | Ford | GT | 2021-09 | 10 | 
| 9995 | Ford | Fusion | 2021-09 | 42 | 
| 9996 | Ford | F-Series | 2021-09 | 63164 | 
| 9997 | Ford | Transit | 2021-09 | 9939 | 
| 9998 | Volvo | XC90 | 2021-09 | 2886 | 
9999 rows × 4 columns
means = (dfu.groupby('year'))['price'].mean()
plt.figure(1, figsize=(20, 10))
means.plot(title = 'Price of Used Car Listings Over Time', ylabel = 'Price')
<AxesSubplot:title={'center':'Price of Used Car Listings Over Time'}, xlabel='year', ylabel='Price'>
Looking at the average price of a used car posting per year, I expected an increase in price per year, but did not expect the average prices to be so high in the recent years. 2019 used car postings average price is above 30,000 dollars which seems very high for a used car.
Now that we have our data properly processed, let's take a look at some charts to explore some unique characteristics of this dataset. The first chart with this dataset will visualize the sales data for new cars from 2019 until September of 2021.
# Combine Make and Model for the legend
df_sales_master_temp = df_sales_master.copy()
df_sales_master_temp['make_model'] = df_sales_master_temp['Make'] + ' ' + df_sales_master_temp['Model']
# Plot
sb.set(rc={'figure.figsize':(20,10)})
model_sale_plot = sb.lineplot(data=df_sales_master_temp, x='date', y='sales', hue='make_model', legend=False)
model_sale_plot.set_title('Vehicle Model Sales Over Time')
# Reduce x ticks
for ind, label in enumerate(model_sale_plot.get_xticklabels()):
    if ind % 3 == 0:
        label.set_visible(True)
    else:
        label.set_visible(False)
From this graph, we can see that the Ford F-Series is consistently the most sold vehicle in the U.S. We can also see that there was a major dip in most vehicle sales in March and April of 2020, especially for the highest selling vehicles. This was about the time that the quarantine started and COVID-19 was officially recognized as a Pandemic and National Emergency.
More about that timeline can be found here: https://www.ajmc.com/view/a-timeline-of-covid19-developments-in-2020
Unfortunately, because of the sheer volume of data, it is difficult to discern the sales data of each individual car, especially for vehicles with lower sales. So, let's aggregate the data and see the total sales data for each individual brand over time.
# Create new rows that sums the total sales of each Make
df_sales_master_makes = df_sales_master.copy()
df_sales_master_makes = df_sales_master_makes.groupby(['Make', 'date'], as_index=False).sum()
df_sales_master_makes
# Sort dataframe by date
df_sales_master_makes = df_sales_master_makes.sort_values(by='date')
# Plot
sb.set(rc={'figure.figsize':(20,10)})
make_sale_plot = sb.lineplot(data=df_sales_master_makes, x='date', y='sales', hue='Make')
make_sale_plot.set_title('Vehicle Make Sales Over Time')
# Reduce x ticks
for ind, label in enumerate(make_sale_plot.get_xticklabels()):
    if ind % 3 == 0:
        label.set_visible(True)
    else:
        label.set_visible(False)
From this graph, we can see that Ford, Toyota, Chevrolet, Honda, and Nissan are consistently the top 5 best-selling automotive brands in the U.S. It is also clear that the sales dip in March and April of 2020 affected pretty much every brand. Because this difference is so apparent in these higher selling brands, and the sheer volume of their sales make many other brands' sales indiscernible, it might be a good idea to focus on just these 5 major brands.
# Create dataframe of sales data of 5 major brands
df_top5sales = df_sales_master_makes.copy()
df_top5sales = df_top5sales[df_top5sales['Make'].isin(['Ford','Toyota','Chevrolet','Honda','Nissan'])]
df_top5sales
| Make | date | sales | |
|---|---|---|---|
| 858 | Nissan | 2019-01 | 90439 | 
| 429 | Honda | 2019-01 | 96375 | 
| 1035 | Toyota | 2019-01 | 138601 | 
| 198 | Chevrolet | 2019-01 | 148602 | 
| 330 | Ford | 2019-01 | 180766 | 
| ... | ... | ... | ... | 
| 362 | Ford | 2021-09 | 147737 | 
| 230 | Chevrolet | 2021-09 | 96612 | 
| 890 | Nissan | 2021-09 | 63548 | 
| 461 | Honda | 2021-09 | 86303 | 
| 1067 | Toyota | 2021-09 | 122495 | 
165 rows × 3 columns
Next, we will attempt to predict 2021 sales data using the 2019 and 2020 sales data. We will use linear regression to achieve this. Additionally, because each company only has one sale volume for each time period, and because the data we have is unnaturally affected by covid, we lack enough data to make accurate predictions for each company. Instead, we will predict average sale volume for 2021, and compare our results to the average of the real 2021 sale volume. We will focus only the 5 major brands discussed previously, and this way we will have a large enough sample size for the result to be considered statistically significant, while also reducing the variation of the data.
Now, let's generate a linear regression. First, we have to quantify the date into a numeric format, so that it can be used as X in our regression. We will use decimal years for each month, such as 2019.5 for June of 2019.
# Create new column to store quantified date
df_sales_master_temp2 = df_top5sales.copy()
df_sales_master_temp2['date_quant'] = 0.0
# Quantify date
for index, row in df_sales_master_temp2.iterrows():
    yr = int(row['date'][0:4])
    mo = int(row['date'][5:7])
    dq = yr + (mo-1)/12
    df_sales_master_temp2.at[index, 'date_quant'] = dq
df_sales_master_temp2
| Make | date | sales | date_quant | |
|---|---|---|---|---|
| 858 | Nissan | 2019-01 | 90439 | 2019.000000 | 
| 429 | Honda | 2019-01 | 96375 | 2019.000000 | 
| 1035 | Toyota | 2019-01 | 138601 | 2019.000000 | 
| 198 | Chevrolet | 2019-01 | 148602 | 2019.000000 | 
| 330 | Ford | 2019-01 | 180766 | 2019.000000 | 
| ... | ... | ... | ... | ... | 
| 362 | Ford | 2021-09 | 147737 | 2021.666667 | 
| 230 | Chevrolet | 2021-09 | 96612 | 2021.666667 | 
| 890 | Nissan | 2021-09 | 63548 | 2021.666667 | 
| 461 | Honda | 2021-09 | 86303 | 2021.666667 | 
| 1067 | Toyota | 2021-09 | 122495 | 2021.666667 | 
165 rows × 4 columns
Next, we generate the regression using the new quantified dates and the sales. We will use linear regression using the least squares function (ols), from the stats library. Because we are using the 2019 and 2020 data to predict 2021 data, the master dataframe can be used for training.
# Predict Average sales
sale_reg = smf.ols(formula="sales ~ date_quant", data=df_sales_master_temp2[df_sales_master_temp2['date_quant'] < 2021]).fit()
sale_reg.summary()
| Dep. Variable: | sales | R-squared: | 0.028 | 
|---|---|---|---|
| Model: | OLS | Adj. R-squared: | 0.020 | 
| Method: | Least Squares | F-statistic: | 3.449 | 
| Date: | Mon, 20 Dec 2021 | Prob (F-statistic): | 0.0658 | 
| Time: | 23:01:36 | Log-Likelihood: | -1449.3 | 
| No. Observations: | 120 | AIC: | 2903. | 
| Df Residuals: | 118 | BIC: | 2908. | 
| Df Model: | 1 | ||
| Covariance Type: | nonrobust | 
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| Intercept | 2.561e+07 | 1.37e+07 | 1.867 | 0.064 | -1.55e+06 | 5.28e+07 | 
| date_quant | -1.261e+04 | 6789.153 | -1.857 | 0.066 | -2.61e+04 | 835.977 | 
| Omnibus: | 10.163 | Durbin-Watson: | 1.797 | 
|---|---|---|---|
| Prob(Omnibus): | 0.006 | Jarque-Bera (JB): | 4.233 | 
| Skew: | -0.166 | Prob(JB): | 0.120 | 
| Kurtosis: | 2.142 | Cond. No. | 7.07e+06 | 
Unfortunately, from the model summary, we can see that the p-value, noted by the P>|t| column, is just shy of 0.05. A p-value that is less than or equal to 0.05 signifies that there is strong evidence of a correlation, but unfortunately, we were only able to obtain a p-value of 0.06.
# Plot residuals against time
df_sales_master_temp2['residual'] = np.nan
df_sales_master_temp2['residual'] = sale_reg.resid
sale_resid_plot = sb.violinplot(x='date', y='residual', data=df_sales_master_temp2[df_sales_master_temp2['date_quant'] < 2021])
sale_resid_plot.set_title("Residual of Linear Regression of Top 5 Brand Sales by Year")
for ind, label in enumerate(sale_resid_plot.get_xticklabels()):
    if ind % 3 == 0:
        label.set_visible(True)
    else:
        label.set_visible(False)
We can see in the residuals that most of the sales data varies significantly as each brand in the top 5 generally performs at its own level, such as how Ford always has much better sales numbers than Nissan. However, the residual for April 2020 is much smaller and tighter, while also being the farthest away from 0, demonstrating how unusual the sales figures were at the peak of the pandemic. Normally, we would want to remove such an outlier to improve the regression, however, removing the April 2020 sales data would reduce the statistical significance of the regression as it has comparativley much less variance than the sales at other dates.
Next, we will compare the predictions made from the regression to the real 2021 data.
# Restrict data to greater than 2021
predictions = sale_reg.predict(df_sales_master_temp2[df_sales_master_temp2['date_quant'] >= 2021])
diff = predictions - df_sales_master_temp2[df_sales_master_temp2['date_quant'] >= 2021]['sales']
# Plot
plt.scatter(df_sales_master_temp2[df_sales_master_temp2['date_quant'] >= 2021]['sales'], diff)
plt.xlabel('Real Sales')
plt.ylabel('Difference From Real Sales')
plt.show()
As we can see from the plot, the predictions unfortunately don't correlate well with reality. However, this is to be expected, as we saw massive volatility in sales in the initial exploratory graphs in 2021. Unfortunately, this regression doesn't fit well with this data, however, it would likely perform much better with a dataset that includes total sales for each year rather than for each month, as there would likely be much less volatility, and a model would be able to make a proper prediction.
Additionally, the regression predicted that sales would likely increase based on previous sales, even though the pandemic caused a major dip in sales. Although this is the opposite of what has happened so far, it is likely that sales will continue to steadily go up in the future and for the year as a whole as long as another pandemic doesn't hit us.
print(predictions.mean())
print(predictions.std())
print(diff.mean())
print(diff.std())
print(df_sales_master_temp2[df_sales_master_temp2['date_quant'] >= 2021]['sales'].mean())
print(df_sales_master_temp2[df_sales_master_temp2['date_quant'] >= 2021]['sales'].std())
120374.4655072338 2743.5497614035226 -8833.090048321768 38636.47642455955 129207.55555555556 39336.760634964914
The average for the predictions were relatively close to the average for the real 2021 sales. Additionally, we can see how volatile the real sales are with its massive standard deviation in comparison to the standard deviation of the predictions. This kind of regression would do much better with average sales, likely because of how varying the sales of each brand is.
With the information in the vehicles data, we can predict the price of a used car based on its variables such as year, make, and supertype(car, truck, SUV, other). This is accomplished through multivariable linear regression with least squares that is available in the statsmodel library. The regression will be generated by using 90 percent of the data for training and the other 10 percent for testing.
# predict cost of used car based on make, supertype, and year using multivariable linear regression with least squares
# Train with 80 percent of data and predict with remaining 20 percent
part_90 = dfu.sample(frac = 0.90, random_state=1)
rest_part_10 = dfu.drop(part_90.index)
model = smf.ols(formula="price ~ year * Make * supertype", data=part_90).fit()
model.summary()
| Dep. Variable: | price | R-squared: | 0.650 | 
|---|---|---|---|
| Model: | OLS | Adj. R-squared: | 0.649 | 
| Method: | Least Squares | F-statistic: | 1643. | 
| Date: | Mon, 20 Dec 2021 | Prob (F-statistic): | 0.00 | 
| Time: | 23:01:48 | Log-Likelihood: | -2.5609e+06 | 
| No. Observations: | 247199 | AIC: | 5.122e+06 | 
| Df Residuals: | 246919 | BIC: | 5.125e+06 | 
| Df Model: | 279 | ||
| Covariance Type: | nonrobust | 
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| Intercept | -2.834e+06 | 6.6e+04 | -42.927 | 0.000 | -2.96e+06 | -2.7e+06 | 
| Make[T.alfa-romeo] | -1.715e+06 | 8.08e+05 | -2.122 | 0.034 | -3.3e+06 | -1.31e+05 | 
| Make[T.aston-martin] | 1.068e+07 | 1.08e+06 | 9.923 | 0.000 | 8.57e+06 | 1.28e+07 | 
| Make[T.audi] | -1.708e+06 | 8.9e+04 | -19.179 | 0.000 | -1.88e+06 | -1.53e+06 | 
| Make[T.bmw] | -6.011e+05 | 7.62e+04 | -7.890 | 0.000 | -7.5e+05 | -4.52e+05 | 
| Make[T.buick] | 8.484e+05 | 9.93e+04 | 8.546 | 0.000 | 6.54e+05 | 1.04e+06 | 
| Make[T.cadillac] | -8.827e+05 | 8.65e+04 | -10.209 | 0.000 | -1.05e+06 | -7.13e+05 | 
| Make[T.chevrolet] | 1.381e+06 | 7.38e+04 | 18.705 | 0.000 | 1.24e+06 | 1.53e+06 | 
| Make[T.chrysler] | 4.573e+05 | 9.29e+04 | 4.924 | 0.000 | 2.75e+05 | 6.39e+05 | 
| Make[T.dodge] | -1.244e+06 | 9.19e+04 | -13.542 | 0.000 | -1.42e+06 | -1.06e+06 | 
| Make[T.ferrari] | 3.316e+06 | 4.72e+06 | 0.703 | 0.482 | -5.93e+06 | 1.26e+07 | 
| Make[T.fiat] | -1.428e+06 | 3.38e+05 | -4.222 | 0.000 | -2.09e+06 | -7.65e+05 | 
| Make[T.ford] | 4.061e+05 | 7.38e+04 | 5.505 | 0.000 | 2.61e+05 | 5.51e+05 | 
| Make[T.gmc] | 3.424e+05 | 7.83e+05 | 0.437 | 0.662 | -1.19e+06 | 1.88e+06 | 
| Make[T.harley-davidson] | 2.152e+06 | 8.38e+05 | 2.568 | 0.010 | 5.1e+05 | 3.8e+06 | 
| Make[T.honda] | 5.069e+05 | 7.35e+04 | 6.896 | 0.000 | 3.63e+05 | 6.51e+05 | 
| Make[T.hyundai] | 3.972e+05 | 8.79e+04 | 4.518 | 0.000 | 2.25e+05 | 5.69e+05 | 
| Make[T.infiniti] | -8.486e+05 | 9.46e+04 | -8.966 | 0.000 | -1.03e+06 | -6.63e+05 | 
| Make[T.jaguar] | -4.646e+04 | 1.12e+05 | -0.416 | 0.677 | -2.65e+05 | 1.72e+05 | 
| Make[T.jeep] | -3.376e+05 | 1.93e+05 | -1.751 | 0.080 | -7.15e+05 | 4.02e+04 | 
| Make[T.kia] | -1.978e+05 | 1.12e+05 | -1.770 | 0.077 | -4.17e+05 | 2.12e+04 | 
| Make[T.land rover] | -5.217e+05 | 6.45e+05 | -0.809 | 0.418 | -1.79e+06 | 7.42e+05 | 
| Make[T.lexus] | -5.879e+05 | 8.29e+04 | -7.092 | 0.000 | -7.5e+05 | -4.25e+05 | 
| Make[T.lincoln] | -4e+05 | 9.37e+04 | -4.270 | 0.000 | -5.84e+05 | -2.16e+05 | 
| Make[T.mazda] | 4.53e+05 | 9.96e+04 | 4.549 | 0.000 | 2.58e+05 | 6.48e+05 | 
| Make[T.mercedes-benz] | -7.064e+05 | 8.01e+04 | -8.817 | 0.000 | -8.63e+05 | -5.49e+05 | 
| Make[T.mercury] | 2.463e+06 | 2.38e+05 | 10.355 | 0.000 | 2e+06 | 2.93e+06 | 
| Make[T.mini] | -5.55e+05 | 1.19e+05 | -4.666 | 0.000 | -7.88e+05 | -3.22e+05 | 
| Make[T.mitsubishi] | 1.136e+06 | 1.09e+05 | 10.415 | 0.000 | 9.22e+05 | 1.35e+06 | 
| Make[T.nissan] | 4.034e+05 | 7.99e+04 | 5.048 | 0.000 | 2.47e+05 | 5.6e+05 | 
| Make[T.pontiac] | 3.016e+06 | 1.89e+05 | 15.941 | 0.000 | 2.65e+06 | 3.39e+06 | 
| Make[T.porsche] | -4.683e+05 | 1.62e+05 | -2.897 | 0.004 | -7.85e+05 | -1.51e+05 | 
| Make[T.ram] | 5.43e+05 | 1.03e+06 | 0.528 | 0.598 | -1.47e+06 | 2.56e+06 | 
| Make[T.rover] | 9.092e+06 | 2.65e+06 | 3.429 | 0.001 | 3.9e+06 | 1.43e+07 | 
| Make[T.saturn] | 1.762e+06 | 3.21e+05 | 5.491 | 0.000 | 1.13e+06 | 2.39e+06 | 
| Make[T.subaru] | -3.559e+05 | 9.3e+04 | -3.829 | 0.000 | -5.38e+05 | -1.74e+05 | 
| Make[T.tesla] | 9.998e+05 | 2.32e+05 | 4.303 | 0.000 | 5.44e+05 | 1.46e+06 | 
| Make[T.toyota] | 7.258e+05 | 7.33e+04 | 9.905 | 0.000 | 5.82e+05 | 8.69e+05 | 
| Make[T.volkswagen] | 2.754e+05 | 8.39e+04 | 3.282 | 0.001 | 1.11e+05 | 4.4e+05 | 
| Make[T.volvo] | -1.263e+06 | 1.03e+05 | -12.218 | 0.000 | -1.47e+06 | -1.06e+06 | 
| supertype[T.OTHER] | -3.55e+06 | 2.64e+05 | -13.467 | 0.000 | -4.07e+06 | -3.03e+06 | 
| supertype[T.SUV] | -1.822e+06 | 1.03e+05 | -17.719 | 0.000 | -2.02e+06 | -1.62e+06 | 
| supertype[T.TRUCK] | 1.109e+06 | 2.22e+06 | 0.500 | 0.617 | -3.24e+06 | 5.46e+06 | 
| Make[T.alfa-romeo]:supertype[T.OTHER] | -0.0022 | 0.001 | -3.272 | 0.001 | -0.004 | -0.001 | 
| Make[T.aston-martin]:supertype[T.OTHER] | 2.385e-05 | 3.31e-05 | 0.721 | 0.471 | -4.09e-05 | 8.86e-05 | 
| Make[T.audi]:supertype[T.OTHER] | 1.139e+06 | 3.32e+05 | 3.434 | 0.001 | 4.89e+05 | 1.79e+06 | 
| Make[T.bmw]:supertype[T.OTHER] | 2.843e+06 | 3.05e+05 | 9.333 | 0.000 | 2.25e+06 | 3.44e+06 | 
| Make[T.buick]:supertype[T.OTHER] | 1.585e+06 | 3.21e+05 | 4.931 | 0.000 | 9.55e+05 | 2.21e+06 | 
| Make[T.cadillac]:supertype[T.OTHER] | 2.278e+06 | 3.2e+05 | 7.129 | 0.000 | 1.65e+06 | 2.9e+06 | 
| Make[T.chevrolet]:supertype[T.OTHER] | 2.491e+06 | 2.73e+05 | 9.131 | 0.000 | 1.96e+06 | 3.03e+06 | 
| Make[T.chrysler]:supertype[T.OTHER] | 2.32e+06 | 2.98e+05 | 7.782 | 0.000 | 1.74e+06 | 2.9e+06 | 
| Make[T.dodge]:supertype[T.OTHER] | 4.693e+06 | 2.91e+05 | 16.124 | 0.000 | 4.12e+06 | 5.26e+06 | 
| Make[T.ferrari]:supertype[T.OTHER] | 3.486e-05 | 1.64e-05 | 2.121 | 0.034 | 2.65e-06 | 6.71e-05 | 
| Make[T.fiat]:supertype[T.OTHER] | 1.339e+06 | 8.86e+05 | 1.512 | 0.131 | -3.97e+05 | 3.07e+06 | 
| Make[T.ford]:supertype[T.OTHER] | 3.307e+06 | 2.7e+05 | 12.236 | 0.000 | 2.78e+06 | 3.84e+06 | 
| Make[T.gmc]:supertype[T.OTHER] | 2.46e+06 | 8.3e+05 | 2.965 | 0.003 | 8.34e+05 | 4.09e+06 | 
| Make[T.harley-davidson]:supertype[T.OTHER] | 2.723e+06 | 9.25e+05 | 2.943 | 0.003 | 9.09e+05 | 4.54e+06 | 
| Make[T.honda]:supertype[T.OTHER] | 2.403e+06 | 2.84e+05 | 8.466 | 0.000 | 1.85e+06 | 2.96e+06 | 
| Make[T.hyundai]:supertype[T.OTHER] | 1.569e+06 | 3.56e+05 | 4.408 | 0.000 | 8.72e+05 | 2.27e+06 | 
| Make[T.infiniti]:supertype[T.OTHER] | 2.723e+06 | 3.64e+05 | 7.484 | 0.000 | 2.01e+06 | 3.44e+06 | 
| Make[T.jaguar]:supertype[T.OTHER] | 6.586e+05 | 4.65e+05 | 1.416 | 0.157 | -2.53e+05 | 1.57e+06 | 
| Make[T.jeep]:supertype[T.OTHER] | 3.998e+06 | 3.28e+05 | 12.173 | 0.000 | 3.35e+06 | 4.64e+06 | 
| Make[T.kia]:supertype[T.OTHER] | 3.058e+06 | 3.57e+05 | 8.576 | 0.000 | 2.36e+06 | 3.76e+06 | 
| Make[T.land rover]:supertype[T.OTHER] | 0.0073 | 0.001 | 4.925 | 0.000 | 0.004 | 0.010 | 
| Make[T.lexus]:supertype[T.OTHER] | 2.569e+06 | 3.24e+05 | 7.937 | 0.000 | 1.93e+06 | 3.2e+06 | 
| Make[T.lincoln]:supertype[T.OTHER] | 2.466e+06 | 3.32e+05 | 7.423 | 0.000 | 1.81e+06 | 3.12e+06 | 
| Make[T.mazda]:supertype[T.OTHER] | 2.217e+06 | 3.23e+05 | 6.870 | 0.000 | 1.58e+06 | 2.85e+06 | 
| Make[T.mercedes-benz]:supertype[T.OTHER] | 1.918e+06 | 3.15e+05 | 6.089 | 0.000 | 1.3e+06 | 2.53e+06 | 
| Make[T.mercury]:supertype[T.OTHER] | 4.014e+06 | 6e+05 | 6.692 | 0.000 | 2.84e+06 | 5.19e+06 | 
| Make[T.mini]:supertype[T.OTHER] | 5.509e+05 | 4.42e+05 | 1.247 | 0.213 | -3.15e+05 | 1.42e+06 | 
| Make[T.mitsubishi]:supertype[T.OTHER] | 2.938e+06 | 3.61e+05 | 8.135 | 0.000 | 2.23e+06 | 3.65e+06 | 
| Make[T.nissan]:supertype[T.OTHER] | 2.958e+06 | 3.23e+05 | 9.154 | 0.000 | 2.32e+06 | 3.59e+06 | 
| Make[T.pontiac]:supertype[T.OTHER] | 6.383e+06 | 8.7e+05 | 7.334 | 0.000 | 4.68e+06 | 8.09e+06 | 
| Make[T.porsche]:supertype[T.OTHER] | 4.408e+06 | 6.08e+05 | 7.254 | 0.000 | 3.22e+06 | 5.6e+06 | 
| Make[T.ram]:supertype[T.OTHER] | 2.861e+06 | 1.07e+06 | 2.681 | 0.007 | 7.7e+05 | 4.95e+06 | 
| Make[T.rover]:supertype[T.OTHER] | -6.605e+06 | 2.68e+06 | -2.466 | 0.014 | -1.19e+07 | -1.35e+06 | 
| Make[T.saturn]:supertype[T.OTHER] | -5.989e+06 | 2.42e+06 | -2.478 | 0.013 | -1.07e+07 | -1.25e+06 | 
| Make[T.subaru]:supertype[T.OTHER] | 3.476e+06 | 3.82e+05 | 9.096 | 0.000 | 2.73e+06 | 4.22e+06 | 
| Make[T.tesla]:supertype[T.OTHER] | 5.589e+06 | 2.46e+06 | 2.272 | 0.023 | 7.68e+05 | 1.04e+07 | 
| Make[T.toyota]:supertype[T.OTHER] | 1.309e+06 | 2.78e+05 | 4.710 | 0.000 | 7.64e+05 | 1.85e+06 | 
| Make[T.volkswagen]:supertype[T.OTHER] | 4.567e+06 | 2.95e+05 | 15.484 | 0.000 | 3.99e+06 | 5.15e+06 | 
| Make[T.volvo]:supertype[T.OTHER] | 2.042e+06 | 4.76e+05 | 4.292 | 0.000 | 1.11e+06 | 2.97e+06 | 
| Make[T.alfa-romeo]:supertype[T.SUV] | -7.181e+06 | 1.12e+07 | -0.643 | 0.520 | -2.91e+07 | 1.47e+07 | 
| Make[T.aston-martin]:supertype[T.SUV] | 3.093e-05 | 2.07e-05 | 1.492 | 0.136 | -9.7e-06 | 7.16e-05 | 
| Make[T.audi]:supertype[T.SUV] | 1.088e+06 | 1.61e+05 | 6.762 | 0.000 | 7.73e+05 | 1.4e+06 | 
| Make[T.bmw]:supertype[T.SUV] | 6.479e+05 | 1.35e+05 | 4.807 | 0.000 | 3.84e+05 | 9.12e+05 | 
| Make[T.buick]:supertype[T.SUV] | 1.908e+04 | 1.56e+05 | 0.123 | 0.902 | -2.86e+05 | 3.24e+05 | 
| Make[T.cadillac]:supertype[T.SUV] | 1.1e+06 | 1.45e+05 | 7.575 | 0.000 | 8.15e+05 | 1.38e+06 | 
| Make[T.chevrolet]:supertype[T.SUV] | 6.095e+05 | 1.14e+05 | 5.350 | 0.000 | 3.86e+05 | 8.33e+05 | 
| Make[T.chrysler]:supertype[T.SUV] | 2.214e+06 | 1.69e+05 | 13.090 | 0.000 | 1.88e+06 | 2.55e+06 | 
| Make[T.dodge]:supertype[T.SUV] | 3.057e+06 | 1.36e+05 | 22.411 | 0.000 | 2.79e+06 | 3.32e+06 | 
| Make[T.ferrari]:supertype[T.SUV] | 2.583e-05 | 1.97e-05 | 1.313 | 0.189 | -1.27e-05 | 6.44e-05 | 
| Make[T.fiat]:supertype[T.SUV] | 2.382e+06 | 3.28e+06 | 0.726 | 0.468 | -4.05e+06 | 8.81e+06 | 
| Make[T.ford]:supertype[T.SUV] | 1.539e+06 | 1.13e+05 | 13.629 | 0.000 | 1.32e+06 | 1.76e+06 | 
| Make[T.gmc]:supertype[T.SUV] | 9.504e+05 | 7.89e+05 | 1.205 | 0.228 | -5.96e+05 | 2.5e+06 | 
| Make[T.harley-davidson]:supertype[T.SUV] | 0.0005 | 0.003 | 0.177 | 0.860 | -0.005 | 0.006 | 
| Make[T.honda]:supertype[T.SUV] | 1.389e+06 | 1.18e+05 | 11.767 | 0.000 | 1.16e+06 | 1.62e+06 | 
| Make[T.hyundai]:supertype[T.SUV] | 1.413e+06 | 1.45e+05 | 9.757 | 0.000 | 1.13e+06 | 1.7e+06 | 
| Make[T.infiniti]:supertype[T.SUV] | 1.775e+06 | 1.63e+05 | 10.898 | 0.000 | 1.46e+06 | 2.09e+06 | 
| Make[T.jaguar]:supertype[T.SUV] | -4.429e+05 | 5.95e+05 | -0.744 | 0.457 | -1.61e+06 | 7.23e+05 | 
| Make[T.jeep]:supertype[T.SUV] | 1.846e+06 | 2.11e+05 | 8.763 | 0.000 | 1.43e+06 | 2.26e+06 | 
| Make[T.kia]:supertype[T.SUV] | 2.039e+06 | 1.58e+05 | 12.884 | 0.000 | 1.73e+06 | 2.35e+06 | 
| Make[T.land rover]:supertype[T.SUV] | -5.217e+05 | 6.45e+05 | -0.809 | 0.418 | -1.79e+06 | 7.42e+05 | 
| Make[T.lexus]:supertype[T.SUV] | 2e+06 | 1.32e+05 | 15.163 | 0.000 | 1.74e+06 | 2.26e+06 | 
| Make[T.lincoln]:supertype[T.SUV] | 7.187e+05 | 1.64e+05 | 4.378 | 0.000 | 3.97e+05 | 1.04e+06 | 
| Make[T.mazda]:supertype[T.SUV] | 1.27e+06 | 1.7e+05 | 7.462 | 0.000 | 9.37e+05 | 1.6e+06 | 
| Make[T.mercedes-benz]:supertype[T.SUV] | 1.027e+06 | 1.42e+05 | 7.228 | 0.000 | 7.48e+05 | 1.31e+06 | 
| Make[T.mercury]:supertype[T.SUV] | 1.509e+06 | 3.98e+05 | 3.792 | 0.000 | 7.29e+05 | 2.29e+06 | 
| Make[T.mini]:supertype[T.SUV] | 1.57e+06 | 4.11e+05 | 3.820 | 0.000 | 7.64e+05 | 2.38e+06 | 
| Make[T.mitsubishi]:supertype[T.SUV] | 1.123e+06 | 1.67e+05 | 6.704 | 0.000 | 7.94e+05 | 1.45e+06 | 
| Make[T.nissan]:supertype[T.SUV] | 1.614e+06 | 1.25e+05 | 12.873 | 0.000 | 1.37e+06 | 1.86e+06 | 
| Make[T.pontiac]:supertype[T.SUV] | 6.685e+05 | 6.11e+05 | 1.094 | 0.274 | -5.29e+05 | 1.87e+06 | 
| Make[T.porsche]:supertype[T.SUV] | -6.177e+05 | 2.85e+05 | -2.168 | 0.030 | -1.18e+06 | -5.93e+04 | 
| Make[T.ram]:supertype[T.SUV] | 1.435e+06 | 1.16e+06 | 1.237 | 0.216 | -8.38e+05 | 3.71e+06 | 
| Make[T.rover]:supertype[T.SUV] | -9.338e+06 | 2.65e+06 | -3.518 | 0.000 | -1.45e+07 | -4.14e+06 | 
| Make[T.saturn]:supertype[T.SUV] | 2.21e+06 | 6.19e+05 | 3.571 | 0.000 | 9.97e+05 | 3.42e+06 | 
| Make[T.subaru]:supertype[T.SUV] | 2.363e+06 | 1.34e+05 | 17.626 | 0.000 | 2.1e+06 | 2.63e+06 | 
| Make[T.tesla]:supertype[T.SUV] | 5.152e+06 | 2.41e+06 | 2.136 | 0.033 | 4.24e+05 | 9.88e+06 | 
| Make[T.toyota]:supertype[T.SUV] | 8.482e+05 | 1.13e+05 | 7.493 | 0.000 | 6.26e+05 | 1.07e+06 | 
| Make[T.volkswagen]:supertype[T.SUV] | 9.814e+05 | 1.59e+05 | 6.178 | 0.000 | 6.7e+05 | 1.29e+06 | 
| Make[T.volvo]:supertype[T.SUV] | 1.365e+06 | 1.64e+05 | 8.343 | 0.000 | 1.04e+06 | 1.69e+06 | 
| Make[T.alfa-romeo]:supertype[T.TRUCK] | 6.939e-05 | 3.22e-05 | 2.152 | 0.031 | 6.2e-06 | 0.000 | 
| Make[T.aston-martin]:supertype[T.TRUCK] | 3.494e-06 | 2.07e-05 | 0.169 | 0.866 | -3.7e-05 | 4.4e-05 | 
| Make[T.audi]:supertype[T.TRUCK] | 2.872e+05 | 4.67e+06 | 0.061 | 0.951 | -8.87e+06 | 9.45e+06 | 
| Make[T.bmw]:supertype[T.TRUCK] | 1.119e+06 | 3e+06 | 0.373 | 0.709 | -4.76e+06 | 6.99e+06 | 
| Make[T.buick]:supertype[T.TRUCK] | 1.601e-05 | 3.12e-05 | 0.513 | 0.608 | -4.52e-05 | 7.72e-05 | 
| Make[T.cadillac]:supertype[T.TRUCK] | -9.243e+05 | 2.36e+06 | -0.392 | 0.695 | -5.55e+06 | 3.7e+06 | 
| Make[T.chevrolet]:supertype[T.TRUCK] | -3.39e+06 | 2.22e+06 | -1.528 | 0.127 | -7.74e+06 | 9.59e+05 | 
| Make[T.chrysler]:supertype[T.TRUCK] | 2.249e+06 | 4.25e+06 | 0.529 | 0.596 | -6.08e+06 | 1.06e+07 | 
| Make[T.dodge]:supertype[T.TRUCK] | 1.223e+06 | 2.23e+06 | 0.549 | 0.583 | -3.15e+06 | 5.59e+06 | 
| Make[T.ferrari]:supertype[T.TRUCK] | -5.255e-05 | 2.05e-05 | -2.569 | 0.010 | -9.26e-05 | -1.24e-05 | 
| Make[T.fiat]:supertype[T.TRUCK] | -2.623e-05 | 1.25e-05 | -2.102 | 0.036 | -5.07e-05 | -1.78e-06 | 
| Make[T.ford]:supertype[T.TRUCK] | -2.257e+06 | 2.22e+06 | -1.017 | 0.309 | -6.61e+06 | 2.09e+06 | 
| Make[T.gmc]:supertype[T.TRUCK] | -2.879e+06 | 2.35e+06 | -1.224 | 0.221 | -7.49e+06 | 1.73e+06 | 
| Make[T.harley-davidson]:supertype[T.TRUCK] | -5.707e+05 | 1.63e+06 | -0.350 | 0.726 | -3.77e+06 | 2.62e+06 | 
| Make[T.honda]:supertype[T.TRUCK] | -2.959e+06 | 2.22e+06 | -1.331 | 0.183 | -7.32e+06 | 1.4e+06 | 
| Make[T.hyundai]:supertype[T.TRUCK] | -6.783e+05 | 3.1e+06 | -0.218 | 0.827 | -6.76e+06 | 5.41e+06 | 
| Make[T.infiniti]:supertype[T.TRUCK] | 0.0004 | 0.001 | 0.334 | 0.738 | -0.002 | 0.003 | 
| Make[T.jaguar]:supertype[T.TRUCK] | 1.618e-05 | 1.55e-05 | 1.045 | 0.296 | -1.42e-05 | 4.65e-05 | 
| Make[T.jeep]:supertype[T.TRUCK] | -2.583e+06 | 2.23e+06 | -1.157 | 0.247 | -6.96e+06 | 1.79e+06 | 
| Make[T.kia]:supertype[T.TRUCK] | -4.964e-05 | 1.72e-05 | -2.887 | 0.004 | -8.33e-05 | -1.59e-05 | 
| Make[T.land rover]:supertype[T.TRUCK] | -4.438e-05 | 1.99e-05 | -2.233 | 0.026 | -8.33e-05 | -5.43e-06 | 
| Make[T.lexus]:supertype[T.TRUCK] | 0.0047 | 0.002 | 1.904 | 0.057 | -0.000 | 0.010 | 
| Make[T.lincoln]:supertype[T.TRUCK] | 2.14e+06 | 2.74e+06 | 0.780 | 0.436 | -3.24e+06 | 7.52e+06 | 
| Make[T.mazda]:supertype[T.TRUCK] | 3.061e+05 | 2.29e+06 | 0.133 | 0.894 | -4.19e+06 | 4.8e+06 | 
| Make[T.mercedes-benz]:supertype[T.TRUCK] | -1.924e+06 | 2.38e+06 | -0.810 | 0.418 | -6.58e+06 | 2.73e+06 | 
| Make[T.mercury]:supertype[T.TRUCK] | -2.637e+06 | 5.85e+06 | -0.450 | 0.652 | -1.41e+07 | 8.84e+06 | 
| Make[T.mini]:supertype[T.TRUCK] | 9.774e-06 | 2.49e-06 | 3.921 | 0.000 | 4.89e-06 | 1.47e-05 | 
| Make[T.mitsubishi]:supertype[T.TRUCK] | -3.541e+05 | 2.23e+06 | -0.159 | 0.874 | -4.72e+06 | 4.01e+06 | 
| Make[T.nissan]:supertype[T.TRUCK] | -1.956e+06 | 2.22e+06 | -0.881 | 0.378 | -6.31e+06 | 2.4e+06 | 
| Make[T.pontiac]:supertype[T.TRUCK] | 3.766e-06 | 2.19e-06 | 1.717 | 0.086 | -5.33e-07 | 8.06e-06 | 
| Make[T.porsche]:supertype[T.TRUCK] | -0.0040 | 0.003 | -1.394 | 0.163 | -0.010 | 0.002 | 
| Make[T.ram]:supertype[T.TRUCK] | -2.234e+06 | 2.44e+06 | -0.914 | 0.361 | -7.03e+06 | 2.56e+06 | 
| Make[T.rover]:supertype[T.TRUCK] | -9.529e+06 | 4.05e+06 | -2.353 | 0.019 | -1.75e+07 | -1.59e+06 | 
| Make[T.saturn]:supertype[T.TRUCK] | 0.0006 | 0.002 | 0.232 | 0.817 | -0.004 | 0.005 | 
| Make[T.subaru]:supertype[T.TRUCK] | 2.026e+06 | 2.42e+06 | 0.837 | 0.403 | -2.72e+06 | 6.77e+06 | 
| Make[T.tesla]:supertype[T.TRUCK] | 2.023e-06 | 1.6e-05 | 0.127 | 0.899 | -2.92e-05 | 3.33e-05 | 
| Make[T.toyota]:supertype[T.TRUCK] | -2.462e+06 | 2.22e+06 | -1.109 | 0.267 | -6.81e+06 | 1.89e+06 | 
| Make[T.volkswagen]:supertype[T.TRUCK] | 3.362e+05 | 2.75e+06 | 0.122 | 0.903 | -5.06e+06 | 5.73e+06 | 
| Make[T.volvo]:supertype[T.TRUCK] | 1.879e+06 | 2.28e+06 | 0.824 | 0.410 | -2.59e+06 | 6.35e+06 | 
| year | 1416.1250 | 32.802 | 43.172 | 0.000 | 1351.834 | 1480.416 | 
| year:Make[T.alfa-romeo] | 852.7973 | 400.481 | 2.129 | 0.033 | 67.866 | 1637.729 | 
| year:Make[T.aston-martin] | -5302.3502 | 534.741 | -9.916 | 0.000 | -6350.428 | -4254.272 | 
| year:Make[T.audi] | 850.6711 | 44.228 | 19.234 | 0.000 | 763.985 | 937.358 | 
| year:Make[T.bmw] | 300.7187 | 37.854 | 7.944 | 0.000 | 226.527 | 374.911 | 
| year:Make[T.buick] | -423.3838 | 49.365 | -8.577 | 0.000 | -520.138 | -326.630 | 
| year:Make[T.cadillac] | 439.9136 | 42.946 | 10.243 | 0.000 | 355.740 | 524.087 | 
| year:Make[T.chevrolet] | -686.4358 | 36.674 | -18.717 | 0.000 | -758.316 | -614.556 | 
| year:Make[T.chrysler] | -229.0852 | 46.152 | -4.964 | 0.000 | -319.542 | -138.628 | 
| year:Make[T.dodge] | 618.7200 | 45.618 | 13.563 | 0.000 | 529.309 | 708.131 | 
| year:Make[T.ferrari] | -1654.1250 | 2339.363 | -0.707 | 0.480 | -6239.215 | 2930.965 | 
| year:Make[T.fiat] | 705.1086 | 167.881 | 4.200 | 0.000 | 376.066 | 1034.151 | 
| year:Make[T.ford] | -203.0241 | 36.648 | -5.540 | 0.000 | -274.852 | -131.196 | 
| year:Make[T.gmc] | -165.6663 | 389.225 | -0.426 | 0.670 | -928.538 | 597.205 | 
| year:Make[T.harley-davidson] | -1073.5092 | 415.369 | -2.584 | 0.010 | -1887.622 | -259.397 | 
| year:Make[T.honda] | -253.4946 | 36.525 | -6.940 | 0.000 | -325.083 | -181.907 | 
| year:Make[T.hyundai] | -200.3012 | 43.664 | -4.587 | 0.000 | -285.882 | -114.721 | 
| year:Make[T.infiniti] | 422.7026 | 47.011 | 8.992 | 0.000 | 330.563 | 514.842 | 
| year:Make[T.jaguar] | 26.0815 | 55.490 | 0.470 | 0.638 | -82.677 | 134.840 | 
| year:Make[T.jeep] | 172.6102 | 95.755 | 1.803 | 0.071 | -15.067 | 360.287 | 
| year:Make[T.kia] | 94.8849 | 55.459 | 1.711 | 0.087 | -13.813 | 203.582 | 
| year:Make[T.land rover] | 268.6835 | 321.687 | 0.835 | 0.404 | -361.815 | 899.182 | 
| year:Make[T.lexus] | 294.6425 | 41.187 | 7.154 | 0.000 | 213.918 | 375.367 | 
| year:Make[T.lincoln] | 199.6541 | 46.523 | 4.292 | 0.000 | 108.471 | 290.837 | 
| year:Make[T.mazda] | -226.9824 | 49.483 | -4.587 | 0.000 | -323.967 | -129.998 | 
| year:Make[T.mercedes-benz] | 354.4419 | 39.814 | 8.902 | 0.000 | 276.407 | 432.476 | 
| year:Make[T.mercury] | -1228.7794 | 118.617 | -10.359 | 0.000 | -1461.265 | -996.294 | 
| year:Make[T.mini] | 274.5178 | 59.076 | 4.647 | 0.000 | 158.730 | 390.306 | 
| year:Make[T.mitsubishi] | -566.5592 | 54.142 | -10.464 | 0.000 | -672.675 | -460.443 | 
| year:Make[T.nissan] | -203.1983 | 39.694 | -5.119 | 0.000 | -280.997 | -125.399 | 
| year:Make[T.pontiac] | -1503.5651 | 94.292 | -15.946 | 0.000 | -1688.375 | -1318.755 | 
| year:Make[T.porsche] | 243.3920 | 80.522 | 3.023 | 0.003 | 85.571 | 401.213 | 
| year:Make[T.ram] | -267.2188 | 511.636 | -0.522 | 0.601 | -1270.011 | 735.574 | 
| year:Make[T.rover] | -4514.2369 | 1317.439 | -3.427 | 0.001 | -7096.382 | -1932.092 | 
| year:Make[T.saturn] | -879.3777 | 159.980 | -5.497 | 0.000 | -1192.934 | -565.821 | 
| year:Make[T.subaru] | 176.2270 | 46.173 | 3.817 | 0.000 | 85.729 | 266.725 | 
| year:Make[T.tesla] | -488.0497 | 115.230 | -4.235 | 0.000 | -713.898 | -262.201 | 
| year:Make[T.toyota] | -362.5922 | 36.412 | -9.958 | 0.000 | -433.959 | -291.225 | 
| year:Make[T.volkswagen] | -138.8451 | 41.677 | -3.331 | 0.001 | -220.531 | -57.159 | 
| year:Make[T.volvo] | 628.3063 | 51.351 | 12.236 | 0.000 | 527.660 | 728.953 | 
| year:supertype[T.OTHER] | 1763.6262 | 130.629 | 13.501 | 0.000 | 1507.597 | 2019.655 | 
| year:supertype[T.SUV] | 906.9875 | 51.080 | 17.756 | 0.000 | 806.872 | 1007.103 | 
| year:supertype[T.TRUCK] | -553.6250 | 1103.166 | -0.502 | 0.616 | -2715.801 | 1608.551 | 
| year:Make[T.alfa-romeo]:supertype[T.OTHER] | -4.3368 | 1.359 | -3.191 | 0.001 | -7.000 | -1.673 | 
| year:Make[T.aston-martin]:supertype[T.OTHER] | -3.465e-08 | 1.93e-08 | -1.794 | 0.073 | -7.25e-08 | 3.21e-09 | 
| year:Make[T.audi]:supertype[T.OTHER] | -563.8020 | 164.390 | -3.430 | 0.001 | -886.001 | -241.603 | 
| year:Make[T.bmw]:supertype[T.OTHER] | -1409.5849 | 151.005 | -9.335 | 0.000 | -1705.551 | -1113.619 | 
| year:Make[T.buick]:supertype[T.OTHER] | -784.5694 | 159.300 | -4.925 | 0.000 | -1096.793 | -472.346 | 
| year:Make[T.cadillac]:supertype[T.OTHER] | -1129.0130 | 158.449 | -7.125 | 0.000 | -1439.569 | -818.457 | 
| year:Make[T.chevrolet]:supertype[T.OTHER] | -1233.4655 | 135.215 | -9.122 | 0.000 | -1498.483 | -968.448 | 
| year:Make[T.chrysler]:supertype[T.OTHER] | -1151.1150 | 147.846 | -7.786 | 0.000 | -1440.890 | -861.340 | 
| year:Make[T.dodge]:supertype[T.OTHER] | -2332.3761 | 144.269 | -16.167 | 0.000 | -2615.139 | -2049.613 | 
| year:Make[T.ferrari]:supertype[T.OTHER] | -2.014e-08 | 6.28e-09 | -3.207 | 0.001 | -3.24e-08 | -7.83e-09 | 
| year:Make[T.fiat]:supertype[T.OTHER] | -665.2422 | 439.253 | -1.514 | 0.130 | -1526.166 | 195.682 | 
| year:Make[T.ford]:supertype[T.OTHER] | -1639.4770 | 133.942 | -12.240 | 0.000 | -1901.999 | -1376.955 | 
| year:Make[T.gmc]:supertype[T.OTHER] | -1223.0565 | 412.309 | -2.966 | 0.003 | -2031.172 | -414.941 | 
| year:Make[T.harley-davidson]:supertype[T.OTHER] | -1350.2814 | 458.980 | -2.942 | 0.003 | -2249.870 | -450.693 | 
| year:Make[T.honda]:supertype[T.OTHER] | -1191.9315 | 140.718 | -8.470 | 0.000 | -1467.734 | -916.129 | 
| year:Make[T.hyundai]:supertype[T.OTHER] | -779.1401 | 176.482 | -4.415 | 0.000 | -1125.040 | -433.240 | 
| year:Make[T.infiniti]:supertype[T.OTHER] | -1350.8836 | 180.385 | -7.489 | 0.000 | -1704.434 | -997.333 | 
| year:Make[T.jaguar]:supertype[T.OTHER] | -326.6113 | 230.542 | -1.417 | 0.157 | -778.468 | 125.245 | 
| year:Make[T.jeep]:supertype[T.OTHER] | -1987.0377 | 162.876 | -12.200 | 0.000 | -2306.270 | -1667.805 | 
| year:Make[T.kia]:supertype[T.OTHER] | -1517.6905 | 176.800 | -8.584 | 0.000 | -1864.214 | -1171.167 | 
| year:Make[T.land rover]:supertype[T.OTHER] | 14.5993 | 2.953 | 4.944 | 0.000 | 8.812 | 20.387 | 
| year:Make[T.lexus]:supertype[T.OTHER] | -1274.5852 | 160.492 | -7.942 | 0.000 | -1589.146 | -960.025 | 
| year:Make[T.lincoln]:supertype[T.OTHER] | -1222.6849 | 164.659 | -7.426 | 0.000 | -1545.413 | -899.957 | 
| year:Make[T.mazda]:supertype[T.OTHER] | -1098.8108 | 159.981 | -6.868 | 0.000 | -1412.369 | -785.252 | 
| year:Make[T.mercedes-benz]:supertype[T.OTHER] | -952.4819 | 156.139 | -6.100 | 0.000 | -1258.510 | -646.454 | 
| year:Make[T.mercury]:supertype[T.OTHER] | -1994.8149 | 298.942 | -6.673 | 0.000 | -2580.734 | -1408.896 | 
| year:Make[T.mini]:supertype[T.OTHER] | -273.2849 | 219.119 | -1.247 | 0.212 | -702.752 | 156.182 | 
| year:Make[T.mitsubishi]:supertype[T.OTHER] | -1457.4294 | 179.051 | -8.140 | 0.000 | -1808.364 | -1106.495 | 
| year:Make[T.nissan]:supertype[T.OTHER] | -1468.2829 | 160.187 | -9.166 | 0.000 | -1782.245 | -1154.321 | 
| year:Make[T.pontiac]:supertype[T.OTHER] | -3176.2714 | 433.748 | -7.323 | 0.000 | -4026.406 | -2326.137 | 
| year:Make[T.porsche]:supertype[T.OTHER] | -2191.5768 | 301.652 | -7.265 | 0.000 | -2782.807 | -1600.347 | 
| year:Make[T.ram]:supertype[T.OTHER] | -1419.7211 | 530.664 | -2.675 | 0.007 | -2459.808 | -379.635 | 
| year:Make[T.rover]:supertype[T.OTHER] | 3284.1508 | 1331.081 | 2.467 | 0.014 | 675.268 | 5893.034 | 
| year:Make[T.saturn]:supertype[T.OTHER] | 2991.4631 | 1203.125 | 2.486 | 0.013 | 633.370 | 5349.556 | 
| year:Make[T.subaru]:supertype[T.OTHER] | -1726.5126 | 189.552 | -9.108 | 0.000 | -2098.029 | -1354.996 | 
| year:Make[T.tesla]:supertype[T.OTHER] | -2772.9432 | 1219.977 | -2.273 | 0.023 | -5164.066 | -381.820 | 
| year:Make[T.toyota]:supertype[T.OTHER] | -645.9331 | 137.788 | -4.688 | 0.000 | -915.995 | -375.872 | 
| year:Make[T.volkswagen]:supertype[T.OTHER] | -2264.8994 | 146.216 | -15.490 | 0.000 | -2551.479 | -1978.320 | 
| year:Make[T.volvo]:supertype[T.OTHER] | -1013.6871 | 235.871 | -4.298 | 0.000 | -1475.989 | -551.385 | 
| year:Make[T.alfa-romeo]:supertype[T.SUV] | 3553.8346 | 5535.382 | 0.642 | 0.521 | -7295.367 | 1.44e+04 | 
| year:Make[T.aston-martin]:supertype[T.SUV] | 5.672e-09 | 1.05e-08 | 0.541 | 0.588 | -1.49e-08 | 2.62e-08 | 
| year:Make[T.audi]:supertype[T.SUV] | -543.3098 | 79.903 | -6.800 | 0.000 | -699.918 | -386.701 | 
| year:Make[T.bmw]:supertype[T.SUV] | -324.1117 | 66.932 | -4.842 | 0.000 | -455.298 | -192.926 | 
| year:Make[T.buick]:supertype[T.SUV] | -9.9121 | 77.251 | -0.128 | 0.898 | -161.323 | 141.498 | 
| year:Make[T.cadillac]:supertype[T.SUV] | -546.0602 | 72.110 | -7.573 | 0.000 | -687.394 | -404.727 | 
| year:Make[T.chevrolet]:supertype[T.SUV] | -303.7908 | 56.586 | -5.369 | 0.000 | -414.698 | -192.884 | 
| year:Make[T.chrysler]:supertype[T.SUV] | -1102.0998 | 84.073 | -13.109 | 0.000 | -1266.880 | -937.319 | 
| year:Make[T.dodge]:supertype[T.SUV] | -1522.5435 | 67.746 | -22.474 | 0.000 | -1655.323 | -1389.764 | 
| year:Make[T.ferrari]:supertype[T.SUV] | 1.03e-08 | 4.3e-09 | 2.398 | 0.016 | 1.88e-09 | 1.87e-08 | 
| year:Make[T.fiat]:supertype[T.SUV] | -1185.8400 | 1626.929 | -0.729 | 0.466 | -4374.578 | 2002.898 | 
| year:Make[T.ford]:supertype[T.SUV] | -765.6623 | 56.098 | -13.649 | 0.000 | -875.612 | -655.712 | 
| year:Make[T.gmc]:supertype[T.SUV] | -476.8812 | 392.000 | -1.217 | 0.224 | -1245.191 | 291.428 | 
| year:Make[T.harley-davidson]:supertype[T.SUV] | 0.8421 | 5.424 | 0.155 | 0.877 | -9.790 | 11.474 | 
| year:Make[T.honda]:supertype[T.SUV] | -690.7045 | 58.649 | -11.777 | 0.000 | -805.655 | -575.754 | 
| year:Make[T.hyundai]:supertype[T.SUV] | -702.5609 | 71.933 | -9.767 | 0.000 | -843.547 | -561.575 | 
| year:Make[T.infiniti]:supertype[T.SUV] | -882.6859 | 80.852 | -10.917 | 0.000 | -1041.153 | -724.219 | 
| year:Make[T.jaguar]:supertype[T.SUV] | 218.0156 | 294.826 | 0.739 | 0.460 | -359.835 | 795.866 | 
| year:Make[T.jeep]:supertype[T.SUV] | -922.1230 | 104.647 | -8.812 | 0.000 | -1127.229 | -717.017 | 
| year:Make[T.kia]:supertype[T.SUV] | -1014.2089 | 78.580 | -12.907 | 0.000 | -1168.223 | -860.194 | 
| year:Make[T.land rover]:supertype[T.SUV] | 254.0843 | 320.612 | 0.792 | 0.428 | -374.307 | 882.476 | 
| year:Make[T.lexus]:supertype[T.SUV] | -993.6205 | 65.526 | -15.164 | 0.000 | -1122.050 | -865.191 | 
| year:Make[T.lincoln]:supertype[T.SUV] | -358.1332 | 81.509 | -4.394 | 0.000 | -517.889 | -198.377 | 
| year:Make[T.mazda]:supertype[T.SUV] | -632.2703 | 84.576 | -7.476 | 0.000 | -798.036 | -466.504 | 
| year:Make[T.mercedes-benz]:supertype[T.SUV] | -512.5623 | 70.550 | -7.265 | 0.000 | -650.839 | -374.286 | 
| year:Make[T.mercury]:supertype[T.SUV] | -750.7042 | 198.366 | -3.784 | 0.000 | -1139.496 | -361.912 | 
| year:Make[T.mini]:supertype[T.SUV] | -782.4161 | 204.060 | -3.834 | 0.000 | -1182.369 | -382.463 | 
| year:Make[T.mitsubishi]:supertype[T.SUV] | -558.7501 | 83.125 | -6.722 | 0.000 | -721.673 | -395.827 | 
| year:Make[T.nissan]:supertype[T.SUV] | -802.4509 | 62.289 | -12.883 | 0.000 | -924.535 | -680.367 | 
| year:Make[T.pontiac]:supertype[T.SUV] | -332.7592 | 304.569 | -1.093 | 0.275 | -929.706 | 264.188 | 
| year:Make[T.porsche]:supertype[T.SUV] | 300.8436 | 141.630 | 2.124 | 0.034 | 23.252 | 578.435 | 
| year:Make[T.ram]:supertype[T.SUV] | -717.0353 | 576.619 | -1.244 | 0.214 | -1847.192 | 413.122 | 
| year:Make[T.rover]:supertype[T.SUV] | 4639.2352 | 1319.163 | 3.517 | 0.000 | 2053.711 | 7224.759 | 
| year:Make[T.saturn]:supertype[T.SUV] | -1100.7078 | 308.399 | -3.569 | 0.000 | -1705.162 | -496.254 | 
| year:Make[T.subaru]:supertype[T.SUV] | -1176.2345 | 66.582 | -17.666 | 0.000 | -1306.734 | -1045.735 | 
| year:Make[T.tesla]:supertype[T.SUV] | -2548.1806 | 1195.861 | -2.131 | 0.033 | -4892.037 | -204.324 | 
| year:Make[T.toyota]:supertype[T.SUV] | -418.9533 | 56.224 | -7.451 | 0.000 | -529.151 | -308.755 | 
| year:Make[T.volkswagen]:supertype[T.SUV] | -488.3926 | 78.884 | -6.191 | 0.000 | -643.004 | -333.781 | 
| year:Make[T.volvo]:supertype[T.SUV] | -679.1733 | 81.300 | -8.354 | 0.000 | -838.520 | -519.827 | 
| year:Make[T.alfa-romeo]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.aston-martin]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.audi]:supertype[T.TRUCK] | -143.1711 | 2320.916 | -0.062 | 0.951 | -4692.105 | 4405.763 | 
| year:Make[T.bmw]:supertype[T.TRUCK] | -557.3394 | 1491.172 | -0.374 | 0.709 | -3479.996 | 2365.318 | 
| year:Make[T.buick]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.cadillac]:supertype[T.TRUCK] | 464.0311 | 1173.510 | 0.395 | 0.693 | -1836.018 | 2764.080 | 
| year:Make[T.chevrolet]:supertype[T.TRUCK] | 1692.5332 | 1103.363 | 1.534 | 0.125 | -470.029 | 3855.095 | 
| year:Make[T.chrysler]:supertype[T.TRUCK] | -1116.9148 | 2111.972 | -0.529 | 0.597 | -5256.324 | 3022.495 | 
| year:Make[T.dodge]:supertype[T.TRUCK] | -606.0154 | 1108.273 | -0.547 | 0.585 | -2778.201 | 1566.171 | 
| year:Make[T.ferrari]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.fiat]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.ford]:supertype[T.TRUCK] | 1131.3748 | 1103.331 | 1.025 | 0.305 | -1031.125 | 3293.874 | 
| year:Make[T.gmc]:supertype[T.TRUCK] | 1435.3064 | 1169.542 | 1.227 | 0.220 | -856.964 | 3727.577 | 
| year:Make[T.harley-davidson]:supertype[T.TRUCK] | 291.6722 | 812.486 | 0.359 | 0.720 | -1300.780 | 1884.124 | 
| year:Make[T.honda]:supertype[T.TRUCK] | 1476.6720 | 1105.852 | 1.335 | 0.182 | -690.768 | 3644.112 | 
| year:Make[T.hyundai]:supertype[T.TRUCK] | 340.2012 | 1544.367 | 0.220 | 0.826 | -2686.717 | 3367.119 | 
| year:Make[T.infiniti]:supertype[T.TRUCK] | 0.7437 | 2.319 | 0.321 | 0.748 | -3.802 | 5.289 | 
| year:Make[T.jaguar]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.jeep]:supertype[T.TRUCK] | 1287.8146 | 1110.312 | 1.160 | 0.246 | -888.368 | 3463.997 | 
| year:Make[T.kia]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.land rover]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.lexus]:supertype[T.TRUCK] | 9.5104 | 5.044 | 1.885 | 0.059 | -0.376 | 19.397 | 
| year:Make[T.lincoln]:supertype[T.TRUCK] | -1062.8290 | 1365.905 | -0.778 | 0.437 | -3739.966 | 1614.308 | 
| year:Make[T.mazda]:supertype[T.TRUCK] | -149.1741 | 1141.233 | -0.131 | 0.896 | -2385.960 | 2087.612 | 
| year:Make[T.mercedes-benz]:supertype[T.TRUCK] | 960.1790 | 1181.179 | 0.813 | 0.416 | -1354.902 | 3275.259 | 
| year:Make[T.mercury]:supertype[T.TRUCK] | 1316.2794 | 2919.822 | 0.451 | 0.652 | -4406.495 | 7039.054 | 
| year:Make[T.mini]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.mitsubishi]:supertype[T.TRUCK] | 187.5906 | 1108.195 | 0.169 | 0.866 | -1984.442 | 2359.623 | 
| year:Make[T.nissan]:supertype[T.TRUCK] | 979.3190 | 1103.936 | 0.887 | 0.375 | -1184.367 | 3143.005 | 
| year:Make[T.pontiac]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.porsche]:supertype[T.TRUCK] | -8.0194 | 5.752 | -1.394 | 0.163 | -19.293 | 3.254 | 
| year:Make[T.ram]:supertype[T.TRUCK] | 1116.3601 | 1215.690 | 0.918 | 0.358 | -1266.360 | 3499.080 | 
| year:Make[T.rover]:supertype[T.TRUCK] | 4732.7496 | 2014.871 | 2.349 | 0.019 | 783.656 | 8681.843 | 
| year:Make[T.saturn]:supertype[T.TRUCK] | 1.1333 | 4.797 | 0.236 | 0.813 | -8.268 | 10.535 | 
| year:Make[T.subaru]:supertype[T.TRUCK] | -1005.9875 | 1204.969 | -0.835 | 0.404 | -3367.696 | 1355.721 | 
| year:Make[T.tesla]:supertype[T.TRUCK] | 0 | 0 | nan | nan | 0 | 0 | 
| year:Make[T.toyota]:supertype[T.TRUCK] | 1233.1186 | 1103.432 | 1.118 | 0.264 | -929.579 | 3395.816 | 
| year:Make[T.volkswagen]:supertype[T.TRUCK] | -165.0646 | 1369.623 | -0.121 | 0.904 | -2849.489 | 2519.360 | 
| year:Make[T.volvo]:supertype[T.TRUCK] | -927.4316 | 1133.760 | -0.818 | 0.413 | -3149.571 | 1294.707 | 
| Omnibus: | 47845.201 | Durbin-Watson: | 2.001 | 
|---|---|---|---|
| Prob(Omnibus): | 0.000 | Jarque-Bera (JB): | 128245.848 | 
| Skew: | 1.048 | Prob(JB): | 0.00 | 
| Kurtosis: | 5.839 | Cond. No. | 1.01e+16 | 
From the model summary, we can see that these variables are a good indicator of price as their p-values, noted by the P>|t| column, are mostly 0 to 0.05 for each individual component of each variable suggesting that their impact on price is different from a 0-coefficient value. There are some NAN components but that is mostly just makes that don't contain certain supertypes, which is not ideal but fine since then the price will be predicted based on the variables separately making it less accurate but still within a certain range. However, the worst indicator for price seems to be the TRUCK supertype as all its p-values are very large, nearly 1. We can test this effect by running both with and without the supertype truck for our predictions.
dfuT = dfu[dfu['supertype'] != 'TRUCK']
part_90T = dfuT.sample(frac = 0.90, random_state=1)
rest_part_10T = dfu.drop(part_90T.index)
model2 = smf.ols(formula="price ~ year * Make * supertype", data=part_90T).fit()
model2.summary()
| Dep. Variable: | price | R-squared: | 0.624 | 
|---|---|---|---|
| Model: | OLS | Adj. R-squared: | 0.624 | 
| Method: | Least Squares | F-statistic: | 1404. | 
| Date: | Mon, 20 Dec 2021 | Prob (F-statistic): | 0.00 | 
| Time: | 23:01:55 | Log-Likelihood: | -1.9605e+06 | 
| No. Observations: | 190453 | AIC: | 3.921e+06 | 
| Df Residuals: | 190227 | BIC: | 3.924e+06 | 
| Df Model: | 225 | ||
| Covariance Type: | nonrobust | 
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| Intercept | -2.824e+06 | 6.13e+04 | -46.041 | 0.000 | -2.94e+06 | -2.7e+06 | 
| Make[T.alfa-romeo] | -1.573e+06 | 7.56e+05 | -2.079 | 0.038 | -3.05e+06 | -9.04e+04 | 
| Make[T.aston-martin] | 7.414e+06 | 7.15e+05 | 10.376 | 0.000 | 6.01e+06 | 8.81e+06 | 
| Make[T.audi] | -1.681e+06 | 8.27e+04 | -20.324 | 0.000 | -1.84e+06 | -1.52e+06 | 
| Make[T.bmw] | -6.243e+05 | 7.1e+04 | -8.791 | 0.000 | -7.63e+05 | -4.85e+05 | 
| Make[T.buick] | 8.319e+05 | 9.24e+04 | 9.000 | 0.000 | 6.51e+05 | 1.01e+06 | 
| Make[T.cadillac] | -8.948e+05 | 8.04e+04 | -11.123 | 0.000 | -1.05e+06 | -7.37e+05 | 
| Make[T.chevrolet] | 1.389e+06 | 6.87e+04 | 20.210 | 0.000 | 1.25e+06 | 1.52e+06 | 
| Make[T.chrysler] | 4.368e+05 | 8.64e+04 | 5.057 | 0.000 | 2.67e+05 | 6.06e+05 | 
| Make[T.dodge] | -1.305e+06 | 8.61e+04 | -15.163 | 0.000 | -1.47e+06 | -1.14e+06 | 
| Make[T.ferrari] | 3.306e+06 | 4.42e+06 | 0.749 | 0.454 | -5.35e+06 | 1.2e+07 | 
| Make[T.fiat] | -1.493e+06 | 3.24e+05 | -4.604 | 0.000 | -2.13e+06 | -8.57e+05 | 
| Make[T.ford] | 3.627e+05 | 6.87e+04 | 5.281 | 0.000 | 2.28e+05 | 4.97e+05 | 
| Make[T.gmc] | 1.873e+05 | 7.36e+05 | 0.254 | 0.799 | -1.26e+06 | 1.63e+06 | 
| Make[T.harley-davidson] | 2.336e+06 | 3.01e+05 | 7.759 | 0.000 | 1.75e+06 | 2.93e+06 | 
| Make[T.honda] | 4.981e+05 | 6.84e+04 | 7.286 | 0.000 | 3.64e+05 | 6.32e+05 | 
| Make[T.hyundai] | 3.704e+05 | 8.19e+04 | 4.524 | 0.000 | 2.1e+05 | 5.31e+05 | 
| Make[T.infiniti] | -8.663e+05 | 8.86e+04 | -9.779 | 0.000 | -1.04e+06 | -6.93e+05 | 
| Make[T.jaguar] | -4.254e+04 | 1.06e+05 | -0.403 | 0.687 | -2.5e+05 | 1.65e+05 | 
| Make[T.jeep] | -4.016e+05 | 1.78e+05 | -2.258 | 0.024 | -7.5e+05 | -5.3e+04 | 
| Make[T.kia] | -1.73e+05 | 1.03e+05 | -1.675 | 0.094 | -3.75e+05 | 2.94e+04 | 
| Make[T.land rover] | -5.29e+05 | 6.27e+05 | -0.843 | 0.399 | -1.76e+06 | 7.01e+05 | 
| Make[T.lexus] | -5.77e+05 | 7.7e+04 | -7.495 | 0.000 | -7.28e+05 | -4.26e+05 | 
| Make[T.lincoln] | -3.492e+05 | 8.67e+04 | -4.029 | 0.000 | -5.19e+05 | -1.79e+05 | 
| Make[T.mazda] | 4.422e+05 | 9.29e+04 | 4.759 | 0.000 | 2.6e+05 | 6.24e+05 | 
| Make[T.mercedes-benz] | -7.281e+05 | 7.46e+04 | -9.757 | 0.000 | -8.74e+05 | -5.82e+05 | 
| Make[T.mercury] | 2.417e+06 | 2.18e+05 | 11.065 | 0.000 | 1.99e+06 | 2.85e+06 | 
| Make[T.mini] | -5.479e+05 | 1.12e+05 | -4.912 | 0.000 | -7.67e+05 | -3.29e+05 | 
| Make[T.mitsubishi] | 1.132e+06 | 1.03e+05 | 10.987 | 0.000 | 9.3e+05 | 1.33e+06 | 
| Make[T.nissan] | 3.821e+05 | 7.45e+04 | 5.129 | 0.000 | 2.36e+05 | 5.28e+05 | 
| Make[T.pontiac] | 3.166e+06 | 1.78e+05 | 17.827 | 0.000 | 2.82e+06 | 3.51e+06 | 
| Make[T.porsche] | -4.81e+05 | 1.52e+05 | -3.171 | 0.002 | -7.78e+05 | -1.84e+05 | 
| Make[T.ram] | 3.19e+05 | 9.15e+05 | 0.349 | 0.727 | -1.47e+06 | 2.11e+06 | 
| Make[T.rover] | 6.066e+06 | 1.9e+06 | 3.192 | 0.001 | 2.34e+06 | 9.79e+06 | 
| Make[T.saturn] | 1.74e+06 | 2.92e+05 | 5.968 | 0.000 | 1.17e+06 | 2.31e+06 | 
| Make[T.subaru] | -3.536e+05 | 8.72e+04 | -4.057 | 0.000 | -5.24e+05 | -1.83e+05 | 
| Make[T.tesla] | 9.555e+05 | 2.14e+05 | 4.468 | 0.000 | 5.36e+05 | 1.37e+06 | 
| Make[T.toyota] | 6.991e+05 | 6.82e+04 | 10.251 | 0.000 | 5.65e+05 | 8.33e+05 | 
| Make[T.volkswagen] | 2.483e+05 | 7.83e+04 | 3.172 | 0.002 | 9.49e+04 | 4.02e+05 | 
| Make[T.volvo] | -1.19e+06 | 9.52e+04 | -12.496 | 0.000 | -1.38e+06 | -1e+06 | 
| supertype[T.OTHER] | -3.505e+06 | 2.44e+05 | -14.378 | 0.000 | -3.98e+06 | -3.03e+06 | 
| supertype[T.SUV] | -1.85e+06 | 9.68e+04 | -19.125 | 0.000 | -2.04e+06 | -1.66e+06 | 
| Make[T.alfa-romeo]:supertype[T.OTHER] | -0.0022 | 0.001 | -3.101 | 0.002 | -0.004 | -0.001 | 
| Make[T.aston-martin]:supertype[T.OTHER] | 6.599e-05 | 1.87e-05 | 3.537 | 0.000 | 2.94e-05 | 0.000 | 
| Make[T.audi]:supertype[T.OTHER] | 6.279e+05 | 3.15e+05 | 1.994 | 0.046 | 1.07e+04 | 1.25e+06 | 
| Make[T.bmw]:supertype[T.OTHER] | 2.81e+06 | 2.84e+05 | 9.893 | 0.000 | 2.25e+06 | 3.37e+06 | 
| Make[T.buick]:supertype[T.OTHER] | 1.545e+06 | 2.98e+05 | 5.190 | 0.000 | 9.62e+05 | 2.13e+06 | 
| Make[T.cadillac]:supertype[T.OTHER] | 2.243e+06 | 2.98e+05 | 7.520 | 0.000 | 1.66e+06 | 2.83e+06 | 
| Make[T.chevrolet]:supertype[T.OTHER] | 2.416e+06 | 2.53e+05 | 9.566 | 0.000 | 1.92e+06 | 2.91e+06 | 
| Make[T.chrysler]:supertype[T.OTHER] | 2.193e+06 | 2.76e+05 | 7.933 | 0.000 | 1.65e+06 | 2.73e+06 | 
| Make[T.dodge]:supertype[T.OTHER] | 4.695e+06 | 2.69e+05 | 17.424 | 0.000 | 4.17e+06 | 5.22e+06 | 
| Make[T.ferrari]:supertype[T.OTHER] | -5.283e-05 | 8.09e-06 | -6.527 | 0.000 | -6.87e-05 | -3.7e-05 | 
| Make[T.fiat]:supertype[T.OTHER] | 1.326e+06 | 8.47e+05 | 1.565 | 0.118 | -3.34e+05 | 2.99e+06 | 
| Make[T.ford]:supertype[T.OTHER] | 3.334e+06 | 2.5e+05 | 13.332 | 0.000 | 2.84e+06 | 3.82e+06 | 
| Make[T.gmc]:supertype[T.OTHER] | 2.517e+06 | 7.79e+05 | 3.231 | 0.001 | 9.9e+05 | 4.04e+06 | 
| Make[T.harley-davidson]:supertype[T.OTHER] | 2.336e+06 | 3.01e+05 | 7.759 | 0.000 | 1.75e+06 | 2.93e+06 | 
| Make[T.honda]:supertype[T.OTHER] | 2.354e+06 | 2.63e+05 | 8.953 | 0.000 | 1.84e+06 | 2.87e+06 | 
| Make[T.hyundai]:supertype[T.OTHER] | 1.66e+06 | 3.25e+05 | 5.115 | 0.000 | 1.02e+06 | 2.3e+06 | 
| Make[T.infiniti]:supertype[T.OTHER] | 2.582e+06 | 3.46e+05 | 7.468 | 0.000 | 1.9e+06 | 3.26e+06 | 
| Make[T.jaguar]:supertype[T.OTHER] | 6.851e+05 | 4.21e+05 | 1.627 | 0.104 | -1.4e+05 | 1.51e+06 | 
| Make[T.jeep]:supertype[T.OTHER] | 4.03e+06 | 3.04e+05 | 13.269 | 0.000 | 3.43e+06 | 4.63e+06 | 
| Make[T.kia]:supertype[T.OTHER] | 3.015e+06 | 3.27e+05 | 9.219 | 0.000 | 2.37e+06 | 3.66e+06 | 
| Make[T.land rover]:supertype[T.OTHER] | 0.0072 | 0.001 | 5.111 | 0.000 | 0.004 | 0.010 | 
| Make[T.lexus]:supertype[T.OTHER] | 2.477e+06 | 3.01e+05 | 8.227 | 0.000 | 1.89e+06 | 3.07e+06 | 
| Make[T.lincoln]:supertype[T.OTHER] | 2.428e+06 | 3.06e+05 | 7.937 | 0.000 | 1.83e+06 | 3.03e+06 | 
| Make[T.mazda]:supertype[T.OTHER] | 2.232e+06 | 2.97e+05 | 7.514 | 0.000 | 1.65e+06 | 2.81e+06 | 
| Make[T.mercedes-benz]:supertype[T.OTHER] | 1.702e+06 | 2.92e+05 | 5.829 | 0.000 | 1.13e+06 | 2.27e+06 | 
| Make[T.mercury]:supertype[T.OTHER] | 4.019e+06 | 5.41e+05 | 7.424 | 0.000 | 2.96e+06 | 5.08e+06 | 
| Make[T.mini]:supertype[T.OTHER] | 6.613e+05 | 4.08e+05 | 1.620 | 0.105 | -1.39e+05 | 1.46e+06 | 
| Make[T.mitsubishi]:supertype[T.OTHER] | 2.905e+06 | 3.37e+05 | 8.609 | 0.000 | 2.24e+06 | 3.57e+06 | 
| Make[T.nissan]:supertype[T.OTHER] | 2.879e+06 | 3.01e+05 | 9.548 | 0.000 | 2.29e+06 | 3.47e+06 | 
| Make[T.pontiac]:supertype[T.OTHER] | 5.646e+06 | 7.71e+05 | 7.322 | 0.000 | 4.13e+06 | 7.16e+06 | 
| Make[T.porsche]:supertype[T.OTHER] | 4.458e+06 | 5.6e+05 | 7.962 | 0.000 | 3.36e+06 | 5.56e+06 | 
| Make[T.ram]:supertype[T.OTHER] | 3.077e+06 | 9.52e+05 | 3.233 | 0.001 | 1.21e+06 | 4.94e+06 | 
| Make[T.rover]:supertype[T.OTHER] | -3.734e+06 | 1.93e+06 | -1.930 | 0.054 | -7.52e+06 | 5.71e+04 | 
| Make[T.saturn]:supertype[T.OTHER] | -7.074e+06 | 2.62e+06 | -2.703 | 0.007 | -1.22e+07 | -1.94e+06 | 
| Make[T.subaru]:supertype[T.OTHER] | 3.418e+06 | 3.55e+05 | 9.635 | 0.000 | 2.72e+06 | 4.11e+06 | 
| Make[T.tesla]:supertype[T.OTHER] | 5.579e+06 | 2.3e+06 | 2.422 | 0.015 | 1.06e+06 | 1.01e+07 | 
| Make[T.toyota]:supertype[T.OTHER] | 1.28e+06 | 2.57e+05 | 4.978 | 0.000 | 7.76e+05 | 1.78e+06 | 
| Make[T.volkswagen]:supertype[T.OTHER] | 4.3e+06 | 2.76e+05 | 15.592 | 0.000 | 3.76e+06 | 4.84e+06 | 
| Make[T.volvo]:supertype[T.OTHER] | 1.87e+06 | 4.53e+05 | 4.128 | 0.000 | 9.82e+05 | 2.76e+06 | 
| Make[T.alfa-romeo]:supertype[T.SUV] | -7.597e+06 | 1.05e+07 | -0.727 | 0.467 | -2.81e+07 | 1.29e+07 | 
| Make[T.aston-martin]:supertype[T.SUV] | -1.234e-05 | 8.09e-06 | -1.526 | 0.127 | -2.82e-05 | 3.52e-06 | 
| Make[T.audi]:supertype[T.SUV] | 1.114e+06 | 1.51e+05 | 7.374 | 0.000 | 8.18e+05 | 1.41e+06 | 
| Make[T.bmw]:supertype[T.SUV] | 6.49e+05 | 1.27e+05 | 5.128 | 0.000 | 4.01e+05 | 8.97e+05 | 
| Make[T.buick]:supertype[T.SUV] | 6.944e+04 | 1.45e+05 | 0.479 | 0.632 | -2.14e+05 | 3.53e+05 | 
| Make[T.cadillac]:supertype[T.SUV] | 1.132e+06 | 1.37e+05 | 8.272 | 0.000 | 8.64e+05 | 1.4e+06 | 
| Make[T.chevrolet]:supertype[T.SUV] | 6.277e+05 | 1.07e+05 | 5.862 | 0.000 | 4.18e+05 | 8.38e+05 | 
| Make[T.chrysler]:supertype[T.SUV] | 2.201e+06 | 1.57e+05 | 13.986 | 0.000 | 1.89e+06 | 2.51e+06 | 
| Make[T.dodge]:supertype[T.SUV] | 3.127e+06 | 1.29e+05 | 24.318 | 0.000 | 2.87e+06 | 3.38e+06 | 
| Make[T.ferrari]:supertype[T.SUV] | -2.533e-05 | 1.87e-05 | -1.357 | 0.175 | -6.19e-05 | 1.13e-05 | 
| Make[T.fiat]:supertype[T.SUV] | 2.085e+06 | 2.97e+06 | 0.703 | 0.482 | -3.73e+06 | 7.9e+06 | 
| Make[T.ford]:supertype[T.SUV] | 1.588e+06 | 1.06e+05 | 14.955 | 0.000 | 1.38e+06 | 1.8e+06 | 
| Make[T.gmc]:supertype[T.SUV] | 1.14e+06 | 7.42e+05 | 1.537 | 0.124 | -3.14e+05 | 2.59e+06 | 
| Make[T.harley-davidson]:supertype[T.SUV] | 0.0004 | 0.002 | 0.145 | 0.885 | -0.005 | 0.005 | 
| Make[T.honda]:supertype[T.SUV] | 1.407e+06 | 1.11e+05 | 12.689 | 0.000 | 1.19e+06 | 1.62e+06 | 
| Make[T.hyundai]:supertype[T.SUV] | 1.466e+06 | 1.36e+05 | 10.797 | 0.000 | 1.2e+06 | 1.73e+06 | 
| Make[T.infiniti]:supertype[T.SUV] | 1.817e+06 | 1.51e+05 | 12.008 | 0.000 | 1.52e+06 | 2.11e+06 | 
| Make[T.jaguar]:supertype[T.SUV] | -3.468e+05 | 4.97e+05 | -0.697 | 0.486 | -1.32e+06 | 6.28e+05 | 
| Make[T.jeep]:supertype[T.SUV] | 1.936e+06 | 1.95e+05 | 9.912 | 0.000 | 1.55e+06 | 2.32e+06 | 
| Make[T.kia]:supertype[T.SUV] | 2.049e+06 | 1.48e+05 | 13.870 | 0.000 | 1.76e+06 | 2.34e+06 | 
| Make[T.land rover]:supertype[T.SUV] | -5.29e+05 | 6.27e+05 | -0.843 | 0.399 | -1.76e+06 | 7.01e+05 | 
| Make[T.lexus]:supertype[T.SUV] | 2.053e+06 | 1.24e+05 | 16.557 | 0.000 | 1.81e+06 | 2.3e+06 | 
| Make[T.lincoln]:supertype[T.SUV] | 7.351e+05 | 1.54e+05 | 4.780 | 0.000 | 4.34e+05 | 1.04e+06 | 
| Make[T.mazda]:supertype[T.SUV] | 1.349e+06 | 1.59e+05 | 8.469 | 0.000 | 1.04e+06 | 1.66e+06 | 
| Make[T.mercedes-benz]:supertype[T.SUV] | 1.053e+06 | 1.33e+05 | 7.912 | 0.000 | 7.92e+05 | 1.31e+06 | 
| Make[T.mercury]:supertype[T.SUV] | 1.524e+06 | 3.77e+05 | 4.038 | 0.000 | 7.84e+05 | 2.26e+06 | 
| Make[T.mini]:supertype[T.SUV] | 1.331e+06 | 3.91e+05 | 3.407 | 0.001 | 5.65e+05 | 2.1e+06 | 
| Make[T.mitsubishi]:supertype[T.SUV] | 1.114e+06 | 1.59e+05 | 7.020 | 0.000 | 8.03e+05 | 1.42e+06 | 
| Make[T.nissan]:supertype[T.SUV] | 1.648e+06 | 1.18e+05 | 13.990 | 0.000 | 1.42e+06 | 1.88e+06 | 
| Make[T.pontiac]:supertype[T.SUV] | 5.279e+05 | 5.56e+05 | 0.950 | 0.342 | -5.61e+05 | 1.62e+06 | 
| Make[T.porsche]:supertype[T.SUV] | -6.6e+05 | 2.63e+05 | -2.505 | 0.012 | -1.18e+06 | -1.44e+05 | 
| Make[T.ram]:supertype[T.SUV] | 1.686e+06 | 1.05e+06 | 1.612 | 0.107 | -3.63e+05 | 3.73e+06 | 
| Make[T.rover]:supertype[T.SUV] | -6.408e+06 | 1.9e+06 | -3.365 | 0.001 | -1.01e+07 | -2.68e+06 | 
| Make[T.saturn]:supertype[T.SUV] | 2.266e+06 | 5.89e+05 | 3.847 | 0.000 | 1.11e+06 | 3.42e+06 | 
| Make[T.subaru]:supertype[T.SUV] | 2.403e+06 | 1.26e+05 | 19.067 | 0.000 | 2.16e+06 | 2.65e+06 | 
| Make[T.tesla]:supertype[T.SUV] | 5.051e+06 | 2.27e+06 | 2.222 | 0.026 | 5.96e+05 | 9.51e+06 | 
| Make[T.toyota]:supertype[T.SUV] | 8.934e+05 | 1.06e+05 | 8.397 | 0.000 | 6.85e+05 | 1.1e+06 | 
| Make[T.volkswagen]:supertype[T.SUV] | 9.811e+05 | 1.48e+05 | 6.617 | 0.000 | 6.9e+05 | 1.27e+06 | 
| Make[T.volvo]:supertype[T.SUV] | 1.231e+06 | 1.53e+05 | 8.065 | 0.000 | 9.31e+05 | 1.53e+06 | 
| year | 1411.2534 | 30.479 | 46.303 | 0.000 | 1351.516 | 1470.991 | 
| year:Make[T.alfa-romeo] | 782.3028 | 374.721 | 2.088 | 0.037 | 47.859 | 1516.746 | 
| year:Make[T.aston-martin] | -3682.4042 | 355.421 | -10.361 | 0.000 | -4379.022 | -2985.786 | 
| year:Make[T.audi] | 837.6094 | 41.090 | 20.385 | 0.000 | 757.074 | 918.145 | 
| year:Make[T.bmw] | 312.2086 | 35.285 | 8.848 | 0.000 | 243.051 | 381.367 | 
| year:Make[T.buick] | -415.1729 | 45.967 | -9.032 | 0.000 | -505.268 | -325.078 | 
| year:Make[T.cadillac] | 445.9492 | 39.958 | 11.160 | 0.000 | 367.632 | 524.266 | 
| year:Make[T.chevrolet] | -690.3653 | 34.141 | -20.221 | 0.000 | -757.280 | -623.450 | 
| year:Make[T.chrysler] | -218.8414 | 42.925 | -5.098 | 0.000 | -302.973 | -134.710 | 
| year:Make[T.dodge] | 649.2811 | 42.757 | 15.185 | 0.000 | 565.479 | 733.084 | 
| year:Make[T.ferrari] | -1649.2534 | 2190.872 | -0.753 | 0.452 | -5943.310 | 2644.803 | 
| year:Make[T.fiat] | 737.1436 | 160.895 | 4.582 | 0.000 | 421.793 | 1052.494 | 
| year:Make[T.ford] | -181.4470 | 34.127 | -5.317 | 0.000 | -248.336 | -114.558 | 
| year:Make[T.gmc] | -88.1946 | 365.937 | -0.241 | 0.810 | -805.422 | 629.032 | 
| year:Make[T.harley-davidson] | -1164.2404 | 149.216 | -7.802 | 0.000 | -1456.700 | -871.781 | 
| year:Make[T.honda] | -249.1044 | 33.971 | -7.333 | 0.000 | -315.687 | -182.522 | 
| year:Make[T.hyundai] | -186.9584 | 40.664 | -4.598 | 0.000 | -266.658 | -107.259 | 
| year:Make[T.infiniti] | 431.4998 | 43.997 | 9.807 | 0.000 | 345.266 | 517.733 | 
| year:Make[T.jaguar] | 24.2028 | 52.507 | 0.461 | 0.645 | -78.710 | 127.116 | 
| year:Make[T.jeep] | 204.5267 | 88.347 | 2.315 | 0.021 | 31.368 | 377.685 | 
| year:Make[T.kia] | 82.6089 | 51.278 | 1.611 | 0.107 | -17.895 | 183.113 | 
| year:Make[T.land rover] | 272.2195 | 313.062 | 0.870 | 0.385 | -341.375 | 885.814 | 
| year:Make[T.lexus] | 289.2385 | 38.252 | 7.561 | 0.000 | 214.265 | 364.212 | 
| year:Make[T.lincoln] | 174.4637 | 43.056 | 4.052 | 0.000 | 90.075 | 258.852 | 
| year:Make[T.mazda] | -221.5983 | 46.176 | -4.799 | 0.000 | -312.102 | -131.094 | 
| year:Make[T.mercedes-benz] | 365.2705 | 37.083 | 9.850 | 0.000 | 292.589 | 437.952 | 
| year:Make[T.mercury] | -1206.1495 | 108.949 | -11.071 | 0.000 | -1419.687 | -992.612 | 
| year:Make[T.mini] | 271.0152 | 55.412 | 4.891 | 0.000 | 162.408 | 379.622 | 
| year:Make[T.mitsubishi] | -564.7123 | 51.153 | -11.040 | 0.000 | -664.971 | -464.454 | 
| year:Make[T.nissan] | -192.6410 | 37.015 | -5.204 | 0.000 | -265.190 | -120.092 | 
| year:Make[T.pontiac] | -1578.1365 | 88.494 | -17.833 | 0.000 | -1751.582 | -1404.691 | 
| year:Make[T.porsche] | 249.4607 | 75.558 | 3.302 | 0.001 | 101.369 | 397.553 | 
| year:Make[T.ram] | -155.8186 | 454.978 | -0.342 | 0.732 | -1047.564 | 735.927 | 
| year:Make[T.rover] | -3010.6348 | 944.173 | -3.189 | 0.001 | -4861.192 | -1160.078 | 
| year:Make[T.saturn] | -868.3433 | 145.365 | -5.974 | 0.000 | -1153.256 | -583.431 | 
| year:Make[T.subaru] | 175.0105 | 43.291 | 4.043 | 0.000 | 90.161 | 259.860 | 
| year:Make[T.tesla] | -466.1027 | 106.050 | -4.395 | 0.000 | -673.958 | -258.247 | 
| year:Make[T.toyota] | -349.3075 | 33.890 | -10.307 | 0.000 | -415.732 | -282.883 | 
| year:Make[T.volkswagen] | -125.4070 | 38.891 | -3.225 | 0.001 | -201.632 | -49.182 | 
| year:Make[T.volvo] | 592.0568 | 47.310 | 12.515 | 0.000 | 499.331 | 684.782 | 
| year:supertype[T.OTHER] | 1741.4932 | 120.810 | 14.415 | 0.000 | 1504.708 | 1978.278 | 
| year:supertype[T.SUV] | 920.8438 | 48.052 | 19.164 | 0.000 | 826.664 | 1015.024 | 
| year:Make[T.alfa-romeo]:supertype[T.OTHER] | -4.4736 | 1.464 | -3.056 | 0.002 | -7.343 | -1.604 | 
| year:Make[T.aston-martin]:supertype[T.OTHER] | 6.846e-09 | 1.64e-08 | 0.418 | 0.676 | -2.53e-08 | 3.9e-08 | 
| year:Make[T.audi]:supertype[T.OTHER] | -310.5085 | 156.092 | -1.989 | 0.047 | -616.446 | -4.571 | 
| year:Make[T.bmw]:supertype[T.OTHER] | -1393.1275 | 140.785 | -9.895 | 0.000 | -1669.063 | -1117.192 | 
| year:Make[T.buick]:supertype[T.OTHER] | -765.0765 | 147.579 | -5.184 | 0.000 | -1054.327 | -475.826 | 
| year:Make[T.cadillac]:supertype[T.OTHER] | -1111.7647 | 147.898 | -7.517 | 0.000 | -1401.641 | -821.888 | 
| year:Make[T.chevrolet]:supertype[T.OTHER] | -1196.2301 | 125.159 | -9.558 | 0.000 | -1441.538 | -950.922 | 
| year:Make[T.chrysler]:supertype[T.OTHER] | -1087.8573 | 137.041 | -7.938 | 0.000 | -1356.455 | -819.260 | 
| year:Make[T.dodge]:supertype[T.OTHER] | -2333.9489 | 133.584 | -17.472 | 0.000 | -2595.770 | -2072.128 | 
| year:Make[T.ferrari]:supertype[T.OTHER] | -7.933e-09 | 2.31e-08 | -0.343 | 0.732 | -5.33e-08 | 3.74e-08 | 
| year:Make[T.fiat]:supertype[T.OTHER] | -658.9303 | 420.144 | -1.568 | 0.117 | -1482.403 | 164.543 | 
| year:Make[T.ford]:supertype[T.OTHER] | -1653.0229 | 123.936 | -13.338 | 0.000 | -1895.935 | -1410.111 | 
| year:Make[T.gmc]:supertype[T.OTHER] | -1251.7739 | 387.077 | -3.234 | 0.001 | -2010.436 | -493.112 | 
| year:Make[T.harley-davidson]:supertype[T.OTHER] | -1158.0818 | 149.898 | -7.726 | 0.000 | -1451.879 | -864.285 | 
| year:Make[T.honda]:supertype[T.OTHER] | -1167.6860 | 130.348 | -8.958 | 0.000 | -1423.164 | -912.208 | 
| year:Make[T.hyundai]:supertype[T.OTHER] | -824.2526 | 160.897 | -5.123 | 0.000 | -1139.607 | -508.899 | 
| year:Make[T.infiniti]:supertype[T.OTHER] | -1281.1900 | 171.419 | -7.474 | 0.000 | -1617.167 | -945.213 | 
| year:Make[T.jaguar]:supertype[T.OTHER] | -339.7125 | 208.659 | -1.628 | 0.104 | -748.680 | 69.255 | 
| year:Make[T.jeep]:supertype[T.OTHER] | -2003.1237 | 150.611 | -13.300 | 0.000 | -2298.318 | -1707.930 | 
| year:Make[T.kia]:supertype[T.OTHER] | -1496.1656 | 162.135 | -9.228 | 0.000 | -1813.946 | -1178.386 | 
| year:Make[T.land rover]:supertype[T.OTHER] | 14.3842 | 2.803 | 5.132 | 0.000 | 8.891 | 19.878 | 
| year:Make[T.lexus]:supertype[T.OTHER] | -1228.8431 | 149.271 | -8.232 | 0.000 | -1521.411 | -936.275 | 
| year:Make[T.lincoln]:supertype[T.OTHER] | -1204.0215 | 151.641 | -7.940 | 0.000 | -1501.235 | -906.809 | 
| year:Make[T.mazda]:supertype[T.OTHER] | -1105.9856 | 147.208 | -7.513 | 0.000 | -1394.509 | -817.462 | 
| year:Make[T.mercedes-benz]:supertype[T.OTHER] | -845.6441 | 144.769 | -5.841 | 0.000 | -1129.387 | -561.901 | 
| year:Make[T.mercury]:supertype[T.OTHER] | -1997.3576 | 269.721 | -7.405 | 0.000 | -2526.004 | -1468.711 | 
| year:Make[T.mini]:supertype[T.OTHER] | -328.0869 | 202.363 | -1.621 | 0.105 | -724.714 | 68.540 | 
| year:Make[T.mitsubishi]:supertype[T.OTHER] | -1441.2284 | 167.303 | -8.614 | 0.000 | -1769.138 | -1113.318 | 
| year:Make[T.nissan]:supertype[T.OTHER] | -1429.2700 | 149.478 | -9.562 | 0.000 | -1722.243 | -1136.297 | 
| year:Make[T.pontiac]:supertype[T.OTHER] | -2808.6932 | 384.281 | -7.309 | 0.000 | -3561.874 | -2055.512 | 
| year:Make[T.porsche]:supertype[T.OTHER] | -2216.1228 | 277.911 | -7.974 | 0.000 | -2760.821 | -1671.425 | 
| year:Make[T.ram]:supertype[T.OTHER] | -1527.2526 | 473.302 | -3.227 | 0.001 | -2454.913 | -599.592 | 
| year:Make[T.rover]:supertype[T.OTHER] | 1856.9996 | 961.034 | 1.932 | 0.053 | -26.604 | 3740.603 | 
| year:Make[T.saturn]:supertype[T.OTHER] | 3531.3457 | 1303.125 | 2.710 | 0.007 | 977.251 | 6085.440 | 
| year:Make[T.subaru]:supertype[T.OTHER] | -1697.8327 | 175.971 | -9.648 | 0.000 | -2042.732 | -1352.933 | 
| year:Make[T.tesla]:supertype[T.OTHER] | -2767.8856 | 1142.210 | -2.423 | 0.015 | -5006.590 | -529.181 | 
| year:Make[T.toyota]:supertype[T.OTHER] | -631.5706 | 127.464 | -4.955 | 0.000 | -881.397 | -381.744 | 
| year:Make[T.volkswagen]:supertype[T.OTHER] | -2132.5797 | 136.714 | -15.599 | 0.000 | -2400.536 | -1864.624 | 
| year:Make[T.volvo]:supertype[T.OTHER] | -928.7753 | 224.635 | -4.135 | 0.000 | -1369.055 | -488.496 | 
| year:Make[T.alfa-romeo]:supertype[T.SUV] | 3760.0786 | 5179.338 | 0.726 | 0.468 | -6391.301 | 1.39e+04 | 
| year:Make[T.aston-martin]:supertype[T.SUV] | 2.218e-08 | 1.2e-08 | 1.846 | 0.065 | -1.37e-09 | 4.57e-08 | 
| year:Make[T.audi]:supertype[T.SUV] | -555.8073 | 74.974 | -7.413 | 0.000 | -702.755 | -408.860 | 
| year:Make[T.bmw]:supertype[T.SUV] | -324.6102 | 62.862 | -5.164 | 0.000 | -447.819 | -201.402 | 
| year:Make[T.buick]:supertype[T.SUV] | -34.9017 | 71.944 | -0.485 | 0.628 | -175.910 | 106.106 | 
| year:Make[T.cadillac]:supertype[T.SUV] | -561.8941 | 67.952 | -8.269 | 0.000 | -695.079 | -428.710 | 
| year:Make[T.chevrolet]:supertype[T.SUV] | -312.8690 | 53.185 | -5.883 | 0.000 | -417.111 | -208.627 | 
| year:Make[T.chrysler]:supertype[T.SUV] | -1095.6684 | 78.229 | -14.006 | 0.000 | -1248.995 | -942.342 | 
| year:Make[T.dodge]:supertype[T.SUV] | -1557.2141 | 63.858 | -24.385 | 0.000 | -1682.375 | -1432.053 | 
| year:Make[T.ferrari]:supertype[T.SUV] | 3.669e-09 | 8.77e-09 | 0.418 | 0.676 | -1.35e-08 | 2.09e-08 | 
| year:Make[T.fiat]:supertype[T.SUV] | -1038.3891 | 1471.700 | -0.706 | 0.480 | -3922.886 | 1846.108 | 
| year:Make[T.ford]:supertype[T.SUV] | -789.6760 | 52.731 | -14.976 | 0.000 | -893.027 | -686.325 | 
| year:Make[T.gmc]:supertype[T.SUV] | -571.4875 | 368.582 | -1.551 | 0.121 | -1293.899 | 150.924 | 
| year:Make[T.harley-davidson]:supertype[T.SUV] | 0.6817 | 5.030 | 0.136 | 0.892 | -9.177 | 10.540 | 
| year:Make[T.honda]:supertype[T.SUV] | -699.6164 | 55.097 | -12.698 | 0.000 | -807.605 | -591.628 | 
| year:Make[T.hyundai]:supertype[T.SUV] | -728.7913 | 67.430 | -10.808 | 0.000 | -860.953 | -596.629 | 
| year:Make[T.infiniti]:supertype[T.SUV] | -903.8682 | 75.146 | -12.028 | 0.000 | -1051.152 | -756.584 | 
| year:Make[T.jaguar]:supertype[T.SUV] | 170.4390 | 246.459 | 0.692 | 0.489 | -312.614 | 653.493 | 
| year:Make[T.jeep]:supertype[T.SUV] | -966.4543 | 96.982 | -9.965 | 0.000 | -1156.538 | -776.371 | 
| year:Make[T.kia]:supertype[T.SUV] | -1018.8876 | 73.334 | -13.894 | 0.000 | -1162.621 | -875.154 | 
| year:Make[T.land rover]:supertype[T.SUV] | 257.8353 | 311.964 | 0.826 | 0.409 | -353.607 | 869.278 | 
| year:Make[T.lexus]:supertype[T.SUV] | -1019.8415 | 61.595 | -16.557 | 0.000 | -1140.566 | -899.117 | 
| year:Make[T.lincoln]:supertype[T.SUV] | -366.2551 | 76.377 | -4.795 | 0.000 | -515.953 | -216.558 | 
| year:Make[T.mazda]:supertype[T.SUV] | -671.2240 | 79.108 | -8.485 | 0.000 | -826.274 | -516.174 | 
| year:Make[T.mercedes-benz]:supertype[T.SUV] | -525.6085 | 66.110 | -7.951 | 0.000 | -655.182 | -396.035 | 
| year:Make[T.mercury]:supertype[T.SUV] | -757.7926 | 188.059 | -4.030 | 0.000 | -1126.384 | -389.201 | 
| year:Make[T.mini]:supertype[T.SUV] | -663.8812 | 193.985 | -3.422 | 0.001 | -1044.086 | -283.676 | 
| year:Make[T.mitsubishi]:supertype[T.SUV] | -554.4769 | 78.767 | -7.039 | 0.000 | -708.859 | -400.095 | 
| year:Make[T.nissan]:supertype[T.SUV] | -819.1695 | 58.513 | -14.000 | 0.000 | -933.853 | -704.486 | 
| year:Make[T.pontiac]:supertype[T.SUV] | -262.5531 | 276.885 | -0.948 | 0.343 | -805.241 | 280.135 | 
| year:Make[T.porsche]:supertype[T.SUV] | 322.1691 | 130.999 | 2.459 | 0.014 | 65.414 | 578.925 | 
| year:Make[T.ram]:supertype[T.SUV] | -841.2743 | 519.704 | -1.619 | 0.106 | -1859.882 | 177.333 | 
| year:Make[T.rover]:supertype[T.SUV] | 3182.9021 | 946.348 | 3.363 | 0.001 | 1328.083 | 5037.721 | 
| year:Make[T.saturn]:supertype[T.SUV] | -1128.2914 | 293.522 | -3.844 | 0.000 | -1703.587 | -552.996 | 
| year:Make[T.subaru]:supertype[T.SUV] | -1195.8930 | 62.588 | -19.107 | 0.000 | -1318.565 | -1073.221 | 
| year:Make[T.tesla]:supertype[T.SUV] | -2497.7568 | 1126.592 | -2.217 | 0.027 | -4705.851 | -289.663 | 
| year:Make[T.toyota]:supertype[T.SUV] | -441.3871 | 52.849 | -8.352 | 0.000 | -544.969 | -337.805 | 
| year:Make[T.volkswagen]:supertype[T.SUV] | -488.1836 | 73.622 | -6.631 | 0.000 | -632.481 | -343.886 | 
| year:Make[T.volvo]:supertype[T.SUV] | -612.0689 | 75.788 | -8.076 | 0.000 | -760.612 | -463.525 | 
| Omnibus: | 48043.773 | Durbin-Watson: | 2.013 | 
|---|---|---|---|
| Prob(Omnibus): | 0.000 | Jarque-Bera (JB): | 171184.106 | 
| Skew: | 1.246 | Prob(JB): | 0.00 | 
| Kurtosis: | 6.919 | Cond. No. | 1.02e+16 | 
The F statistic of our first model seems much higher than the one of model 2, therefore our first model was better for testing. The F values can be determined through the following code.
print(model.fvalue)
print(model2.fvalue)
1642.8343429735507 1404.1296173401522
Now we will plot residuals of our models.
dfu['residual'] = model.resid
ax = sb.violinplot(x='year', y='residual', data=dfu)
ax.set_title("Residual of the Linear Model Over Year")
for ind, label in enumerate(ax.get_xticklabels()):
    if ind % 5 == 4:  # every 10th label is kept
        label.set_visible(True)
    else:
        label.set_visible(False)
From the residuals we can see that as the year increases, the residuals are closer to zero which is ideal, but the variance in the residuals is still very high suggesting that the model is not able to accurately represent the high variance in the data itself.
Next, we test our regression model with the remaining 10 percent of data.
predictions = model.predict(rest_part_10)
predictions
diff = predictions - rest_part_10['price']
plt.scatter(rest_part_10['price'], diff)
plt.xlabel('Actual Price')
plt.ylabel('Difference from Estimated')
Text(0, 0.5, 'Difference from Estimated')
On average, how far off we are on our estimates from the actual price is -11.4 with a standard deviation of 7571.3. The price mean is 19088.03 with a standard deviation of 13045.16. Considering these factors, most of our estimates are good since at least 68% of them are within 8,000 of the actual price which is less than 1 standard deviation of the price. These values can be calculated from the following code block.
print(diff.mean())
print(diff.std())
print(dfu['price'].mean())
print(dfu['price'].std())
-11.423551396919807 7571.297427781543 19088.847586472348 13045.07653305824
The biggest difference in our estimated versus the actual price was -60778.3. This corresponds to the 2005 dodge viper convertible which still hold a high value in comparisons to other cars in that make and year because its been discontinued and the only way to get one is by buying a used version. Its original MSRP was $81k according to cars.com. These statistics can be seen through the following code.
print(diff.min())
print(rest_part_10.loc[diff.idxmin()])
-60778.30637697792 price 62900 year 2005.0 Make dodge Model viper convertible condition like new fuel gas transmission manual type coupe state ga posting_date 2021-05-04 10:21:09-04:00 supertype CAR Name: 121563, dtype: object
We can also check how the prices of the same make and model car changes over later posting dates. First, we need to groupby the make, model, and year of a car and limit the rows to only rows that contain more than 1 posting date.
# Change in price compared to change in posting date
gp = dfu.groupby(['Make', 'Model', "year"])[['posting_date', 'price']].agg(list).reset_index()
test = gp.price.apply(lambda x: len(x) > 1)
gp = gp[test]
gp
| Make | Model | year | posting_date | price | |
|---|---|---|---|---|---|
| 2 | acura | 3.2 cl type s | 2003.0 | [2021-04-29 21:03:12-04:00, 2021-04-24 11:04:0... | [9999, 6000, 5950, 9999, 9999] | 
| 3 | acura | 3.2 tl | 2000.0 | [2021-05-04 09:40:31-07:00, 2021-04-23 13:14:3... | [3000, 2300] | 
| 5 | acura | 3.2 tl | 2003.0 | [2021-04-13 22:56:14-07:00, 2021-04-30 07:07:3... | [5500, 5995, 1299] | 
| 6 | acura | 3.2 tl | 2004.0 | [2021-05-03 15:22:49-06:00, 2021-04-30 10:02:1... | [2300, 4500] | 
| 7 | acura | 3.2 tl | 2005.0 | [2021-05-01 10:39:28-05:00, 2021-04-27 11:10:2... | [4500, 5000, 3200] | 
| ... | ... | ... | ... | ... | ... | 
| 45495 | volvo | xc90 t6 momentum sport | 2017.0 | [2021-05-03 14:11:31-07:00, 2021-05-03 14:51:2... | [36990, 36990, 36990, 36990, 36990] | 
| 45498 | volvo | xc90 t6 r design awd gas | 2016.0 | [2021-05-02 12:45:55-06:00, 2021-04-25 17:53:0... | [33999, 33999, 33999, 33999, 33999] | 
| 45499 | volvo | xc90 t8 hybrid inscription | 2019.0 | [2021-05-03 20:09:35-07:00, 2021-05-03 16:03:3... | [35000, 35000, 33000, 33000, 35000, 35000] | 
| 45501 | volvo | xc90 v8 | 2008.0 | [2021-04-27 16:57:56-07:00, 2021-04-17 17:54:4... | [8995, 5900] | 
| 45505 | volvo | xc90t6 awd 24733 miles | 2018.0 | [2021-04-29 10:01:20-07:00, 2021-04-23 13:17:5... | [42998, 42998, 42998, 42998, 42998, 42998, 429... | 
25049 rows × 5 columns
Then we can determine the change in price from the first posting date and last posting date over time by using the slope from those two points. We can generate a new column called slope to hold this value.
gp = gp.reset_index()
gp['slope'] = 0
for i in range(len(gp)):
    slope = 0
    last = len(gp['price'][i])-1
    maxd = max(gp['posting_date'][i]).date()
    indmax = gp['posting_date'][i].index(maxd)
    mind = min(gp['posting_date'][i]).date()
    indmin = gp['posting_date'][i].index(mind)
    diff = ((maxd - mind).days)
    if diff == 0:
        diff = .1
    slope = (gp['price'][i][indmax] - gp['price'][i][indmin]) / diff
    gp['slope'][i] = slope
gp.head()
| index | Make | Model | year | posting_date | price | slope | |
|---|---|---|---|---|---|---|---|
| 0 | 2 | acura | 3.2 cl type s | 2003.0 | [2021-04-29 21:03:12-04:00, 2021-04-24 11:04:0... | [9999, 6000, 5950, 9999, 9999] | 399 | 
| 1 | 3 | acura | 3.2 tl | 2000.0 | [2021-05-04 09:40:31-07:00, 2021-04-23 13:14:3... | [3000, 2300] | 63 | 
| 2 | 5 | acura | 3.2 tl | 2003.0 | [2021-04-13 22:56:14-07:00, 2021-04-30 07:07:3... | [5500, 5995, 1299] | 29 | 
| 3 | 6 | acura | 3.2 tl | 2004.0 | [2021-05-03 15:22:49-06:00, 2021-04-30 10:02:1... | [2300, 4500] | -733 | 
| 4 | 7 | acura | 3.2 tl | 2005.0 | [2021-05-01 10:39:28-05:00, 2021-04-27 11:10:2... | [4500, 5000, 3200] | 162 | 
First, we remove impossible/extremely unlikely slopes, such as slopes over 100 and below -100 since these slopes would indicate price changes more than the total price of the vehicle within one year. With the remaining results, the average price of a used car put on sale barely changes at all with a 0.0016 dollars per day increase till its latest posting which does not seem that bad at first, but the standard deviation of the slope is 35.92, essentially putting most cars to either gain or lose within 36 dollars per day on their used car with an incredibly small amount gain more than lose. The gains are most likely cars that can stand the test of time in terms of quality and some higher end cars that become classics or have good reviews and are sold for higher profits later. The losses are just cars that gradually lose value over time as the miles on the car increase and the ratings of the car are not stellar. These values can be accessed through the following code block.
gp = gp[gp['slope'] < 100]
gp = gp[gp['slope'] > -100]
print(gp['slope'].mean())
print(gp['slope'].std())
0.0016732901066722444 35.926843850236246
Overall, we found that the price and sales of vehicles are steadily going up, despite the major set back that was the COVID-19 pandemic. The car market is recovering and maybe the world will too.
With the new car data, we didn't have an effective model at predicting future sales because of the massive variation in sales. However, we found that the regression would worked well for finding average car sales and would likely work better for sales data in a longer time frame. We also saw the impact the pandemic had on all sales, as the residual data showed that April of 2020 significantly reduced the variance and average of all car sales.
Through used car data, we were able to determine important factors of a cars price, specifically make, year, and type of car contributing heavily to the price of the car. Specifically, the car type of SUV seems the hardest to predict with this dataset as it contains very high used car prices in later years compared to earlier years. With this analysis, one can determine what their current car could be valued on craigslist given its make, year, and type to determine whether it is worth it to consider selling their current used car for a new car.
The information about price of used cars that had multiple posting dates showed that on average the price does not change over the years for a car with the same make, model, and year. This is helpful for people on the fence about what time to put their used car up on sale because the analysis shows that on average, it does not affect the price and that you should check for reviews on its longevity and efficiency to determine if it will go up or down.
We hope that this tutorial taught you something about the data science pipeline. By looking at two unique sets of data, we wanted to demonstrate some of the variety in data science applications, and how some models may fail while others may succeed.