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.
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.
In this project, we focus on the effects of the severe weather events on population health in terms of fatalities and injuires. We will also study property and crop damages per severe weather event. In both study, we will find out top 5 severe weather events that cause the most damages.
The data for this assignment come in the form of a comma-separated-value file compressed via the bzip2 algorithm to reduce its size. You can download the file from the course web site:
Storm Data [47Mb]
There is also some documentation of the database available. Here you will find how some of the variables are constructed/defined.
National Weather Service Storm Data Documentation
National Climatic Data Center Storm Events FAQ
The events in the database start in the year 1950 and end in November 2011. In the earlier years of the database there are generally fewer events recorded, most likely due to a lack of good records. More recent years should be considered more complete.
Raw data is read in with read.csv. Please note that no decompressing is needed. Then we take only relevant columns.
Since the property and crop damages are expressed in exponential format, and the exponential uses numbers and symbols like “K”,“M”,“B”, we first convert the symbol based exponential to values. Unknown exponential symbols “”,“-”,“?” are foreced to 0.
#read raw data
storm <- read.csv("repdata-data-StormData.csv.bz2")
#take only relevant columns
data <- storm[c("EVTYPE", "FATALITIES", "INJURIES", "PROPDMG","PROPDMGEXP","CROPDMG","CROPDMGEXP")]
#convert symbols of PROPDMGEXP, CROPDMGEXP to numbers.
summary(data$PROPDMGEXP)
## - ? + 0 1 2 3 4 5
## 465934 1 8 5 216 25 13 4 4 28
## 6 7 8 B h H K m M
## 4 5 1 40 1 6 424665 7 11330
data$PROPDMGEXP_value <- 1 #default for all, particularly for "","-","+"
data$PROPDMGEXP_value [data$PROPDMGEXP == "K" | data$PROPDMGEXP == "k"] <- 10^3
data$PROPDMGEXP_value [data$PROPDMGEXP == "M" | data$PROPDMGEXP == "m"] <- 10^6
data$PROPDMGEXP_value [data$PROPDMGEXP == "B" | data$PROPDMGEXP == "b"] <- 10^9
indx <- which(data$PROPDMGEXP %in% c(0:9))
data$PROPDMGEXP_value[indx] <- 10^as.numeric(data$PROPDMGEXP[indx])
data$pdmg <- data$PROPDMG * data$PROPDMGEXP_value
summary(data$CROPDMGEXP)
## ? 0 2 B k K m M
## 618413 7 19 1 9 21 281832 1 1994
data$CROPDMGEXP_value <- 1 #default for all, particularly for "","-","+"
data$CROPDMGEXP_value [data$CROPDMGEXP == "K" | data$CROPDMGEXP == "k"] <- 10^3
data$CROPDMGEXP_value [data$CROPDMGEXP == "M" | data$CROPDMGEXP == "m"] <- 10^6
data$CROPDMGEXP_value [data$CROPDMGEXP == "B" | data$CROPDMGEXP == "b"] <- 10^9
indx <- which(data$CROPDMGEXP %in% c(0:9))
data$CROPDMGEXP_value[indx] <- 10^as.numeric(data$CROPDMGEXP[indx])
data$cdmg <- data$CROPDMG * data$CROPDMGEXP_value
#add up property and crop damages
data$dmg <- data$pdmg+data$cdmg
In this study, we look at four effects - fatality, injury, property damage, and crop damage per severe weather event. This can be easily done by using the function aggregate. After that top 5 severe weather events are found for every damage.
#sum up effects on population health and property/crop damage
fatal <- aggregate(FATALITIES ~ EVTYPE, data, sum)
injury <- aggregate(INJURIES ~ EVTYPE, data, sum)
propdmg <- aggregate(pdmg ~ EVTYPE, data, sum)
cropdmg <- aggregate(cdmg ~ EVTYPE, data, sum)
totaldmg <- aggregate(dmg ~ EVTYPE, data, sum)
# Listing events with highest fatalities
fatal10 <- fatal[order(-fatal$FATALITIES), ][1:10, ]
# Listing events with highest injuries
injury10 <- injury[order(-injury$INJURIES), ][1:10, ]
# Listing events with highest property damage
propdmg10 <- propdmg[order(-propdmg$pdmg), ][1:10, ]
head(propdmg10)
## EVTYPE pdmg
## 153 FLASH FLOOD 6.820237e+13
## 786 THUNDERSTORM WINDS 2.086532e+13
## 834 TORNADO 1.078951e+12
## 244 HAIL 3.157558e+11
## 464 LIGHTNING 1.729433e+11
## 170 FLOOD 1.446577e+11
# Listing events with highest crop damage
cropdmg10 <- cropdmg[order(-cropdmg$cdmg), ][1:10, ]
head(cropdmg10)
## EVTYPE cdmg
## 95 DROUGHT 13972566000
## 170 FLOOD 5661968450
## 590 RIVER FLOOD 5029459000
## 427 ICE STORM 5022113500
## 244 HAIL 3025974453
## 402 HURRICANE 2741910000
totaldmg10 <- totaldmg[order(-totaldmg$dmg), ][1:10, ]
head(totaldmg10)
## EVTYPE dmg
## 153 FLASH FLOOD 6.820379e+13
## 786 THUNDERSTORM WINDS 2.086551e+13
## 834 TORNADO 1.079366e+12
## 244 HAIL 3.187818e+11
## 464 LIGHTNING 1.729554e+11
## 170 FLOOD 1.503197e+11
A plot is more than a thousands words. The top 10 severe weather conditions and their numerical damages in all four effects are ploted with bar plot.
par(mfrow = c(1, 2), mar = c(12, 4, 3, 2), mgp = c(3, 1, 0), cex = 0.8)
barplot(fatal10$FATALITIES, las = 3, names.arg = fatal10$EVTYPE, main = "Worst Fatalities Events",
ylab = "Number of Fatalities", col = "dark blue")
barplot(injury10$INJURIES, las = 3, names.arg = injury10$EVTYPE, main = "Worst Injuries Events",
ylab = "Number of Injuries", col = "dark blue")
#par(mfrow = c(1, 2), mar = c(12, 4, 3, 2), mgp = c(3, 1, 0), cex = 0.8)
#barplot(propdmg5$pdmg/(10^9), las = 3, names.arg = propdmg5$EVTYPE, main = "Worst Property Damages Events",
# ylab = "Damage Cost ($ billions)", col = "dark blue")
#barplot(cropdmg5$cdmg/(10^9), las = 3, names.arg = cropdmg5$EVTYPE, main = "Worst Crop Damages Events",
# ylab = "Damage Cost ($ billions)", col = "dark blue")
par(mfrow = c(1, 1), mar = c(12, 4, 3, 2), mgp = c(3, 1, 0), cex = 0.8)
barplot(totaldmg10$dmg/(10^9), las = 3, names.arg = totaldmg10$EVTYPE, main = "Worst Total Damages Events",
ylab = "Damage Cost ($ billions)", col = "dark blue")
From the plot, we can easily see that - Tornado, excessive heat, flash flood, heat, lighting caused the most falalities. Particularly, the tornado is a lot harmful than others.
- Tornado, TSTM wind, flood, excessive heat lighting caused the most injuried. The tornado caused hundreds of time more damages than other events.
- Flash flood, thunderstorm winds, tornado, hail, lighting caused most property damages. The first two types dominate others.
- Drought, flood, river flood, icestorm, hail caused most crop damages. The drought caused 2-4 times more damages than other types.
- The property damages are hundreds time worse than the crop damages.