This analysis explores the NOAA Storm Database to identify the types of severe weather events that are most harmful to population health and that have the greatest economic consequences across the United States. The data includes events from 1950 to November 2011. We process the raw data to calculate the total number of fatalities, injuries, property damage, and crop damage per event type. Our findings highlight tornadoes as the most dangerous events for human health, while floods have the largest economic impact.
# Load the data
storm_data <- read.csv("repdata_data_StormData.csv")
# Select relevant columns
data_relevant <- storm_data %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)
# Convert Property and Crop Damage exponents
exp_to_multiplier <- function(exp) {
ifelse(exp %in% c('h', 'H'), 100,
ifelse(exp %in% c('k', 'K'), 1000,
ifelse(exp %in% c('m', 'M'), 1e6,
ifelse(exp %in% c('b', 'B'), 1e9, 1))))
}
data_relevant <- data_relevant %>%
mutate(
PROPDMGEXP = exp_to_multiplier(PROPDMGEXP),
CROPDMGEXP = exp_to_multiplier(CROPDMGEXP),
PROP_DAMAGE = PROPDMG * PROPDMGEXP,
CROP_DAMAGE = CROPDMG * CROPDMGEXP,
TOTAL_DAMAGE = PROP_DAMAGE + CROP_DAMAGE
)
# Summarize total fatalities and injuries by event type
health_impact <- data_relevant %>%
group_by(EVTYPE) %>%
summarize(
Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
Total_Injuries = sum(INJURIES, na.rm = TRUE)
) %>%
mutate(Total_Health_Impact = Total_Fatalities + Total_Injuries) %>%
arrange(desc(Total_Health_Impact))
# Summarize total economic damage by event type
economic_impact <- data_relevant %>%
group_by(EVTYPE) %>%
summarize(
Total_Damage = sum(TOTAL_DAMAGE, na.rm = TRUE)
) %>%
arrange(desc(Total_Damage))
# Top 10 events by health impact
top_health_events <- health_impact[1:10,]
ggplot(top_health_events, aes(x = reorder(EVTYPE, Total_Health_Impact), y = Total_Health_Impact)) +
geom_bar(stat = "identity", fill = "tomato") +
coord_flip() +
labs(title = "Top 10 Events Most Harmful to Population Health",
x = "Event Type",
y = "Total Fatalities and Injuries")
# Top 10 events by economic damage
top_economic_events <- economic_impact[1:10,]
ggplot(top_economic_events, aes(x = reorder(EVTYPE, Total_Damage), y = Total_Damage / 1e9)) +
geom_bar(stat = "identity", fill = "steelblue") +
coord_flip() +
labs(title = "Top 10 Events with Greatest Economic Consequences",
x = "Event Type",
y = "Total Damage (in Billions of USD)")
The analysis shows that tornadoes cause the most fatalities and injuries, making them the most harmful weather event to public health. Economically, floods result in the highest property and crop damages. These insights can help decision-makers allocate resources effectively to prepare for and mitigate the impact of severe weather events.