Abstarct

McLaren vs. Ferrari

The McLaren vs. Ferrari rivalry in motorsports has generated unforgettable races in F1 history, marked by innovative engineering and fierce competition for victory. This rivalry has captivated global motorsport fans with dramatic on-track battles and controversial technical advancements. Beyond racing, McLaren and Ferrari have fiercely competed in automotive engineering, producing cutting-edge supercars and hypercars. Overall, this rivalry symbolizes a pivotal aspect of motorsport history, characterized by intense competition, technological progress, and a pursuit of excellence both on and off the track.

Introduction

The rivalry between McLaren and Ferrari extends from the racetrack to the world of automotive engineering, where both brands fiercely compete to create high-performance supercars and hypercars that redefine speed, technology, and design. McLaren Automotive, born from the esteemed McLaren Racing team in 2010, is renowned for its technologically advanced and exhilarating sports cars, blending cutting-edge technology with luxury. Ferrari, an iconic symbol of automotive excellence since 1947, is synonymous with speed, passion, and Italian craftsmanship, consistently producing breathtaking supercars and hypercars. This rivalry mirrors their competition on the track, with each brand striving to outdo the other in engineering and design. From track-focused supercars to luxurious grand tourers, McLaren and Ferrari set the standard for automotive performance and style, captivating enthusiasts worldwide.

Packages

The following R libraries are required to run the code used in this project.

# Loading the different libraries necessary for the project
library(tidyverse)
library(qqplotr)
library(rstatix)
library(ggplot2)
library(dplyr)
library(DT)
library(ggpubr)
library(kableExtra)

Data Management

Data Import

The Data was downloaded from here. The cars.csv data was imported and no missing values were found. The data consists of 1007 observations with car make, model, year, engine size in liters(l), horsepower, torque in lb/ft, 0-60 time and price all cars. But for the analysis, Torque of only Mclaren and Ferrari cars is required.

Interactive Datatable

Variables and Descriptive Statistics

There are 8 variables in the data set of which only one variable is the area of key interest to determine if the power produced by a Ferrari and a Lamborghini is equal.

Enigne size

Below you can see the descriptive statistics of Engine size.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   0.000   3.500   4.000   4.396   5.200   8.400      59

Torque

Below you can see the descriptive statistics of torque.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     0.0   406.0   509.0   542.2   604.0  1732.0       8

Horsepower

Below you can see the descriptive statistics of Horsepower.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   181.0   454.0   591.0   627.3   671.0  2000.0       9

0-60 Times in seconds

Below you can see the descriptive statistics of 0-60 times.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.800   2.900   3.500   3.515   4.000   6.500       1

Analysis of Torque

Filtering data

The dataset contains information of cars from various companies but for the analysis, Torque of only Mclaren and Ferrari is required.

Hypothesis test of Torque data

In this hypothesis test, the means of torque data for all McLaren and Ferrari vehicles are calculated and compared using a t-test. The null hypothesis assumes that the means of torque for both manufacturers are equal, while the alternative hypothesis suggests they are unequal. A confidence level of 95% is chosen, corresponding to an alpha value of 0.05.

\[ H_0: \mu_1 = \mu_2 \]

\[ H_A: \mu_1 \ne \mu_2 \]
Car_Make variable statistic p
Ferrari Torque 0.5506566 0
McLaren Torque 0.6484489 0

The Shapiro-Wilk test results indicate a lack of evidence supporting the normality assumption for the data. Consequently, it is not appropriate to conduct a hypothesis test using this data. Instead, we should opt for the Wilcoxon rank sum test or Mann-Whitney test, which are suitable for comparing non-normally distributed data. These tests offer robust alternatives for analyzing data that do not conform to normality assumptions.

Wilcoxon test

The Wilcoxon test, being non-parametric, doesn’t make any assumptions about the underlying distribution of the data, in contrast to the t-test, which relies on the assumption of normality. This characteristic renders the Wilcoxon test more resilient to outliers and skewed data, enhancing its suitability for analyzing datasets with non-normal distributions.
Based on the graphs depicted below, there is a lack of indication supporting normality, as the data does not conform to the expected pattern along the normal line. Consequently, it is recommended to conduct the Wilcoxon test instead of the t-test.

The p-value (2.17e-13) is less than any reasonable alpha level, therefore we have to reject the null hypothesis. There is sufficient evidence to suggest that average torque of a Ferrari is different than that of a McLaren.

Summary

From the Wilcoxon test, we reject the null hypothesis, indicating that there is evidence to suggest that the average torque produced by a Ferrari differs from that of a McLaren. While we cannot conclusively determine equality between the two averages, it is evident that they are not similar. Tests conducted using samples from very large populations may not yield precise results, highlighting the need for caution in interpretation. Adjusting the confidence level of the test may enhance its accuracy, and employing a larger sample size could provide a more robust representation of the data. Further research and analysis are warranted to refine the accuracy and reliability of the findings.

Personal Information

I am Manishankar Madagoni, a graduate student pursuing masters in Industrial Engineering.My hometown is Hyderabad, India. My passion for cars and racing-inspired me to choose this subject for my project. I enjoy playing volleyball and cricket with my friends. Chicken Fried Rice is one of my favorite dishes.

Appendix

# Loading the different libraries necessary for the project
library(tidyverse)
library(qqplotr)
library(rstatix)
library(ggplot2)
library(dplyr)
library(DT)
library(ggpubr)
library(kableExtra)

#importing the data from files
# Import the data and renaming data
col_names <- c("Car_Make", "Model", "Year", "Engine_Size_in_l", "Horsepower", 
               "Torque", "X0_X60times", "Price_in_USD")

cars <- read.csv("cars.csv", header = TRUE)%>%
  set_names(col_names)

#converting character dataframe to numeric data frame
cars$Horsepower=as.numeric(as.character(cars$Horsepower))
#converting character dataframe to numeric data frame
cars$Engine_Size_in_l=as.numeric(as.character(cars$Engine_Size_in_l))
#converting character dataframe to numeric data frame
cars$X0_X60times=as.numeric(as.character(cars$X0_X60times))
#converting character dataframe to numeric data frame
cars$Torque=as.numeric(as.character(cars$Torque))
cars



# Interactive data table for the data imported
datatable(cars, options = list(pageLength = 10),filter = 'top')

# Create the histogram, summary for Engine Size
hist(cars$Engine_Size_in_l, main= "Engine size in liters", xlab = "Engine size", col = "Blue")
summary(cars$Engine_Size_in_l)

# Create the histogram, summary for torque
hist(cars$Torque, main= "Torque in lb/ft", xlab = "Torque", col = "Orange")
summary(cars$Torque)

# Create the histogram,summary for Horsepower
hist(cars$Horsepower, main= "Horsepower", xlab = "Horsepower", col = "Red")
summary(cars$Horsepower)

# Create the histogram,summary for 0-60 times
hist(cars$X0_X60times, main= "0-60 times in seconds", xlab = "0-60 times in secs", col = "deepskyblue3")
summary(cars$X0_X60times)
#filtering all McLaren and Ferrari Torque data
cars1<-cars%>%
  select(Car_Make,Torque)%>%
  filter(Car_Make == "McLaren"| Car_Make=="Ferrari")%>%
  group_by(Car_Make)
cars1
# Shapiro Wilk Test by groups
st1 <- cars1 %>% 
  group_by(Car_Make)%>%
  shapiro_test(Torque)

knitr:: kable(st1, align="c", format = "html") %>%
  kableExtra::kable_styling(full_width = FALSE)
# Creating table of Summary Statistics
cars1 %>%
  group_by(Car_Make) %>%
  get_summary_stats(Torque, type = "median_iqr")
# qqplot by group using ggqqplot function from ggpubr package
ggqqplot(cars1, x="Torque", facet.by = "Car_Make")
#histograms and to visualize similar shape
ggboxplot(cars1, x = "Car_Make", y = "Torque", 
  ylab = "Torque", xlab = "Manufacturer", add = "jitter")
# Analysis for Wilcox Test
cars1 <- ungroup(cars1)
cars1 <- cars1 %>% mutate(CarMake = Car_Make)
ex1 <- cars1 %>% wilcox_test(Torque ~ CarMake) %>%
  add_significance()
ex1