Analyzing Traffic-safety trends using python
About : This case study takes you through an analysis of car collision rates and smartphone usage over time. source: Codecademy
I Worked on 2 Datasets:
2.[](the Pew Research Center’s website. )
- Visualizing traffic safety data :
from the plot : we can see , the decreasing trend in crash rates from 2006 continuing until 2010 or 2011, and then crash rates begin increasing. The data for 2020 is very different from the preceding years.
- Visualizing seasonal rates :
from the plot : Winter and Fall appear to have generally higher crash rates than Spring and Summer.
- Visualizing smartphone use data :
^^ We can see a trend of smartphone usage increasing over time.
- Visualize crash rate by smartphone use :
^^ There appears to be a positive linear relationship between the rate of car crashes and the rate of adult smartphone usage in the U.S.
-
Visualizing the prediction : plotting the regression plot again, but let's add two new points on top:
The predicted 2020 crash rate The actual 2020 crash rate
^^ By adding another layer to the regression plot, we can see the difference between the predicted and real crash rates in February 2020. This allows us to see how these values compare to the rest of the dataset.