Skip to content

CruelFury15/CaseStudy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Crashes and Smartphone Usage Analysis

A comprehensive data analysis project investigating the relationship between smartphone usage rates and traffic crash rates in the United States from 2006 to 2020.

🎯 Project Overview

This case study explores whether there's a correlation between the increasing adoption of smartphones and traffic crash rates, using statistical analysis and machine learning techniques.

📊 Dataset

The analysis uses two main datasets:

  • traffic.csv: Monthly traffic crash data (2006-2020)
    • Date, crashes per 100,000 people, season
  • crashes_smartphones.csv: Smartphone usage survey data (2011-2019)
    • Survey dates, smartphone usage percentages, corresponding crash rates

🔬 Analysis Methods

  1. Exploratory Data Analysis

    • Time series visualization of crash rates
    • Seasonal pattern analysis
    • Smartphone usage trends
  2. Statistical Analysis

    • Pearson correlation coefficient
    • Statistical significance testing (p-values)
    • Linear regression modeling
  3. Predictive Modeling

    • Linear regression to predict crash rates
    • Model validation against 2020 actual data
    • Visualization of predictions vs. reality

📈 Key Findings

  • Positive Correlation: Moderate positive relationship (r > 0.5) between smartphone usage and crash rates
  • Statistical Significance: p-value < 0.05, indicating non-random correlation
  • Seasonal Patterns: Winter and Fall show higher crash rates than Spring and Summer
  • Prediction Accuracy: Model provides reasonable estimates but with notable deviation from actual 2020 data

🛠️ Technical Stack

  • Python 3.8+
  • Pandas - Data manipulation and analysis
  • NumPy - Numerical operations
  • Matplotlib - Data visualization
  • Seaborn - Statistical plotting
  • Scikit-learn - Machine learning and regression
  • SciPy - Statistical analysis

📁 Project Structure

Case-Study/
├── CaseStudy1/
│   ├── notebook.ipynb          # Main analysis notebook
│   ├── traffic.csv              # Traffic crash data
│   └── crashes_smartphones.csv   # Smartphone usage data
├── CaseStudy2/
│   └── [additional analysis]
├── requirements.txt             # Python dependencies
├── README.md                   # This file
└── .gitignore                 # Git ignore file

🚀 Getting Started

  1. Clone the repository

    git clone <repository-url>
    cd Case-Study
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the analysis

    • Open CaseStudy1/notebook.ipynb in Jupyter Notebook or JupyterLab
    • Execute cells sequentially from top to bottom

📋 Requirements

See requirements.txt for detailed package versions. Key dependencies include:

  • pandas >= 1.3.0
  • numpy >= 1.21.0
  • matplotlib >= 3.4.0
  • seaborn >= 0.11.0
  • scikit-learn >= 1.0.0
  • scipy >= 1.7.0

🔍 Analysis Highlights

Correlation Analysis

  • Pearson's r coefficient calculated between smartphone usage and crash rates
  • Statistical significance testing to validate findings
  • Visual correlation through scatter plots with regression lines

Time Series Analysis

  • Monthly crash rate trends over 15-year period
  • Identification of seasonal patterns and anomalies
  • Comparison of pre- and post-smartphone era patterns

Predictive Modeling

  • Linear regression model: Crashes_per_100k = 120.6637 + (0.6610 * Smartphone_usage)
  • 2020 prediction vs. actual comparison
  • Model performance evaluation

📝️ Notes

  • Correlation vs. Causation: While statistical significance is found, correlation does not imply causation
  • External Factors: Many variables contribute to traffic crashes beyond smartphone usage

About

A comprehensive data science portfolio featuring two real-world analysis projects demonstrating statistical modeling and machine learning techniques.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors