Synopsis

This report explores the NOAA storm database to determine which severe weather events have the greatest impact on public health and the economy from 1950 to November 2011. Fatalities and injuries were aggregated by event type to assess health impacts. Property and crop damage estimates were converted to numerical values and summed to evaluate economic consequences. The analysis reveals that tornadoes are the most harmful event type concerning population health, causing the highest number of casualties. From an economic standpoint, floods are responsible for the greatest total property and crop damage.

Data Processing

First, we load the dataset. Ensure the repdata_data_StormData.csv.bz2 file is in your working directory.

storm_data <- read.csv("repdata_data_StormData.csv.bz2", stringsAsFactors = FALSE)

We subset the relevant columns and calculate the economic damage multipliers to convert the exponent characters into numerical values. We also calculate the total casualties by combining fatalities and injuries.

analysis_data <- storm_data %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP) %>%
  mutate(
    PROP_MULT = case_when(
      toupper(PROPDMGEXP) == "K" ~ 1000,
      toupper(PROPDMGEXP) == "M" ~ 1000000,
      toupper(PROPDMGEXP) == "B" ~ 1000000000,
      TRUE ~ 1
    ),
    CROP_MULT = case_when(
      toupper(CROPDMGEXP) == "K" ~ 1000,
      toupper(CROPDMGEXP) == "M" ~ 1000000,
      toupper(CROPDMGEXP) == "B" ~ 1000000000,
      TRUE ~ 1
    ),
    TOTAL_ECO_DMG = (PROPDMG * PROP_MULT) + (CROPDMG * CROP_MULT),
    TOTAL_CASUALTIES = FATALITIES + INJURIES
  )

Results

Health Impact

We aggregate the total casualties by event type to identify the most harmful weather events.

health_impact <- analysis_data %>%
  group_by(EVTYPE) %>%
  summarize(Total_Casualties = sum(TOTAL_CASUALTIES, na.rm = TRUE)) %>%
  arrange(desc(Total_Casualties)) %>%
  slice(1:10)

ggplot(health_impact, aes(x = reorder(EVTYPE, Total_Casualties), y = Total_Casualties)) +
  geom_bar(stat = "identity", fill = "darkred") +
  coord_flip() +
  labs(title = "Top 10 Weather Events by Total Casualties",
       x = "Event Type",
       y = "Total Casualties (Fatalities + Injuries)") +
  theme_minimal()

Economic Impact

We aggregate the total economic damage by event type to identify the events with the greatest economic consequences.

economic_impact <- analysis_data %>%
  group_by(EVTYPE) %>%
  summarize(Total_Damage = sum(TOTAL_ECO_DMG, na.rm = TRUE)) %>%
  arrange(desc(Total_Damage)) %>%
  slice(1:10)

ggplot(economic_impact, aes(x = reorder(EVTYPE, Total_Damage), y = Total_Damage)) +
  geom_bar(stat = "identity", fill = "darkgreen") +
  coord_flip() +
  labs(title = "Top 10 Weather Events by Total Economic Damage",
       x = "Event Type",
       y = "Total Damage (in USD)") +
  theme_minimal()