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, and preventing such outcomes to the extent possible is a key concern.
The greatest economical damage is produced with severe weather incindents, such as floods, hurricanes, and tornadoes reaching the commulative effect of several billion dollars and causing several thousand deaths in total.
In addition to the severe weather events, such as floods and tornadoes, a significan ammount of human fatalities also happens during heat and many deaths are caused with lightning strikes.
The report is based on 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 database describes the observations and characteristics of storms and other severe weather events starting in the 1950 and ending in November 2011.
The raw data is available at the course website as a comma-separated file compressed into bzip2.
The file contains less than 1.3M lines, so we will use this estimate for memory allocation.
URL <- 'https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2'
FILENAME <- 'stormdata.csv.bz2'
if (!file.exists(FILENAME)) {
download.file(URL, FILENAME, method='curl')
}
data <- read.csv(FILENAME, nrows = 1.3e6) # `wc -l` gives 1232705 lines
First, let’s subset the observation with non-zero damage or human victims.
data2 <- subset(data, FATALITIES + INJURIES + PROPDMG + CROPDMG > 0
, select = c(EVTYPE, FATALITIES, INJURIES
, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP))
The EVTYPE variable, which stands for the event type does not seem to be filled-in accurately having more than 985 different values, so we will group them into the main categories.
rep <- list()
rep['Astronomical Low Tide'] <- 'LOW TIDE'
rep['Avalanche'] <- 'AVALAN'
rep['Blizzard'] <- 'BLIZZARD'
rep['Coastal Flood'] <- 'BEACH|EROS|COAST|CSTL'
rep['Cold/Wind Chill'] <- 'COLD|(WIND CHILL)'
rep['Debris Flow'] <- 'DEBRIS|SLIDE'
rep['Dense Fog'] <- 'FOG'
rep['Dense Smoke'] <- 'SMOKE'
rep['Drought'] <- 'DRY|DROUGHT'
rep['Dust Devil'] <- 'DUST DEV'
rep['Dust Storm'] <- 'DUST ?STORM'
rep['Excessive Heat'] <- '(RECORD (HIGH|HEAT|TEMP|WARM))|HOT'
rep['Extreme Cold/Wind Chill'] <- '(EXTREME|RECORD).*(COLD|LOW|COOL)'
rep['Flash Flood'] <- 'FLASH|STREAM'
rep['Flood'] <- 'FLOOD'
rep['Frost/Freeze'] <- 'FR[OE]*[SZ]'
rep['Funnel Cloud'] <- 'FUNNEL'
rep['Freezing Fog'] <- 'FREEZING FOG'
rep['Hail'] <- 'HAIL'
rep['Heat'] <- 'HEAT'
rep['Heavy Rain'] <- 'HEAVY (RAIN|SHOW)'
rep['Heavy Snow'] <- 'HEAVY SNOW'
rep['High Surf'] <- 'SURF'
rep['High Wind'] <- 'HIGH WIND'
rep['Hurricane (Typhoon)'] <- 'HURRICANE|TYPHOON'
rep['Ice Storm'] <- 'ICE STORM'
rep['Lake-Effect Snow'] <- 'LAKE.*SNOW'
rep['Lakeshore Flood'] <- 'LAKE.*FLOOD'
rep['Lightning'] <- 'LIG[HN]TN?ING'
rep['Marine Hail'] <- 'MARINE HAIL'
rep['Marine High Wind'] <- 'MARINE HIGH WIND'
rep['Marine Strong Wind'] <- 'MARINE STRONG WIND'
rep['Marine Thunderstorm Wind'] <- 'MARINE THUNDER'
rep['Rip Current'] <- 'RIP CURRENT'
rep['Seiche'] <- 'SEICHE'
rep['Sleet'] <- 'SLEET'
rep['Storm Surge/Tide'] <- 'SURGE|TIDE'
rep['Strong Wind'] <- 'STRONG WIND'
rep['Thunderstorm Wind'] <- 'THUN?D?|TSTM'
rep['Tornado'] <- 'TORN'
rep['Tropical Depression'] <- 'TROPICAL DEPRESSION'
rep['Tropical Storm'] <- 'TROPICAL STORM'
rep['Tsunami'] <- 'TSUNAMI'
rep['Volcanic Ash'] <- 'VOLCANIC'
rep['Waterspout'] <- 'TER.*SPOUT'
rep['Wildfire'] <- 'FIRE'
rep['Winter Storm'] <- 'WINTER STORM'
rep['Winter Weather'] <- 'WINT.*(WEATHER|MIX)'
data2$EVTYPE2 <- 'Other'
for (repl in names(rep)) {
data2$EVTYPE2[grep(rep[[repl]], data2$EVTYPE)] <- repl
}
The economic consequences can be estimates with the crop and property damage caused by a certain weather event.
exp.factor <- function(value, exponent) {
factors <- setNames(c(1e9, 1e6, 1e3, 1e2), c('B', 'M', 'K', 'H'))
factor <- factors[toupper(exponent)]
if (is.na(factor)) as.numeric(value) else as.numeric(value)*factor
}
data2 <- transform(data2
, COST = (mapply(exp.factor, PROPDMG, PROPDMGEXP)
+ mapply(exp.factor, CROPDMG, CROPDMGEXP))/1e9
)
A enormous storm can cause a huge damage all at once, but they do not happen often. The most harmful with respect to population health and economic consequences events may have less damage in a single event, but have large cummulative effect.
damage <- aggregate(cbind(COST, FATALITIES, INJURIES)~EVTYPE2
, data=data2, sum, na.rm=TRUE)
top.cost <- damage[with(damage, order(-COST)), ]
top.fatalities <- damage[with(damage, order(-FATALITIES)), ]
top.injuries <- damage[with(damage, order(-INJURIES)), ]
Let’s look at the resulting data.
head(top.cost, 10)
## EVTYPE2 COST FATALITIES INJURIES
## 13 Flood 179.700714 1522 8601
## 23 Hurricane (Typhoon) 90.872528 135 1331
## 37 Tornado 58.959394 5658 91364
## 34 Storm Surge/Tide 47.975824 24 43
## 17 Hail 19.021448 15 1371
## 8 Drought 15.025420 32 33
## 36 Thunderstorm Wind 12.248525 731 9545
## 24 Ice Storm 8.967641 89 1992
## 43 Wildfire 8.904910 90 1608
## 39 Tropical Storm 8.409287 66 383
head(top.fatalities, 10)
## EVTYPE2 COST FATALITIES INJURIES
## 37 Tornado 58.9593940 5658 91364
## 18 Heat 0.9247950 3138 9154
## 13 Flood 179.7007140 1522 8601
## 27 Lightning 0.9458245 817 5231
## 36 Thunderstorm Wind 12.2485246 731 9545
## 31 Rip Current 0.0001630 577 529
## 22 High Wind 6.6918249 295 1507
## 11 Extreme Cold/Wind Chill 1.4254084 286 255
## 1 Avalanche 0.0037218 225 170
## 44 Winter Storm 6.7824413 217 1353
head(top.injuries, 10)
## EVTYPE2 COST FATALITIES INJURIES
## 37 Tornado 58.9593940 5658 91364
## 36 Thunderstorm Wind 12.2485246 731 9545
## 18 Heat 0.9247950 3138 9154
## 13 Flood 179.7007140 1522 8601
## 27 Lightning 0.9458245 817 5231
## 24 Ice Storm 8.9676414 89 1992
## 43 Wildfire 8.9049101 90 1608
## 22 High Wind 6.6918249 295 1507
## 17 Hail 19.0214482 15 1371
## 44 Winter Storm 6.7824413 217 1353
We can see that severe weather events, such as floods, hurricanes, and tornadoes produce the largest economical damage, reaching several billion dollars in total.
with(head(top.cost, 10), {
par(mar=c(10,4,2,2))
barplot(COST, names.arg = EVTYPE2, las = 2
, main = "Cummulative Damage Cost"
, ylab = "Damage cost (billion $)")
})
We can see that in addition to the severe weather events, such as floods and tornadoes, a significan ammount of human fatalities also happens during heat and many deaths are caused with lightning strikes.
with(head(top.fatalities, 10), {
par(mar=c(12,4,2,2))
barplot(FATALITIES, names.arg = EVTYPE2, las = 2
, main = "Cummulative Fatalities"
, ylab = "Fatalities")
})