This report analyzes the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database to determine which types of severe weather events are most harmful to population health and which have the greatest economic consequences. Using data recorded between 1950 and November 2011, we aggregate fatalities and injuries by event type to assess public health impact, and we aggregate property and crop damage (adjusted for the reported damage-exponent codes) to assess economic impact. The analysis finds that tornadoes are responsible for the largest number of fatalities and injuries of any event type, making them the most significant threat to population health. For economic impact, floods cause the greatest total property and crop damage, with hurricanes/typhoons and tornadoes also among the most costly event types. These findings can help government and municipal managers prioritize resources toward the event types with the largest human and economic toll.
The analysis starts from the raw, compressed CSV file provided for
this assignment (repdata_data_StormData.csv.bz2). We read
it directly with read.csv(), which can decompress
.bz2 files automatically, and cache this step since it is
time-consuming.
## Read the raw, compressed CSV file directly (no external preprocessing)
stormData <- read.csv("repdata_data_StormData.csv.bz2", stringsAsFactors = FALSE)
dim(stormData)
## [1] 902297 37
str(stormData[, c("EVTYPE", "FATALITIES", "INJURIES",
"PROPDMG", "PROPDMGEXP", "CROPDMG", "CROPDMGEXP")])
## 'data.frame': 902297 obs. of 7 variables:
## $ EVTYPE : chr "TORNADO" "TORNADO" "TORNADO" "TORNADO" ...
## $ FATALITIES: num 0 0 0 0 0 0 0 0 1 0 ...
## $ INJURIES : num 15 0 2 2 2 6 1 0 14 0 ...
## $ PROPDMG : num 25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25 ...
## $ PROPDMGEXP: chr "K" "K" "K" "K" ...
## $ CROPDMG : num 0 0 0 0 0 0 0 0 0 0 ...
## $ CROPDMGEXP: chr "" "" "" "" ...
For population health impact, we use the FATALITIES and
INJURIES columns directly, summed by event type
(EVTYPE).
healthByEvent <- aggregate(
cbind(FATALITIES, INJURIES) ~ EVTYPE,
data = stormData,
FUN = sum
)
## Total harm = fatalities + injuries, used to rank event types
healthByEvent$TotalHarm <- healthByEvent$FATALITIES + healthByEvent$INJURIES
## Top 10 event types by total harm
topHealth <- healthByEvent[order(-healthByEvent$TotalHarm), ][1:10, ]
topHealth
## EVTYPE FATALITIES INJURIES TotalHarm
## 834 TORNADO 5633 91346 96979
## 130 EXCESSIVE HEAT 1903 6525 8428
## 856 TSTM WIND 504 6957 7461
## 170 FLOOD 470 6789 7259
## 464 LIGHTNING 816 5230 6046
## 275 HEAT 937 2100 3037
## 153 FLASH FLOOD 978 1777 2755
## 427 ICE STORM 89 1975 2064
## 760 THUNDERSTORM WIND 133 1488 1621
## 972 WINTER STORM 206 1321 1527
The PROPDMG and CROPDMG columns give
property and crop damage amounts, but the actual scale of each value is
given separately by the PROPDMGEXP and
CROPDMGEXP “exponent” columns (e.g. “K” for thousands, “M”
for millions, “B” for billions). We convert these exponent codes into
numeric multipliers and compute the actual dollar amounts before
aggregating by event type. Codes that do not correspond to a documented
multiplier (e.g. blank, “?”, or numeric digit codes) are treated
conservatively as a multiplier of 1 for property damage estimation
purposes.
## Function to convert the exponent code column into a numeric multiplier
convertExp <- function(expCode) {
expCode <- toupper(trimws(expCode))
multiplier <- rep(1, length(expCode))
multiplier[expCode == "H"] <- 1e2
multiplier[expCode == "K"] <- 1e3
multiplier[expCode == "M"] <- 1e6
multiplier[expCode == "B"] <- 1e9
multiplier[expCode %in% as.character(0:9)] <- 10^as.numeric(expCode[expCode %in% as.character(0:9)])
multiplier[expCode %in% c("", "-", "?", "+")] <- 1
multiplier
}
stormData$PROPDMGTOTAL <- stormData$PROPDMG * convertExp(stormData$PROPDMGEXP)
stormData$CROPDMGTOTAL <- stormData$CROPDMG * convertExp(stormData$CROPDMGEXP)
economicByEvent <- aggregate(
cbind(PROPDMGTOTAL, CROPDMGTOTAL) ~ EVTYPE,
data = stormData,
FUN = sum
)
## Total economic damage = property + crop damage, in dollars
economicByEvent$TotalDamage <- economicByEvent$PROPDMGTOTAL + economicByEvent$CROPDMGTOTAL
## Convert to billions of dollars for readability
economicByEvent$TotalDamageBillions <- economicByEvent$TotalDamage / 1e9
## Top 10 event types by total economic damage
topEconomic <- economicByEvent[order(-economicByEvent$TotalDamageBillions), ][1:10, ]
topEconomic
## EVTYPE PROPDMGTOTAL CROPDMGTOTAL TotalDamage
## 170 FLOOD 144657709807 5661968450 150319678257
## 411 HURRICANE/TYPHOON 69305840000 2607872800 71913712800
## 834 TORNADO 56947380677 414953270 57362333947
## 670 STORM SURGE 43323536000 5000 43323541000
## 244 HAIL 15735267513 3025954473 18761221986
## 153 FLASH FLOOD 16822673979 1421317100 18243991079
## 95 DROUGHT 1046106000 13972566000 15018672000
## 402 HURRICANE 11868319010 2741910000 14610229010
## 590 RIVER FLOOD 5118945500 5029459000 10148404500
## 427 ICE STORM 3944927860 5022113500 8967041360
## TotalDamageBillions
## 170 150.319678
## 411 71.913713
## 834 57.362334
## 670 43.323541
## 244 18.761222
## 153 18.243991
## 95 15.018672
## 402 14.610229
## 590 10.148404
## 427 8.967041
The bar chart below (Figure 1) shows the top 10 event types by total harm (fatalities plus injuries) across the United States from 1950 to November 2011. Tornadoes cause by far the greatest number of combined fatalities and injuries of any event type, followed at a distance by excessive heat and thunderstorm wind-related events.
library(ggplot2)
topHealth$EVTYPE <- factor(topHealth$EVTYPE, levels = topHealth$EVTYPE[order(topHealth$TotalHarm)])
ggplot(topHealth, aes(x = EVTYPE, y = TotalHarm)) +
geom_bar(stat = "identity", fill = "firebrick") +
coord_flip() +
labs(
title = "Figure 1: Top 10 Weather Event Types by Total Population Health Impact",
subtitle = "Total fatalities + injuries, United States, 1950-2011",
x = "Event Type",
y = "Total Fatalities + Injuries"
) +
theme_bw()
Figure 1 caption: This bar chart ranks the 10 event types with the highest combined total of fatalities and injuries recorded in the NOAA storm database. Tornadoes stand out as the single most harmful event type to population health by a wide margin.
The bar chart below (Figure 2) shows the top 10 event types by total economic damage (property damage plus crop damage, in billions of dollars). Floods cause the greatest total economic damage, followed by hurricanes/typhoons and tornadoes.
topEconomic$EVTYPE <- factor(topEconomic$EVTYPE, levels = topEconomic$EVTYPE[order(topEconomic$TotalDamageBillions)])
ggplot(topEconomic, aes(x = EVTYPE, y = TotalDamageBillions)) +
geom_bar(stat = "identity", fill = "steelblue") +
coord_flip() +
labs(
title = "Figure 2: Top 10 Weather Event Types by Total Economic Damage",
subtitle = "Total property + crop damage, United States, 1950-2011",
x = "Event Type",
y = "Total Damage (Billions of USD)"
) +
theme_bw()
Figure 2 caption: This bar chart ranks the 10 event types with the highest combined property and crop damage (in billions of dollars), computed after adjusting each event’s reported damage value by its corresponding exponent code. Floods have caused the greatest cumulative economic damage of any event type since 1950.
Tornadoes represent the greatest threat to population health among the severe weather event types recorded in the NOAA storm database, while floods represent the greatest overall economic burden. Government and municipal managers responsible for prioritizing severe weather preparedness resources may wish to weigh these two considerations separately, since the event types that pose the greatest risk to human life are not identical to those that cause the greatest financial damage.