Using the National Weather Service storm preparation data (2007), we set out to answer the following questions:
We discovered that tornadoes cause the greatest number of fatalties. On a per-event basis, heat waves caused the highest number of injuries. In terms of economic harm, tornadoes cause the greatest total property damage.
Data were downloaded from the internet, decompressed, and read into a CSV file as shown below.
fileUrl <- "https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
downloadPath <- "./storm.csv.bz2"
download.file(fileUrl,downloadPath,method="curl")
storm <- read.csv(bzfile(downloadPath))
We were interested in considering the health effects, both in terms of injuries on a per-event basis, and fatalities on a total overall basis. Correspondingly, we transformed the data by applying the median or the sum function by event type, and then sorted the most harmful events in descending order.
totalFatalPerEventType <- by(storm$FATALITIES, storm$EVTYPE, function(x) sum(x, na.rm=TRUE))
totalInjPerEventType <- by(storm$INJURIES, storm$EVTYPE, function(x) sum(x, na.rm=TRUE))
totalFatalPerEventTypeSorted <- sort(totalFatalPerEventType, decreasing=TRUE)
medFatalPerEventType <- by(storm$FATALITIES, storm$EVTYPE, function(x) median(x, na.rm=TRUE))
medInjPerEventType <- by(storm$INJURIES, storm$EVTYPE, function(x) median(x, na.rm=TRUE))
medInjPerEventTypeSorted <- sort(medInjPerEventType, decreasing=TRUE)
Below, we see the top 20 most fatal weather events in the United States and the number of fatalities and a bar plot of the top 5.
totalFatalPerEventTypeSorted[1:20]
## storm$EVTYPE
## TORNADO EXCESSIVE HEAT FLASH FLOOD
## 5633 1903 978
## HEAT LIGHTNING TSTM WIND
## 937 816 504
## FLOOD RIP CURRENT HIGH WIND
## 470 368 248
## AVALANCHE WINTER STORM RIP CURRENTS
## 224 206 204
## HEAT WAVE EXTREME COLD THUNDERSTORM WIND
## 172 160 133
## HEAVY SNOW EXTREME COLD/WIND CHILL STRONG WIND
## 127 125 103
## BLIZZARD HIGH SURF
## 101 101
barplot(totalFatalPerEventTypeSorted[1:5], main="Top 5 storm types in total fatalities",cex.names=.5)
Figure 1. Most fatal types of weather events, in total overall deaths.
Below, we see the top 20 most injurious weather events in the United States, i.e. the events that cause the most injuries per event, and a bar plot of the top 5:
medInjPerEventTypeSorted[1:20]
## storm$EVTYPE
## Heat Wave TROPICAL STORM GORDON
## 70.0 43.0
## THUNDERSTORMW HIGH WIND AND SEAS
## 27.0 20.0
## SNOW/HIGH WINDS GLAZE/ICE STORM
## 18.0 15.0
## HEAT WAVE DROUGHT WINTER STORM HIGH WINDS
## 15.0 15.0
## NON-SEVERE WIND DAMAGE TORNADO F2
## 7.0 4.0
## Torrential Rainfall MARINE MISHAP
## 4.0 2.5
## Heavy snow shower ICE STORM/FLASH FLOOD
## 2.0 2.0
## Marine Accident ROGUE WAVE
## 2.0 2.0
## WARM WEATHER DRY MIRCOBURST WINDS
## 2.0 1.0
## FOG AND COLD TEMPERATURES Gusty winds
## 1.0 1.0
barplot(medInjPerEventTypeSorted[1:5], main="Top 5 storm types in median injuries per event",cex.names=.5)
Figure 2. Most injurious types of weather events, in median injuries per event.
Finally, we considered the events that cause the highest total property damage.
totalDmgPerEventType <- by(storm$PROPDMG, storm$EVTYPE, function(x) sum(x, na.rm=TRUE))
totalDmgPerEventTypeSorted <- sort(totalDmgPerEventType, decreasing=TRUE)
totalDmgPerEventTypeSorted[1:20]
## storm$EVTYPE
## TORNADO FLASH FLOOD TSTM WIND
## 3212258.16 1420124.59 1335965.61
## FLOOD THUNDERSTORM WIND HAIL
## 899938.48 876844.17 688693.38
## LIGHTNING THUNDERSTORM WINDS HIGH WIND
## 603351.78 446293.18 324731.56
## WINTER STORM HEAVY SNOW WILDFIRE
## 132720.59 122251.99 84459.34
## ICE STORM STRONG WIND HIGH WINDS
## 66000.67 62993.81 55625.00
## HEAVY RAIN TROPICAL STORM WILD/FOREST FIRE
## 50842.14 48423.68 39344.95
## FLASH FLOODING URBAN/SML STREAM FLD
## 28497.15 26051.94
barplot(totalDmgPerEventTypeSorted[1:5], main="Top 5 storm types in total property damage",cex.names=.5)
Figure 3. Most destructive weather events, in total overall property damage.