This report explores the U.S. National Oceanic and Atmospheric Administration (NOAA) storm database to identify the most harmful types of severe weather events in the United States. The goal is to determine which events have the greatest impact on population health and economic consequences. The analysis focuses on the total number of fatalities and injuries to assess health impact, and on property and crop damage to evaluate economic impact. Bar plots are used to visually represent the most impactful weather events. This analysis can help emergency management agencies prioritize resource allocation and disaster preparedness.
#Load the data
storm_data <- read.csv("StormData.csv.bz2")
# Keep only necessary columns
storm <- storm_data %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP,
CROPDMG, CROPDMGEXP)
#Convert damage exponents to numeric multipliers
exp_convert <- function(exp){
exp <- toupper((trimws(exp)))
ifelse(exp == "K", 1e3,
ifelse(exp == "M", 1e6,
ifelse(exp == "B", 1e9, 1)))
}
storm$PROPDMGEXP2 <- exp_convert(storm$PROPDMGEXP)
storm$CROPDMGEXP2 <- exp_convert(storm$CROPDMGEXP)
# Calculate actual damages
storm$PROP_COST <- storm$PROPDMG * storm$PROPDMGEXP2
storm$CROP_COST <- storm$CROPDMG * storm$CROPDMGEXP2
storm$TOTAL_COST <- storm$PROP_COST + storm$CROP_COST
health_impact <- storm %>%
group_by(EVTYPE)%>%
summarise(
Fatalities = sum(FATALITIES, na.rm = TRUE),
Injuries = sum(INJURIES, na.rm = TRUE)
) %>%
mutate(TotalHarm = Fatalities + Injuries)%>%
arrange(desc(TotalHarm))%>%
slice(1:10)
#Bar Plot
ggplot(health_impact, aes(x = reorder(EVTYPE, -TotalHarm), y = TotalHarm)) + geom_bar(stat = "identity", fill = "steelblue") +
labs(
title = "Top 10 Most Harmful Weather Events to Population Health", x = "Event Type", y = "Fatalities + Injuries"
) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
econ_impact <- storm %>%
group_by(EVTYPE) %>%
summarise(TotalCost = sum(TOTAL_COST, na.rm = TRUE))%>%
arrange(desc(TotalCost))%>%
slice(1:10)
#Bar Plot
ggplot(econ_impact, aes(x = reorder(EVTYPE, -TotalCost), y = TotalCost / 1e9)) + geom_bar(stat = "identity", fill = "darkgreen")+
labs(
title = "Top 10 Weather Events with Greatest Economic Consequences", x = "Event Type", y = "Total Damage (Billion USD)"
) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
## Results
Tornadoes, excessive heat, and floods cause the highest number of fatalities and injuries. Hurricanes and floods cause the most economic damage.