2026-03-23

Overview of Dataset

Prices of Sports Cars

This dataset takes a look at the prices of different sports cars from different manufacturers.

Data Source: Sports Car Prices Dataset

Columns:

  • Make: Car manufacturer
  • Model: Model of car
  • Year: Year car was made
  • Engine Size (L): Volume of cylinders in liters
  • Horsepower: Amount of power the car’s engine produces
  • Torque (lb-ft): Amount of rotational force generated by the engine
  • 0-60 MPH Time (Seconds): Time it takes for the car to go from 0 MPH to 60 MPH
  • Price (USD): Price of the car in US dollars

Data Preparation

Code for loading and preparing the data:

# load necessary libraries
library(plotly)
library(ggplot2)
library(dplyr)

# load dataset
sportsCarPrices = read.csv("Sport car price.csv")

# clean dataset
# convert some numeric columns from being read as strings
sportsCarPrices$Price = as.numeric(gsub(",", "", sportsCarPrices$Price..in.USD.))
sportsCarPrices$Horsepower = as.numeric(sportsCarPrices$Horsepower)
sportsCarPrices$Torque = as.numeric(sportsCarPrices$Torque..lb.ft.)
sportsCarPrices$EngineSize = as.numeric(sportsCarPrices$Engine.Size..L.)
sportsCarPrices$Time060 = as.numeric(sportsCarPrices$X0.60.MPH.Time..seconds.)

Descriptive Statistics (1/2)

##    Horsepower         Torque         EngineSize       Time060     
##  Min.   : 181.0   Min.   :   0.0   Min.   :0.000   Min.   :1.800  
##  1st Qu.: 454.0   1st Qu.: 406.0   1st Qu.:3.500   1st Qu.:2.900  
##  Median : 591.0   Median : 509.0   Median :4.000   Median :3.500  
##  Mean   : 627.3   Mean   : 542.2   Mean   :4.396   Mean   :3.515  
##  3rd Qu.: 671.0   3rd Qu.: 604.0   3rd Qu.:5.200   3rd Qu.:4.000  
##  Max.   :2000.0   Max.   :1732.0   Max.   :8.400   Max.   :6.500  
##  NA's   :9        NA's   :8        NA's   :59      NA's   :1
##      Price        
##  Min.   :  25000  
##  1st Qu.:  71800  
##  Median : 140000  
##  Mean   : 382036  
##  3rd Qu.: 250000  
##  Max.   :5200000

Descriptive Statistics (2/2)

Observations:

  • Average Price: $382,036
  • Average Horsepower: 627 hp
  • Fastest 0-60 Time: 1.8 seconds

Cars by Manufacturer (ggplot)

Price Distribution by Manufacturer (ggplot)

Horsepower vs Price (plotly)

Horsepower, Torque, and Price (plotly)

Statistical Analysis

model = lm(Price ~ Horsepower, data = sportsCarPrices)
coef(summary(model))
##                Estimate  Std. Error   t value      Pr(>|t|)
## (Intercept) -848294.636 32628.90240 -25.99826 3.731863e-114
## Horsepower     1959.473    46.92837  41.75454 4.764722e-221
cat("R-squared:", summary(model)$r.squared)
## R-squared: 0.6364222

This model demonstrates how horsepower is a significant predictor of price (p < 2.2e-16). For every additional unit of horsepower, price increases by approximately $1,959. The R² value of 0.6364 indicates that approximately 63.6% of the variation in price is explained by horsepower alone

Conclusions

  • The dataset contains 1,007 sport cars from 30 manufacturers, ranging from 1965 to 2023
  • Lamborghini, Ferrari, and Porsche are among the most represented manufacturers in the dataset
  • Horsepower is a strong predictor of price, explaining 63.6% of the variation in price (R² = 0.6364)
  • For every additional unit of horsepower, price increases by approximately $1,959
  • The average price of a sport car in this dataset is $382,036, with prices ranging from $25,000 to $5,200,000

References