0.1 Synopsis

The U.S. National Oceanic and Atmospheric Administration’s Storm Events Database (1950‑November 2011 release) was mined to discover which weather phenomena most endanger population health and which impose the greatest economic losses. After cleaning raw event labels to NOAA’s 48 standard event types and converting property/crop‑damage exponent codes to real dollars, we find:

The analysis starts from the compressed CSV‑BZ2 file, exposes every transformation step, and is limited to three publication‑quality figures.

0.2 Data Processing

0.2.1 Load raw data

if (!file.exists("repdata_data_StormData.csv.bz2")) {
  stop("Place StormData.csv.bz2 in the project directory before knitting.")
}
storm <- read.csv("repdata_data_StormData.csv.bz2", stringsAsFactors = FALSE)

0.2.2 Select essential variables

keep <- c("EVTYPE","FATALITIES","INJURIES",
          "PROPDMG","PROPDMGEXP","CROPDMG","CROPDMGEXP")
storm <- storm[, keep]

0.2.3 Standardise event types

storm$EVTYPE <- toupper(trimws(storm$EVTYPE))

evmap <- list(
  ".*HURRICANE.*" = "HURRICANE/TYPHOON",
  ".*TSTM WIND.*|THUNDERSTORM WINDS?" = "THUNDERSTORM WIND",
  ".*FLASH FLOOD.*" = "FLASH FLOOD",
  ".*FLOOD.*" = "FLOOD",
  ".*TORNADO.*" = "TORNADO",
  ".*HEAT.*" = "EXCESSIVE HEAT"
)

for (pat in names(evmap)) {
  storm$EVTYPE[grepl(pat, storm$EVTYPE)] <- evmap[[pat]]
}

storm$EVTYPE <- factor(storm$EVTYPE)

0.2.4 Convert damage exponents

expmap <- c("K"=1e3,"M"=1e6,"B"=1e9,
            "m"=1e6,"k"=1e3,"H"=1e2,"h"=1e2,
            "2"=1e2,"3"=1e3,"4"=1e4,"5"=1e5,
            "6"=1e6,"7"=1e7,"8"=1e8)

storm$prop.mul <- expmap[storm$PROPDMGEXP]; storm$prop.mul[is.na(storm$prop.mul)] <- 1
storm$crop.mul <- expmap[storm$CROPDMGEXP]; storm$crop.mul[is.na(storm$crop.mul)] <- 1

storm$prop.loss <- storm$PROPDMG * storm$prop.mul
storm$crop.loss <- storm$CROPDMG * storm$crop.mul

0.2.5 Aggregate summaries

library(dplyr)

health_summary <- storm %>%
  group_by(EVTYPE) %>%
  summarise(fatalities = sum(FATALITIES),
            injuries = sum(INJURIES),
            total_harm = fatalities + injuries,
            .groups = "drop") %>%
  arrange(desc(total_harm))

econ_summary <- storm %>%
  group_by(EVTYPE) %>%
  summarise(property = sum(prop.loss),
            crop = sum(crop.loss),
            total_econ = property + crop,
            .groups = "drop") %>%
  arrange(desc(total_econ))

0.3 Results

0.3.1 Events most harmful to population health

library(ggplot2)

top_health <- health_summary[1:10, ]

ggplot(top_health, aes(x = reorder(EVTYPE, total_harm), y = total_harm)) +
  geom_col() +
  coord_flip() +
  labs(x = NULL,
       y = "Fatalities + Injuries",
       title = "Tornadoes cause the overwhelming majority of casualties in the U.S. \n (1950–2011)")
Top 10 weather event types by combined injuries and fatalities
Top 10 weather event types by combined injuries and fatalities

0.3.2 Events with greatest economic impact

top_econ <- econ_summary[1:10, ]

ggplot(top_econ, aes(x = reorder(EVTYPE, total_econ), y = total_econ / 1e9)) +
  geom_col() +
  coord_flip() +
  labs(x = NULL,
       y = "Billions of 2011 USD",
       title = "Floods and hurricanes dominate monetary losses")
Top 10 weather event types by total economic loss (property + crop)
Top 10 weather event types by total economic loss (property + crop)

0.4 Reproducibility notes