Git Product home page Git Product logo

mishkanian / mechacar_statistical_analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 493 KB

Statistical analysis of a product prototype using R and tidyverse. Multiple linear regressions, statistical summaries, and t-tests are used for analysis and predictions. A study is also designed to compare this product to the competition.

R 100.00%
r tidyverse multiple-linear-regression statistics t-tests statistical-summaries

mechacar_statistical_analysis's Introduction

Statistical Analysis of a Vehicle Prototype in R

Project Overview

The purpose of this project is to identify which variables can predict the MPG of a car prototype, "MechaCar", for the fictional company AutosRUs. Summary statistics are generated and t-tests are performed for individual manufacturing lots. Finally, a study is designed to compare MechaCar to the competition. R and tidyverse are used to accomplish this analysis.

Linear Regression to Predict MPG

mechacar_regress

After performing a multiple linear regression on the MechaCar_mpg.csv dataset, the following conclusions can be made:

  • Vehicle Length and Ground Clearance are statistically significant. These variables provide a non-random amount of variance to the MPG values in the dataset.
  • The high significance level of the intercept implies that might be other factors that are significant to MPG. Since all available variables in this dataset were already passed in this regression, it can be inferred that additional research and data are necessary to uncover any unknown significant variables.

Summary Statistics on Suspension Coils

total_summary

The design specifications of AutosRUs' prototype "MechaCar" dictates that the variance of the suspension coils must not exceed 100 pounds per square inch. Although the total variance in the summary dataframe above shows a variance of 62, which is acceptable, investigating the variance of individual manufacture lots has shown that Manufacturing Lot 3 does not meet the current design specifications.

Using the code below, the data in Suspension_Coil.csv is grouped by manufacturing lot:

# Creating a lot_summary dataframe grouped by manufacturing lots
lot_summary <- Suspension_Coil_table %>% group_by(Manufacturing_Lot) %>% 
summarize(Mean_PSI=mean(PSI), Median_PSI=median(PSI), Variance_PSI=var(PSI), 
STDEV_PSI=sd(PSI), .groups = 'keep')

After running this code, the following dataframe is generated:

manufacturing_lots

Based on the above lot_summary dataframe, it can be concluded that only Manufacturing Lot 3 does not meet the design specifications because the variance is far above 100.

T-Tests on Suspension Coils

In this section of the analysis, t-tests are used to determine if all manufacturing lots and each lot individually are statistically different from the population mean of 1,500 pounds per square inch. It is found that only Manufacturing Lot 3 is statistically different from the population mean.

T-Test Across All Manufacturing Lots

ttest_mecha

In the t-test above, it is found that the mean across all manufacturing lots is not statistically different from the population mean of 1,500 pounds per square inch.

Manufacturing Lot 1 T-Test

ttest_lot1

Manufacturing Lot 1 has a p-value of 1, which means that the mean of Manufacturing Lot 1 is identical to the population mean of 1,500. Therefore we fail to reject the null hypothesis, there is no statistical difference from the population mean.

Manufacturing Lot 2 T-Test

ttest_lot2

Manufacturing Lot 2 has a p-value of 0.61, therefore we fail to reject the null hypothesis. There is no statistical difference between Manufacturing Lot 2 and the population mean of 1,500.

Manufacturing Lot 3 T-Test

ttest_lot3

Manufacturing Lot 3 has a p-value of 0.04, therefore we reject the null hypothesis. This means Manufacturing Lot 3 is statistically different from from the population mean of 1,500 pounds per square inch.

Study Design: MechaCar vs Competition

To quantify how "MechaCar" may perform against the competition, a statistical study of metrics that maximize consumer utility can be performed. In Economics, utility represents how much usefulness or enjoyment a consumer can obtain from consumption of a good or service. In this project, the metrics that might affect the utility of a vehicle are:

  • Purchase Price
  • Fuel Efficiency (Highway and City)
  • Maintenance Cost
  • Safety Ratings
  • Horsepower
  • Storage Capacity

The null hypothesis and alternative hypothesis for this proposed study are as follows:
      Ho: MechaCar would have high consumer utility and would perform well against competitors.
      Ha: MechaCar would not have high consumer utility and would not perform well against competitors.

After gathering the necessary data for the metrics listed above, Multiple Linear Regressions would be used to identify the statistically significant variables that affect sales of similar vehicles. The performace of MechaCar in these important categories will be compared to the mean performace of competitors through the analysis of variance (ANOVA) test.

If it is found that MechaCar would have high consumer utility and would perform well when positioned against competing vehicles, it is recommended to manufacture MechaCar. Otherwise, if the null hypothesis is rejected, it is not recommend to manufacture MechaCar.

Author: Michael Mishkanian
For all questions and inquiries, please contact me on LinkedIn.

mechacar_statistical_analysis's People

Contributors

mishkanian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.