Do Airbags Really Save Lives?

Introduction

Airbag Dataset

Retrieved the CSV file from ==> Datasets <== website to begin data analysis
##   X dvcat  weight  dead airbag seatbelt frontal sex ageOFocc yearacc
## 1 1 25-39  25.069 alive   none   belted       1   f       26    1997
## 2 2 10-24  25.069 alive airbag   belted       1   f       72    1997
## 3 3 10-24  32.379 alive   none     none       1   f       69    1997
## 4 4 25-39 495.444 alive airbag   belted       1   f       53    1997
## 5 5 25-39  25.069 alive   none   belted       1   f       32    1997
## 6 6 40-54  25.069 alive   none   belted       1   f       22    1997
##   yearVeh   abcat occRole deploy injSeverity caseid
## 1    1990 unavail  driver      0           3  2:3:1
## 2    1995  deploy  driver      1           1  2:3:2
## 3    1988 unavail  driver      0           4  2:5:1
## 4    1995  deploy  driver      1           1 2:10:1
## 5    1988 unavail  driver      0           3 2:11:1
## 6    1985 unavail  driver      0           3 2:11:2
##           X dvcat   weight  dead airbag seatbelt frontal sex ageOFocc
## 26212 26212 25-39  261.217 alive airbag   belted       0   f       45
## 26213 26213 25-39 3179.688 alive   none   belted       1   m       17
## 26214 26214 10-24   71.228 alive airbag   belted       1   m       54
## 26215 26215 10-24   10.474 alive airbag   belted       1   f       27
## 26216 26216 25-39   10.474 alive airbag   belted       1   f       18
## 26217 26217 25-39   10.474 alive airbag   belted       1   m       17
##       yearacc yearVeh    abcat occRole deploy injSeverity   caseid
## 26212    2002    1997 nodeploy  driver      0           2 82:106:2
## 26213    2002    1985  unavail  driver      0           0 82:107:1
## 26214    2002    2002 nodeploy  driver      0           2 82:108:2
## 26215    2002    1990   deploy  driver      1           3 82:110:1
## 26216    2002    1999   deploy  driver      1           0 82:110:2
## 26217    2002    1999   deploy    pass      1           0 82:110:2

Summary: Exploration

Below is a general summary of the Accidents dataset showing the mean, medians, quartiles for each numeric columns.

##     dvcat               weight             dead          
##  Length:26217       Min.   :    0.00   Length:26217      
##  Class :character   1st Qu.:   32.47   Class :character  
##  Mode  :character   Median :   86.99   Mode  :character  
##                     Mean   :  462.81                     
##                     3rd Qu.:  364.72                     
##                     Max.   :57871.59                     
##     airbag            seatbelt            frontal           sex           
##  Length:26217       Length:26217       Min.   :0.0000   Length:26217      
##  Class :character   Class :character   1st Qu.:0.0000   Class :character  
##  Mode  :character   Mode  :character   Median :1.0000   Mode  :character  
##                                        Mean   :0.6433                     
##                                        3rd Qu.:1.0000                     
##                                        Max.   :1.0000                     
##     ageOFocc        yearacc        yearVeh        abcat          
##  Min.   :16.00   Min.   :1997   Min.   :   0   Length:26217      
##  1st Qu.:22.00   1st Qu.:1998   1st Qu.:1989   Class :character  
##  Median :33.00   Median :2000   Median :1994   Mode  :character  
##  Mean   :37.21   Mean   :2000   Mean   :1993                     
##  3rd Qu.:48.00   3rd Qu.:2001   3rd Qu.:1997                     
##  Max.   :97.00   Max.   :2002   Max.   :2003                     
##    occRole              deploy       injSeverity       caseid         
##  Length:26217       Min.   :0.000   Min.   :0.000   Length:26217      
##  Class :character   1st Qu.:0.000   1st Qu.:0.000   Class :character  
##  Mode  :character   Median :0.000   Median :2.000   Mode  :character  
##                     Mean   :0.337   Mean   :1.705                     
##                     3rd Qu.:1.000   3rd Qu.:3.000                     
##                     Max.   :1.000   Max.   :6.000

Based on the summary, most accidents happened head on with occupants in their late 30’s. Most of these accidents happened in the year 2000.
The severity of the injuries can be based on many factors such as:

  • How fast the car was moving
  • Whether or not the airbags deployed or were unavailable.
  • If the occupants had on a seatbelt.

Totals for each factor in each columns

## alive  dead 
## 25037  1180
## airbag   none 
##  14419  11798
## belted   none 
##  18573   7644
##     f     m 
## 12248 13969
## driver   pass 
##  20601   5616



##   deploy nodeploy  unavail 
##     8836     5583    11798

Majority of the time, airbags were unavailable. As mentioned before, the average model of cars were made from 1993 and airbags were not mandated until 1998.


Men were more likely to be involved in accidents than the women. The men were usually younger (early to mid 30s). Histogram is positively skewed since the tail is on the right.



Below is a scatterplot showing age against weight/ sample weights. Both variables are being compared against each other to represent an observation.

Shows that there is no correlation between these two variables


####Cars crashes with no airbags were common in 1999 while in year 2000 those with airbags got in accidents.

Fatality Outcomes based on other attributes

Compariing outcome of injuries based on airbag functionality, seatbealt and speed. This report clearly shows how important it is to wear a seatbelt along with seatbelt.

## , , airbag = airbag, seatbelt = belted, dvcat = 1-9km/h
## 
##    dead
## sex alive dead
##   f   176    0
##   m   151    0
## 
## , , airbag = none, seatbelt = belted, dvcat = 1-9km/h
## 
##    dead
## sex alive dead
##   f    80    0
##   m    54    0
## 
## , , airbag = airbag, seatbelt = none, dvcat = 1-9km/h
## 
##    dead
## sex alive dead
##   f    44    0
##   m    25   12
## 
## , , airbag = none, seatbelt = none, dvcat = 1-9km/h
## 
##    dead
## sex alive dead
##   f    16    0
##   m    37    0
## 
## , , airbag = airbag, seatbelt = belted, dvcat = 10-24
## 
##    dead
## sex alive dead
##   f  4450   26
##   m  2982   45
## 
## , , airbag = none, seatbelt = belted, dvcat = 10-24
## 
##    dead
## sex alive dead
##   f  2210   48
##   m  1668   15
## 
## , , airbag = airbag, seatbelt = none, dvcat = 10-24
## 
##    dead
## sex alive dead
##   f  1127   48
##   m  1159  122
## 
## , , airbag = none, seatbelt = none, dvcat = 10-24
## 
##    dead
## sex alive dead
##   f   976   23
##   m  1336  109
## 
## , , airbag = airbag, seatbelt = belted, dvcat = 25-39
## 
##    dead
## sex alive dead
##   f  2950  142
##   m  2168   89
## 
## , , airbag = none, seatbelt = belted, dvcat = 25-39
## 
##    dead
## sex alive dead
##   f  2080  152
##   m  1941  136
## 
## , , airbag = airbag, seatbelt = none, dvcat = 25-39
## 
##    dead
## sex alive dead
##   f   945   66
##   m  1274  201
## 
## , , airbag = none, seatbelt = none, dvcat = 25-39
## 
##    dead
## sex alive dead
##   f  1204  136
##   m  2108  254
## 
## , , airbag = airbag, seatbelt = belted, dvcat = 40-54
## 
##    dead
## sex alive dead
##   f   924  147
##   m   875  149
## 
## , , airbag = none, seatbelt = belted, dvcat = 40-54
## 
##    dead
## sex alive dead
##   f   755  162
##   m   865  164
## 
## , , airbag = airbag, seatbelt = none, dvcat = 40-54
## 
##    dead
## sex alive dead
##   f   339  125
##   m   573  156
## 
## , , airbag = none, seatbelt = none, dvcat = 40-54
## 
##    dead
## sex alive dead
##   f   514  138
##   m  1248  313
## 
## , , airbag = airbag, seatbelt = belted, dvcat = 55+
## 
##    dead
## sex alive dead
##   f   299  151
##   m   386  159
## 
## , , airbag = none, seatbelt = belted, dvcat = 55+
## 
##    dead
## sex alive dead
##   f   310  143
##   m   474  218
## 
## , , airbag = airbag, seatbelt = none, dvcat = 55+
## 
##    dead
## sex alive dead
##   f   136  122
##   m   302  232
## 
## , , airbag = none, seatbelt = none, dvcat = 55+
## 
##    dead
## sex alive dead
##   f   245  188
##   m   690  426

Age vs Injury

##   injSeverity ageOFocc
## 1           0 35.05323
## 2           1 37.27364
## 3           2 36.00919
## 4           3 38.49429
## 5           4 43.83989
## 6           5 41.48872
## 7           6 62.50000

As seen in this findings above, occupants nearing age 40+ tend to be classed in fatal or serious injuries than the younger population.

Data Wrangling: Changing Attributes

A subset of the Airbag dataset was created and name of columns were changed. This is a view of accidents that happened after 1998 and where the occupants survived. Here are the differences:

  • More airbags deployed since the median and average is 1 compared to the previous summary where they were both 0. This showed that accident control measure were improving.
  • The popular age group is still in the 30’s
  • The severity of most injuries stayed within the #2 range (mild injuries).


##      Item# Impact Speed  Weight Dead/Alive Airbag Seatbelt Frontal Impact
## 8413  8413        10-24 131.322      alive airbag   belted              1
## 8424  8424        10-24 891.942      alive airbag   belted              1
## 8426  8426        10-24  57.246      alive airbag     none              1
## 8428  8428        10-24 173.877      alive airbag   belted              1
## 8431  8431        10-24  27.003      alive airbag   belted              1
##      Gender Age Accident Year Model Year Airbag Status   Role Deploy
## 8413   Male  31          1999       1996        deploy driver      1
## 8424 Female  32          1999       1991        deploy driver      1
## 8426 Female  21          1999       1993        deploy driver      1
## 8428 Female  53          1999       1995        deploy driver      1
## 8431   Male  36          1999       1998        deploy driver      1
##      Injury Range Case ID
## 8413            1  2:13:1
## 8424            1  2:24:1
## 8426            3  2:28:1
## 8428            1  2:29:1
## 8431            1  2:31:2
##      Item#       Impact Speed           Weight          Dead/Alive       
##  Min.   : 8413   Length:6262        Min.   :    0.00   Length:6262       
##  1st Qu.:13660   Class :character   1st Qu.:   29.68   Class :character  
##  Median :18240   Mode  :character   Median :   81.41   Mode  :character  
##  Mean   :17859                      Mean   :  349.04                     
##  3rd Qu.:22274                      3rd Qu.:  291.12                     
##  Max.   :26217                      Max.   :29533.13                     
##     Airbag            Seatbelt         Frontal Impact     Gender         
##  Length:6262        Length:6262        Min.   :0.000   Length:6262       
##  Class :character   Class :character   1st Qu.:1.000   Class :character  
##  Mode  :character   Mode  :character   Median :1.000   Mode  :character  
##                                        Mean   :0.816                     
##                                        3rd Qu.:1.000                     
##                                        Max.   :1.000                     
##       Age        Accident Year    Model Year   Airbag Status     
##  Min.   :16.00   Min.   :1999   Min.   :1988   Length:6262       
##  1st Qu.:22.00   1st Qu.:2000   1st Qu.:1995   Class :character  
##  Median :32.00   Median :2001   Median :1997   Mode  :character  
##  Mean   :36.99   Mean   :2001   Mean   :1997                     
##  3rd Qu.:47.00   3rd Qu.:2002   3rd Qu.:1999                     
##  Max.   :97.00   Max.   :2002   Max.   :2003                     
##      Role               Deploy   Injury Range     Case ID         
##  Length:6262        Min.   :1   Min.   :0.000   Length:6262       
##  Class :character   1st Qu.:1   1st Qu.:1.000   Class :character  
##  Mode  :character   Median :1   Median :2.000   Mode  :character  
##                     Mean   :1   Mean   :1.719                     
##                     3rd Qu.:1   3rd Qu.:3.000                     
##                     Max.   :1   Max.   :6.000

Conclusion

These are some of the factors that needed to be considered in those times. However, with the way technology is progressing, airbags are now manufactured to be deployed with less force and be smart due to the sensors created to detect rapid deceleration of the vehicle, inflating almost instantly to cushion the human body. Furthermore, with the help of occupants wearing seatbelts while in their automobile, this can significantly reduce any chance of injuries susceptible to loss of life.

Bonus

Read file from Github

##     X dvcat  weight  dead airbag seatbelt frontal sex ageOFocc yearacc
## 1   1 25-39  25.069 alive   none   belted       1   f       26    1997
## 2   2 10-24  25.069 alive airbag   belted       1   f       72    1997
## 3   3 10-24  32.379 alive   none     none       1   f       69    1997
## 4   4 25-39 495.444 alive airbag   belted       1   f       53    1997
## 5   5 25-39  25.069 alive   none   belted       1   f       32    1997
## 6   6 40-54  25.069 alive   none   belted       1   f       22    1997
## 7   7   55+  27.078 alive   none   belted       1   m       22    1997
## 8   8   55+  27.078  dead   none     none       1   m       32    1997
## 9   9 10-24 812.869 alive   none   belted       0   m       40    1997
## 10 10 10-24 812.869 alive   none   belted       1   f       18    1997
##    yearVeh   abcat occRole deploy injSeverity caseid
## 1     1990 unavail  driver      0           3  2:3:1
## 2     1995  deploy  driver      1           1  2:3:2
## 3     1988 unavail  driver      0           4  2:5:1
## 4     1995  deploy  driver      1           1 2:10:1
## 5     1988 unavail  driver      0           3 2:11:1
## 6     1985 unavail  driver      0           3 2:11:2
## 7     1984 unavail  driver      0           3 2:13:1
## 8     1987 unavail  driver      0           4 2:13:2
## 9     1984 unavail  driver      0           1 2:14:1
## 10    1987 unavail  driver      0           0 2:14:2