A comprehensive data analysis project investigating the relationship between smartphone usage rates and traffic crash rates in the United States from 2006 to 2020.
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.
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
-
Exploratory Data Analysis
- Time series visualization of crash rates
- Seasonal pattern analysis
- Smartphone usage trends
-
Statistical Analysis
- Pearson correlation coefficient
- Statistical significance testing (p-values)
- Linear regression modeling
-
Predictive Modeling
- Linear regression to predict crash rates
- Model validation against 2020 actual data
- Visualization of predictions vs. reality
- 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
- 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
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
-
Clone the repository
git clone <repository-url> cd Case-Study
-
Install dependencies
pip install -r requirements.txt
-
Run the analysis
- Open
CaseStudy1/notebook.ipynbin Jupyter Notebook or JupyterLab - Execute cells sequentially from top to bottom
- Open
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
- 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
- Monthly crash rate trends over 15-year period
- Identification of seasonal patterns and anomalies
- Comparison of pre- and post-smartphone era patterns
- Linear regression model:
Crashes_per_100k = 120.6637 + (0.6610 * Smartphone_usage) - 2020 prediction vs. actual comparison
- Model performance evaluation
- Correlation vs. Causation: While statistical significance is found, correlation does not imply causation
- External Factors: Many variables contribute to traffic crashes beyond smartphone usage