Storms and other severe weather events can cause both public health and economic problems for communities and municipalities. Many severe events can result in fatalities, injuries, and property damage. This project involves exploring the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. This database tracks characteristics of major storms and weather events in the United States, including when and where they occur as well as estimates of any fatalities, injuries, and property damage. The analysis addresses which weather event types are most harmful with respect to population health and which have the greatest economic consequences. Based on annual averages from the dataset, Tornadoes are overwhelmingly the most harmful to population health in terms of fatalities and injuries, while Floods and related high-water events account for the greatest economic consequences.
The data for this analysis originate from the official NOAA Storm
Database file (repdata_data_StormData.csv). To prepare the
data for analysis, the raw CSV file is loaded into R using
read.csv2().
To process the dataset for our specific evaluation:
Column Filtering: We subset the data to retain
only the reference number (REFNUM), beginning date
(BGN_DATE), event type (EVTYPE), population
health metrics (FATALITIES, INJURIES), and
economic impact metrics (PROPDMG, PROPDMGEXP,
CROPDMG, CROPDMGEXP).
Date Parsing and Year Extraction:
BGN_DATE strings are parsed into proper date-time objects
using lubridate::mdy_hms(), and a YEAR column
is derived to facilitate annualized calculations.
Economic Damage Scaling: Property and crop
damage exponent characters (K for thousands, M
for millions, B for billions) are mapped using
case_when() and multiplied by their respective numeric
damage values to calculate a unified total damage cost
(TOTDMG).
Annual Averaging: Data are grouped by event type
(EVTYPE) and YEAR to compute annual totals,
which are then averaged across the years to find the stable
mean_annual metrics.
library(tidyverse)
library(lubridate)
raw_data <- read.csv2('repdata_data_StormData.csv', sep = ',') %>%
select(REFNUM, BGN_DATE, EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP) %>%
mutate(
BGN_DATE = mdy_hms(BGN_DATE),
FATALITIES = as.numeric(FATALITIES),
INJURIES = as.numeric(INJURIES),
TOTDMG =
(as.numeric(PROPDMG) *
case_when(
PROPDMGEXP == 'B' ~ 1000000000,
PROPDMGEXP == 'M' ~ 1000000,
PROPDMGEXP == 'K' ~ 1000,
TRUE ~ 1
)) +
(as.numeric(CROPDMG) *
case_when(
CROPDMGEXP == 'B' ~ 1000000000,
CROPDMGEXP == 'M' ~ 1000000,
CROPDMGEXP == 'K' ~ 1000,
TRUE ~ 1
)),
YEAR = year(BGN_DATE)
)
To evaluate the impact on population health and economic damage across the United States, we compute the top 20 leading weather event types based on mean annual metrics.
fatality <- raw_data %>%
group_by(EVTYPE, YEAR) %>%
summarize(annual_fatal = sum(FATALITIES, na.rm = TRUE), .groups = "drop") %>%
group_by(EVTYPE) %>%
summarize(mean_annual_fatal = mean(annual_fatal, na.rm = TRUE), .groups = "drop")
fatality %>%
mutate(EVTYPE = trimws(EVTYPE)) %>%
slice_max(mean_annual_fatal, n = 20, with_ties = FALSE) %>%
mutate(EVTYPE = reorder(EVTYPE, mean_annual_fatal)) %>%
ggplot(aes(x = mean_annual_fatal, y = EVTYPE)) +
geom_col(fill = "steelblue") +
labs(
title = "Top 20 Weather Events by Mean Annual Fatalities",
x = "Mean Annual Fatalities",
y = "Event Type"
) +
theme_minimal() +
theme(
plot.title = element_text(face = "bold", size = 12),
axis.text.y = element_text(size = 9)
)
Figure 1: Top 20 weather event types sorted by their mean annual fatalities, highlighting tornadoes as the primary driver of weather-related deaths in the United States.
injuries <- raw_data %>%
group_by(EVTYPE, YEAR) %>%
summarize(annual_injuries = sum(INJURIES, na.rm = TRUE), .groups = "drop") %>%
group_by(EVTYPE) %>%
summarize(mean_annual_injuries = mean(annual_injuries, na.rm = TRUE), .groups = "drop")
injuries %>%
mutate(EVTYPE = trimws(EVTYPE)) %>%
slice_max(mean_annual_injuries, n = 20, with_ties = FALSE) %>%
mutate(EVTYPE = reorder(EVTYPE, mean_annual_injuries)) %>%
ggplot(aes(x = mean_annual_injuries, y = EVTYPE)) +
geom_col(fill = "steelblue") +
labs(
title = "Top 20 Weather Events by Mean Annual Injuries",
x = "Mean Annual Injuries",
y = "Event Type"
) +
theme_minimal() +
theme(
plot.title = element_text(face = "bold", size = 12),
axis.text.y = element_text(size = 9)
)
Figure 2: Top 20 weather event types sorted by their mean annual injuries. Similar to fatalities, tornadoes cause a disproportionate share of personal injuries compared to other event categories.
total_cost <- raw_data %>%
group_by(EVTYPE, YEAR) %>%
summarize(annual_cost = sum(TOTDMG, na.rm = TRUE), .groups = "drop") %>%
group_by(EVTYPE) %>%
summarize(mean_annual_cost = mean(annual_cost, na.rm = TRUE), .groups = "drop")
total_cost %>%
mutate(EVTYPE = trimws(EVTYPE)) %>%
slice_max(mean_annual_cost, n = 20, with_ties = FALSE) %>%
mutate(EVTYPE = reorder(EVTYPE, mean_annual_cost)) %>%
ggplot(aes(x = mean_annual_cost, y = EVTYPE)) +
geom_col(fill = "steelblue") +
labs(
title = "Top 20 Weather Events by Mean Annual Financial Damage",
x = "Mean Annual Financial Damage (USD)",
y = "Event Type"
) +
theme_minimal() +
theme(
plot.title = element_text(face = "bold", size = 12),
axis.text.y = element_text(size = 9)
)
Figure 3: Top 20 weather event types ranked by mean annual financial damage, demonstrating that floods and severe storms account for the greatest economic losses.