Preliminary Code
carcrash <- CarCrashBase |>
filter(`Driver Substance Abuse` %in% c("Not Suspect of Alcohol Use, Not Suspect of Drug Use", "Suspect of Alcohol Use, Not Suspect of Drug Use", "Suspect of Alcohol Use, Unknown", "Not Suspect of Alcohol Use, Suspect of Drug Use", "Unknown, Not Suspect of Drug Use", "Suspect of Alcohol Use, Suspect of Drug Use")) |>
separate(`Driver Substance Abuse`, into = c("alcohol", "drugs"), sep = ", ") |>
mutate(injury = fct_collapse(`Injury Severity`,
no_apparent = c("No Apparent Injury", "NO APPARENT INJURY"),
possible = c("Possible Injury", "POSSIBLE INJURY"),
minor = c("Suspected Minor Injury", "SUSPECTED MINOR INJURY"),
serious = c("Suspected Serious Injury", "SUSPECTED SERIOUS INJURY"),
fatal = c("Fatal Injury", "FATAL INJURY"),
other_level = "N/A"),
injury = fct_relevel(injury, "no_apparent", "possible", "minor", "serious", "fatal"),
damage = fct_collapse(`Vehicle Damage Extent`,
no_damage = c("No Damage", "NO DAMAGE"),
disabling = c("Disabling", "DISABLING"),
not_at_scene = c("Vehicle Not at Scene"),
functional = c("Functional", "FUNCTIONAL"),
superficial = c("Superficial", "SUPERFICIAL"),
destroyed = c("DESTROYED"),
other_level = "N/A"),
damage = fct_relevel(damage, "no_damage", "superficial", "functional", "disabling", "destroyed", "not_at_scene"),
weather = fct_collapse(Weather,
clear = c("Clear", "Cloudy", "CLEAR", "CLOUDY"),
rain = c("Rain", "RAINING"),
fog = c("Fog, Smog, Smoke", "FOGGY"),
wind = c("Severe Crosswinds", "SEVERE WINDS"),
snowy = c("Snow", "SNOW", "BLOWING SNOW", "Blowing Snow"),
sleet = c("Freezing Rain Or Freezing Drizzle", "WINTRY MIX", "SLEET", "Sleet Or Hail"),
other = c("BLOWING SAND, SOIL, DIRT"),
other_level = "N/A"),
weather = fct_relevel(weather, "clear", "wind", "fog", "rain", "sleet", "snowy", "other"),
light = fct_collapse(Light,
daytime = c("Daylight", "DAYLIGHT"),
nighttime_nolight = c("Dark - Not Lighted", "DARK NO LIGHTS"),
nighttime_light = c("Dark - Lighted", "DARK LIGHTS ON"),
dusk_dawn = c("Dusk", "Dawn", "DUSK", "DAWN"),
other_level = "N/A"),
light = fct_relevel(light, "daytime", "dusk_dawn", "nighttime_light", "nighttime_nolight", "N/A"),
alcohol = fct_relevel(alcohol, "Suspect of Alcohol Use", "Not Suspect of Alcohol Use", "Unknown"),
drugs = fct_relevel(alcohol, "Suspect of Drug Use", "Not Suspect of Drug Use", "Unknown"))
Context and Background: We want to analyze car crash data in order to determine what conditions lead to collisions and which conditions lead to more severe crashes. This data set is important as it allows drivers to recognize various factors that may lead to unsafe driving conditions and how keen they should be when looking out for them. This work has been done before, but it is important information to work with, as it leads to changes in how people drive, how cars are made, driving laws, etc. We overall are interested in finding what roles cars and alcohol can play on the severity of accidents which we can answer with two questions. Our first question is whether cars will do a good job of preventing injuries of the passengers. Our second question is if there is a correlation between alcohol and more serious injuries in accidents.
Description of Data: This data comes from Montgomery County, Maryland and details every instance of car collision from November 10th, 2020 to present. Each instance is recorded by the local police department, and the data is updated weekly. Each instance is recorded with conditions surrounding the collision and details of the collision itself. Conditions such as the weather, light level, speed limit, and vehicle type are recorded, which we would use as explanatory variables. For response variables, we would examine the collision details such as injury, vehicle damage, and collision type.
Some Interesting Metrics
carcrash |>
ggplot(aes(x = Longitude, y = Latitude)) +
geom_point(aes(color = injury), alpha = 0.3) +
borders("world") +
coord_quickmap(xlim = c(-77.5, -76.9), ylim = c(38.9, 39.35))
Figure 1. This is a map of where all of the car crashes took place within the county.
carcrash |>
ggplot(aes(y = weather)) +
geom_bar()
Figure 2. Most crashes occurred during clear weather, but unsurprisingly rain and snow were the two other weather conditions that led to the most crashes.
carcrash |>
ggplot(aes(x = light)) +
geom_bar()
Figure 3. Most crashes occured during the day or during the nighttime with light present which we did not expect.
Important Figures
carcrash |>
ggplot(aes(x = damage, fill = injury)) +
geom_bar() +
labs(x = "Vehicle Damage Extent", y = "Count", fill = "Injury Suffered")
Figure 4. Cars will always do a great job of protecting passengers from injuries unless they are completely distroyed. Data are based on car crashes recorded from Montgomery County, Maryland from November 10th, 2020 to the present. Vehicle Damage Extent is measured in categories. Injury Severity is also measured in categories. We have graphed the relationship between these variables by using a bar graph. From the graph we can see that unless the car has sustained serious damage, or been completely destroyed, the passengers have had almost no injuries.
As we can see from this figure, one feature that cars do exceptionally well in is protecting their passengers, even in collisions. According to PRT Accident Reconstruction, the protective shell of the car and features such as crumple zones absorb impact during the crashes leading to passenger safety. Therefore, we can conclude that cars do a very good job of protecting passengers and many injuries are diminished due to the many safety features such as automatic braking built into modern cars.
carcrash |>
group_by(injury, alcohol) |>
summarize(n = n()) |>
ggplot(aes(x = injury, y = n, color = alcohol)) +
geom_point(alpha = 0.5, size = 5)
Figure 5. Driving under the influence will often lead to more fatal crashes. Data are based on car crashes recorded from Montgomery County, Maryland from November 10th, 2020 to the present. Injury is measured in categories. Alcohol is also measured in categories. We have graphed the relationship between these variables by using a scatterplot. From the graph we can see that most crashes suffered by drivers not under the influence led to little or no injuries.
As we can see from the figure, drunk drivers have a much higher chance of being seriously injured in a car crash. According to Pacific West Injury Law, impaired reaction time and diminished coordination which can lead to very serious accidents. Thus, impaired driving is one of the leading causes of preventable deaths of the road and contributes to more serious accidents and injuries.