Storms and severe weather events cause significant public health and economic damage across the United States. This analysis explores the NOAA Storm Database (1950–2011) to identify which event types are most harmful to population health (measured by fatalities and injuries) and which have the greatest economic consequences (measured by property and crop damage).
Tornadoes are by far the most harmful to human health, accounting for the vast majority of fatalities and injuries. For economic impact, floods cause the greatest total damage, followed by hurricanes/typhoons and tornadoes. The analysis processes the raw compressed CSV file directly in R and presents results with two figures (one combined health figure and one economic figure).
library(R.utils)
library(data.table)
library(dplyr)
library(ggplot2)
library(tidyr)
if (!file.exists("repdata_data_StormData.csv.bz2")) {
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2",
"repdata_data_StormData.csv.bz2", method = "curl")
}
if (!file.exists("repdata_data_StormData.csv")) {
bunzip2("repdata_data_StormData.csv.bz2", "repdata_data_StormData.csv", remove = FALSE)
}
storm <- fread("repdata_data_StormData.csv", fill = TRUE, header = TRUE)
dim(storm)
## [1] 902297 37
head(storm, 3)
## STATE__ BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE
## <char> <char> <char> <char> <char> <char> <char>
## 1: 1.00 4/18/1950 0:00:00 0130 CST 97.00 MOBILE AL
## 2: 1.00 4/18/1950 0:00:00 0145 CST 3.00 BALDWIN AL
## 3: 1.00 2/20/1951 0:00:00 1600 CST 57.00 FAYETTE AL
## EVTYPE BGN_RANGE BGN_AZI BGN_LOCATI END_DATE END_TIME COUNTY_END COUNTYENDN
## <char> <char> <char> <char> <char> <char> <char> <char>
## 1: TORNADO 0.00 0.00
## 2: TORNADO 0.00 0.00
## 3: TORNADO 0.00 0.00
## END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG FATALITIES INJURIES
## <char> <char> <char> <char> <char> <char> <num> <num> <num>
## 1: 0.00 14.00 100.00 3 0 0 15
## 2: 0.00 2.00 150.00 2 0 0 0
## 3: 0.00 0.10 123.00 2 0 0 2
## PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP WFO STATEOFFIC ZONENAMES LATITUDE
## <num> <char> <num> <char> <char> <char> <char> <num>
## 1: 25.0 K 0 3040
## 2: 2.5 K 0 3042
## 3: 25.0 K 0 3340
## LONGITUDE LATITUDE_E LONGITUDE_ REMARKS REFNUM
## <num> <num> <num> <char> <num>
## 1: 8812 3051 8806 1
## 2: 8755 0 0 2
## 3: 8742 0 0 3
exp_to_num <- function(exp) {
case_when(
exp %in% c("K", "k") ~ 1000,
exp %in% c("M", "m") ~ 1e6,
exp %in% c("B", "b") ~ 1e9,
TRUE ~ 1
)
}
storm_clean <- storm %>%
mutate(
PROPDMGEXP_num = exp_to_num(PROPDMGEXP),
CROPDMGEXP_num = exp_to_num(CROPDMGEXP),
TotalPropertyDamage = PROPDMG * PROPDMGEXP_num,
TotalCropDamage = CROPDMG * CROPDMGEXP_num,
TotalEconomicDamage = TotalPropertyDamage + TotalCropDamage,
TotalHealthImpact = FATALITIES + INJURIES
) %>%
filter(!is.na(EVTYPE))
health_impact <- storm_clean %>%
group_by(EVTYPE) %>%
summarise(
TotalFatalities = sum(FATALITIES, na.rm = TRUE),
TotalInjuries = sum(INJURIES, na.rm = TRUE),
TotalHealth = sum(TotalHealthImpact, na.rm = TRUE)
) %>%
arrange(desc(TotalHealth)) %>%
slice_head(n = 10)
economic_impact <- storm_clean %>%
group_by(EVTYPE) %>%
summarise(
TotalProperty = sum(TotalPropertyDamage, na.rm = TRUE),
TotalCrop = sum(TotalCropDamage, na.rm = TRUE),
TotalEconomic = sum(TotalEconomicDamage, na.rm = TRUE)
) %>%
arrange(desc(TotalEconomic)) %>%
slice_head(n = 10)
health_long <- health_impact %>%
select(EVTYPE, TotalFatalities, TotalInjuries) %>%
pivot_longer(cols = c(TotalFatalities, TotalInjuries),
names_to = "Metric", values_to = "Count")
ggplot(health_long, aes(x = reorder(EVTYPE, Count), y = Count, fill = Metric)) +
geom_col(position = "dodge") +
coord_flip() +
labs(title = "Top 10 Events Harmful to Population Health",
x = "Event Type", y = "Count",
fill = "Impact") +
theme_minimal()
Top 10 weather event types by total fatalities and injuries (1950–2011). Tornadoes cause the overwhelming majority of health impacts.
economic_long <- economic_impact %>%
select(EVTYPE, TotalProperty, TotalCrop) %>%
pivot_longer(cols = c(TotalProperty, TotalCrop),
names_to = "DamageType", values_to = "Amount") %>%
mutate(Amount = Amount / 1e9)
ggplot(economic_long, aes(x = reorder(EVTYPE, Amount), y = Amount, fill = DamageType)) +
geom_col(position = "stack") +
coord_flip() +
labs(title = "Top 10 Events with Greatest Economic Consequences",
x = "Event Type", y = "Damage (Billions USD)",
fill = "Damage Type") +
theme_minimal()
Top 10 weather event types by total economic damage in USD (property + crop damage, 1950–2011). Floods have the greatest overall economic impact.
This analysis is fully reproducible from the original raw dataset and uses only two figures.