Car Makes and reliability: Source - Google search.
Project Introduction
I intend to use the following data set for my analysis:
Data set: Vehicle Reliability Scorecard
6,163 vehicles
One row per vehicle (year + make + model) with its ProblemsByVin reliability score, total NHTSA complaints, recalls, and defect investigations, plus the single component owners complain about most.
I intend to study the data for any patterns in reliability score and what factors may contribute to vehicle reliability score and which makes and models score well.
Load the libraries:
library(highcharter)
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Rows: 6163 Columns: 13
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): make, model, top_component, worst_severity, url
dbl (8): year, reliability_score, complaints, recalls, investigations, top_c...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(vehicles)
# A tibble: 6 × 13
year make model reliability_score complaints recalls investigations
<dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 2010 Ford Fusion 1 5130 13 0
2 2012 Ford Focus 2.2 3803 8 0
3 2007 Toyota Camry 1.9 3616 10 0
4 2011 Hyundai Sonata 1.7 3380 14 0
5 2010 Toyota Prius 2.2 2823 10 0
6 2013 Ford F-150 2.8 2796 3 0
# ℹ 6 more variables: top_component <chr>, top_component_complaints <dbl>,
# worst_severity <chr>, alleged_deaths <dbl>, alleged_fires <dbl>, url <chr>
Find the overall average reliability score for all the models and find the top-5 models with best reliability
Interactive plot showing score changes over the years for the top 5 models
cols <-brewer.pal(5, "Set1")highchart() |>hc_title(text ="Reliablity trend over time") |>hc_subtitle(text ="Only the top 5 are considered") |>hc_add_series(data = top5_avg_score,type ="line", hcaes(x = year,y = avg_reliability, group = make)) |>hc_colors(cols) |>hc_xAxis(title =list(text="Year")) |>hc_yAxis(title =list(text="Average Reliability Score")) |>hc_plotOptions(series =list(marker =list(symbol ="circle"))) |>hc_legend(align ="right", verticalAlign ="top")
Conclusion from the above visual:
Over the long period of time, even though there sre ups and downs in each of the top models, the general trend is slight improvement over time.
Multiple linear regression:
I want to do multiple linear regression model with reliability_score as the dependent variable and complaints and recallsas predictors. These variables were selected because they directly represent vehicle defect-related measures expected to influence reliability
Diagnostic Plot for recalls vs reliability_score correlation
Correlation plots were done above to examine the strength and direction of relationships between predictors and reliability score.
The above variables show enough evidence to use them for linear regression.
Linear regression Model:
veh_model <-lm( reliability_score ~ complaints + recalls, data = vehicles)summary(veh_model)
Call:
lm(formula = reliability_score ~ complaints + recalls, data = vehicles)
Residuals:
Min 1Q Median 3Q Max
-1.7584 -0.3293 -0.0561 0.3262 3.3004
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.439e+00 8.246e-03 538.34 <2e-16 ***
complaints -9.810e-04 2.069e-05 -47.41 <2e-16 ***
recalls -1.313e-01 1.691e-03 -77.67 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4702 on 6160 degrees of freedom
Multiple R-squared: 0.6616, Adjusted R-squared: 0.6615
F-statistic: 6022 on 2 and 6160 DF, p-value: < 2.2e-16
Conclusion:
Adjusted R-squared: 0.6615
p-value: < 2.2e-16
Equation: y = -9.810e-04(complaints) - 1.313e-01(recalls) + 4.439
This multiple linear model has statistically significant p-values for each of the variables, which suggests both variables (complaints and recalls) are meaningful to explain the reliability score. The adjusted R-Squared value states that about 66% of the variation in the observations can be explained by the model, 34% of the variation is not explained by the model.
So, complaints and recalls can explain about 66% of the variation in reliability_score.
Summary:
This project analyzed a vehicle reliability dataset containing 6,163 vehicle records across multiple manufacturers and model years. The analysis identified the most reliable vehicle makes by calculating average reliability scores and examining trends over time for the top-performing brands, including Lexus, Volvo, MINI, Smart, and Porsche. Reliability trends generally showed slight improvement over the years despite some fluctuations. A multiple linear regression model was developed using complaints and recalls as predictors of vehicle reliability. The model explained approximately 66% of the variation in reliability scores, indicating that complaints and recalls are strong indicators of vehicle reliability.