Analysis of NOAA Storm Database

Synopsis

This report analyzes the U.S. National Oceanic and Atmospheric Administration (NOAA) storm database to identify severe weather events causing the greatest human and economic impacts. To evaluate population health effects, fatalities and injuries were aggregated for each weather event type recorded in the data set. Economic damage was quantified by combining property and crop losses after decoding exponential magnitude multipliers. The analysis reveals that tornadoes are overwhelmingly the most harmful weather event to population health across the United States, causing the vast majority of injuries and fatalities. Excessive heat, thunderstorm winds, and floods also account for substantial casualties nationwide. Regarding financial impact, floods generate the greatest overall economic consequences, driven largely by severe infrastructure and property damage. Hurricanes/typhoons and storm surges also represent major sources of widespread property and agricultural loss. Municipal managers and emergency services can use these findings to optimize disaster readiness and resource allocation. Prioritizing funding toward tornado shelter networks and flood mitigation infrastructure will yield the highest return in protecting human life and property.

Data Processing

Loading the csv file and the packages

library(dplyr)
library(ggplot2)
library(tidyr)

setwd("D:\\Cousrses\\Data Analysis\\R for Data Analysis\\Peer-graded Assignment Course Project 2.2")
storm <- read.csv("repdata_data_StormData.csv.bz2", header = TRUE)

Process Population Health Data

First I select columns I need for the bar plot, group it by event type and calculate sum of both fatalities and injuries. Then, arrange it in descending order and slice the first 10 rows, then gather it and turning it into categorical variables for creating a grouped bar plot.

health_date <- storm %>%
  group_by(EVTYPE) %>%
  summarise(
    Fatalities = sum(FATALITIES, na.rm = TRUE),
    Injuries = sum(INJURIES, na.rm = TRUE),
    Total_health = Fatalities + Injuries
  ) %>%
  arrange(desc(Total_health))

top_health <- head(health_date, 10)

Process Economic Consequences Data

The values for the exponents for property and crop damage costs are messy, so I created a function to deal with that, and to calculate the cost with their respective exponent values (but in millions).

convert_exponent <- function(exp) {
  exp <- toupper(as.character(exp))
  case_when(
    exp == "H" ~ 100,
    exp == "K" ~ 1000,
    exp == "M" ~ 1000000,
    exp == "B" ~ 1000000000,
    TRUE ~ 1
  )
}

Aside from the function to calculate cost, the methodology is pretty much the same for the rest of the manipulation.

economic_data <- storm %>%
  mutate(
    prop_multiplier = sapply(PROPDMGEXP, convert_exponent),
    crop_multiplier = sapply(CROPDMGEXP, convert_exponent),
    property_damage = PROPDMG * prop_multiplier,
    crop_damage = CROPDMG * crop_multiplier,
    total_economic = property_damage + crop_damage 
  ) %>%
  group_by(EVTYPE) %>%
  summarize(
    Total_Property = sum(property_damage, na.rm = TRUE),
    Total_Crop = sum(crop_damage, na.rm = TRUE),
    Total_Economic = sum(total_economic, na.rm = TRUE)
  ) %>%
  arrange(desc(Total_Economic))

top_economic <- head(economic_data, 10)

Results

Health Impact Plot

1.Across the United States, which types of events (as indicated in the EVTYPE variable) are most harmful with respect to population health?

Reshape the health data from wide to long format so we can plot both Fatalities and Injuries side-by-side in ggplot2

health_long <- top_health %>%
  select(EVTYPE, Fatalities, Injuries) %>%
  pivot_longer(cols = c(Fatalities, Injuries), names_to = "Metric", values_to = "Count")

Generate the bar chart for population health impacts

ggplot(health_long, aes(x = reorder(EVTYPE, Count), y = Count, fill = Metric)) +
  geom_bar(stat = "identity", position = "dodge") + 
  coord_flip() + 
  labs(title = "Top 10 Weather Events Most Harmful to Population Health",
       x = "Event Type", y = "Number of Casualties") +
  theme_minimal()

  1. Across the United States, which types of events have the greatest economic consequences?

Prepare economic data by scaling numbers into billions and reshaping for plotting

economic_long <- top_economic %>%
  select(EVTYPE, Total_Property, Total_Crop) %>%
  mutate(
    Total_Property = Total_Property / 1e6,
    Total_Crop = Total_Crop / 1e6
  ) %>%
  pivot_longer(cols = c(Total_Property, Total_Crop), names_to = "Damage_Type", values_to = "Cost_Billion")

Generate the bar chart for economic consequences

ggplot(economic_long, aes(x = reorder(EVTYPE, Cost_Billion), y = Cost_Billion, fill = Damage_Type)) + 
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(title = "Top 10 Weather Events with Greatest Economic Consequences",
       x = "Event Type", y = "Cost (in Millions USD)") +
  theme_minimal()

Summary

1.Population Health: Across the United States, tornadoes are overwhelmingly the most harmful weather events, responsible for the highest cumulative total of fatalities and injuries by a wide margin. Other notable contributors include excessive heat and thunderstorm winds.

2.Economic Consequences: In terms of financial loss, floods generate the greatest economic consequences, driven primarily by extensive property damage. Hurricanes and typhoons follow closely as major drivers of catastrophic financial disruption to both property and agriculture.