Synopsis

This analysis explores the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database to determine which severe weather events cause the most significant public health and economic impacts. Between 1950 and 2011, tornadoes were found to be the most harmful to population health, causing the highest total number of fatalities and injuries. From an economic standpoint, floods resulted in the greatest total property and crop damage. The data was aggregated by event type to identify these primary drivers of historical damage and harm.

Data Processing

The analysis must start from the raw CSV file. The dataset is loaded and filtered to include only the necessary variables to optimize processing speed. Damage multipliers (K, M, B) are mapped to their numerical equivalents to calculate total economic costs.

# Using cache = TRUE for time-consuming data loading
storm_data <- read.csv("repdata_data_StormData.csv.bz2")

# Select relevant columns for health and economic impact
analysis_data <- storm_data %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)

# Function to convert exponent symbols to numeric multipliers
convert_exp <- function(x) {
  x <- toupper(x)
  ifelse(x == "B", 10^9,
         ifelse(x == "M", 10^6,
                ifelse(x == "K", 10^3,
                       ifelse(x == "H", 10^2, 1))))
}

# Apply multipliers to calculate total damage costs
processed_data <- analysis_data %>%
  mutate(
    PropDamageTotal = PROPDMG * convert_exp(PROPDMGEXP),
    CropDamageTotal = CROPDMG * convert_exp(CROPDMGEXP),
    TotalHealthImpact = FATALITIES + INJURIES,
    TotalEconomicImpact = PropDamageTotal + CropDamageTotal
  )

Results

1. Most Harmful Events to Population Health

To address which event types are most harmful to population health, fatalities and injuries are aggregated by event type.

health_impact <- processed_data %>%
  group_by(EVTYPE) %>%
  summarize(
    Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
    Total_Injuries = sum(INJURIES, na.rm = TRUE),
    Total = sum(TotalHealthImpact, na.rm = TRUE)
  ) %>%
  arrange(desc(Total)) %>%
  slice_head(n = 10)

# Reshape for plotted stacked bar chart
health_long <- health_impact %>%
  select(EVTYPE, Total_Fatalities, Total_Injuries) %>%
  pivot_longer(cols = c(Total_Fatalities, Total_Injuries), 
               names_to = "ImpactType", values_to = "Count")

# Figure 1
ggplot(health_long, aes(x = reorder(EVTYPE, -Count), y = Count, fill = ImpactType)) +
  geom_bar(stat = "identity") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  labs(title = "Top 10 Weather Events by Population Health Impact",
       x = "Event Type",
       y = "Total Number of People Affected",
       fill = "Impact Type")

2. Events with the Greatest Economic Consequences

To address which event types have the greatest economic consequences, property and crop damage values are aggregated.

economic_impact <- processed_data %>%
  group_by(EVTYPE) %>%
  summarize(
    Property_Damage = sum(PropDamageTotal, na.rm = TRUE),
    Crop_Damage = sum(CropDamageTotal, na.rm = TRUE),
    Total = sum(TotalEconomicImpact, na.rm = TRUE)
  ) %>%
  arrange(desc(Total)) %>%
  slice_head(n = 10)

economic_long <- economic_impact %>%
  select(EVTYPE, Property_Damage, Crop_Damage) %>%
  pivot_longer(cols = c(Property_Damage, Crop_Damage), 
               names_to = "DamageType", values_to = "Cost")

# Figure 2 
ggplot(economic_long, aes(x = reorder(EVTYPE, -Cost), y = Cost, fill = DamageType)) +
  geom_bar(stat = "identity") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  labs(title = "Top 10 Weather Events by Economic Consequences",
       x = "Event Type",
       y = "Total Cost (USD)",
       fill = "Damage Type")