This analysis uses the NOAA Storm Database to identify which types of weather events are most harmful to population health and which have the greatest economic consequences in the United States. We analyse data from 1950 to 2011, using fatalities and injuries to evaluate population health impact and property and crop damage for economic impact. This report aims to support disaster preparedness and mitigation strategies by highlighting the most dangerous event types.
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(readr)
library(tidyr)
# Load the data
storm <- read.csv("repdata-data-StormData.csv.bz2")
# Select relevant columns
storm_clean <- storm %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)
# Convert damage exponents
exp_map <- c("0"=1, "1"=10, "2"=100, "3"=1000, "4"=10000,
"5"=1e5, "6"=1e6, "7"=1e7, "8"=1e8,
"H"=100, "h"=100, "K"=1e3, "k"=1e3,
"M"=1e6, "m"=1e6, "B"=1e9)
storm_clean <- storm_clean %>%
mutate(PROPDMGEXP = toupper(PROPDMGEXP),
CROPDMGEXP = toupper(CROPDMGEXP),
prop_mult = exp_map[PROPDMGEXP],
crop_mult = exp_map[CROPDMGEXP],
prop_mult = as.numeric(prop_mult),
crop_mult = as.numeric(crop_mult),
property_damage = PROPDMG * prop_mult,
crop_damage = CROPDMG * crop_mult,
total_damage = property_damage + crop_damage)
storm_health <- storm_clean %>%
group_by(EVTYPE) %>%
summarise(Fatalities = sum(FATALITIES, na.rm = TRUE),
Injuries = sum(INJURIES, na.rm = TRUE)) %>%
mutate(Total = Fatalities + Injuries) %>%
arrange(desc(Total)) %>%
head(10)
# Plot
storm_health_long <- storm_health %>%
pivot_longer(cols = c(Fatalities, Injuries), names_to = "Type", values_to = "Count")
ggplot(storm_health_long, aes(x = reorder(EVTYPE, -Count), y = Count, fill = Type)) +
geom_bar(stat = "identity", position = "stack") +
labs(title = "Top 10 Most Harmful Event Types to Population Health",
x = "Event Type", y = "Number of People") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
storm_econ <- storm_clean %>%
group_by(EVTYPE) %>%
summarise(Total_Damage = sum(total_damage, na.rm = TRUE)) %>%
arrange(desc(Total_Damage)) %>%
head(10)
# Plot
ggplot(storm_econ, aes(x = reorder(EVTYPE, -Total_Damage), y = Total_Damage/1e9)) +
geom_col(fill = "darkred") +
labs(title = "Top 10 Events With Greatest Economic Impact",
x = "Event Type", y = "Total Damage (Billion USD)") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Tornadoes are the most harmful weather events to population health, causing the highest combined number of fatalities and injuries. In contrast, floods and hurricanes cause the most significant economic damage. These findings can help local and federal agencies prioritise resource allocation for disaster response and preparedness.