Synopsis

This report explores the NOAA storm database to identify severe weather events that cause the most harm to public health and the largest economic losses across the United States. We load the raw bzip2 compressed CSV file directly in R, aggregate fatalities and injuries to measure health impacts, and combine property and crop damage to calculate total economic consequences. Results show tornadoes lead to the highest number of casualties, while floods create the greatest total economic damage. This analysis uses only the raw dataset without external preprocessing, and all steps are fully reproducible.

Data Processing

We first load required packages and read the raw compressed bz2 csv file directly. No pre-processing was done outside this document.

library(dplyr)
library(ggplot2)

# Read raw bzip2 compressed storm data
storm <- read.csv(bzfile("repdata_data_StormData.csv.bz2"))
storm_clean <- storm %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)
storm_clean <- storm_clean %>%
  mutate(health_impact = FATALITIES + INJURIES)
# Create multiplier lookup
multiplier <- function(exp){
  if (exp %in% c("h","H")) return(100)
  if (exp %in% c("k","K")) return(1000)
  if (exp %in% c("m","M")) return(1e6)
  if (exp %in% c("b","B")) return(1e9)
  else return(1)
}

storm_clean$prop_multi <- sapply(storm_clean$PROPDMGEXP, multiplier)
storm_clean$crop_multi <- sapply(storm_clean$CROPDMGEXP, multiplier)

storm_clean <- storm_clean %>%
  mutate(prop_dollar = PROPDMG * prop_multi,
         crop_dollar = CROPDMG * crop_multi,
         total_econ = prop_dollar + crop_dollar)
# Health impact summary
health_sum <- storm_clean %>%
  group_by(EVTYPE) %>%
  summarise(total_health = sum(health_impact, na.rm=TRUE)) %>%
  arrange(desc(total_health)) %>%
  head(10)

# Economic impact summary
econ_sum <- storm_clean %>%
  group_by(EVTYPE) %>%
  summarise(total_econ = sum(total_econ, na.rm=TRUE)) %>%
  arrange(desc(total_econ)) %>%
  head(10)
ggplot(health_sum, aes(x=reorder(EVTYPE, total_health), y=total_health)) +
  geom_bar(stat="identity", fill="#E74C3C") +
  coord_flip() +
  labs(x="Event Type", y="Total Casualties (Fatalities + Injuries)") +
  theme_bw()

ggplot(econ_sum, aes(x=reorder(EVTYPE, total_econ), y=total_econ)) +
  geom_bar(stat="identity", fill="#3498DB") +
  coord_flip() +
  labs(x="Event Type", y="Total Economic Damage (USD)") +
  theme_bw()