Skip to content

Repository files navigation

mtcars-data-analysis

An R project for exploring and analyzing the mtcars dataset

Data Visualization and Analysis of the Mtcars Dataset

Introduction

This repository contains a comprehensive data analysis and visualization project based on the mtcars dataset in R. The project explores the relationships between various car attributes, performs statistical analyses, and builds predictive models to understand factors affecting fuel efficiency.

Features:

  • Data Preprocessing: Cleaning the dataset by handling outliers and converting categorical variables.
  • Feature Engineering: Creating new features like hp_per_wt (horsepower per weight).
  • Visualization:
    • Histograms, scatter plots, box plots, and density plots.
    • Correlation heatmap and 3D scatter plot.
    • Pair plots and advanced visualizations using ggplot2.
  • Statistical Analysis:
    • Correlation analysis, t-tests, and ANOVA.
  • Machine Learning:
    • Linear regression, decision tree, and random forest models to predict mpg.
  • Interactive Dashboard:
    • A Shiny app for dynamic exploration of the dataset.
  • Multivariate Analysis:
    • Principal Component Analysis (PCA) to understand data variance.

How to Use:

  1. Install R and RStudio from CRAN and RStudio.
  2. Install Required Packages by running install.packages(c("ggplot2", "corrplot", "plotly", "scatterplot3d", "shiny", "rpart", "randomForest", "factoextra")).
  3. Run the R Script to execute data cleaning, visualization, statistical analysis, and model building.

Shiny App:

  • Launches an interactive dashboard to explore the mtcars dataset.

Insights:

  • Examined the distribution of mpg and its correlation with other attributes.
  • Conducted statistical tests and built models to predict fuel efficiency.
  • Provided visual and analytical insights into the factors affecting car performance.

Example Visualizations:

  • [Scatterplot of MPG vs Weight]

Rplot2

  • [Histogram of MPG]

Rplot1

For more details, explore the code


Keywords: R, Data Analysis, Data Visualization, Machine Learning, Shiny, mtcars, PCA, Regression Analysis, Statistical Analysis

Feel free to open issues or contribute to the project!


Project Link: https://github.com/MR-1124/mtcars-data-analysis

About

An R project for exploring and analyzing the mtcars dataset

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages