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.
require(dplyr)
require(ggplot2)
require(gridExtra)
require(grid)
This study uses the Storm data. The first step is therefore to download this dataset and load it into R.
if (!exists("storm_data.csv")) {
url <- "https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(url, "storm_data.csv")
}
data <- read.csv("storm_data.csv")
No further preprocessing is required.
To answer this, we group the storm events by type of event and sort them by decreasing number of fatalities and injured people.
healthEventTypeEffect <- data %>%
group_by(EVTYPE) %>%
summarize(numFatalities = sum(FATALITIES, na.rm = TRUE), numInjuries = sum(INJURIES, na.rm = TRUE)) %>%
mutate(isBadEventFatalities = numFatalities > quantile(numFatalities, probs = 0.995),
isWorstEventFatalities = numFatalities == max(numFatalities),
isBadEventInjuries = numInjuries > quantile(numInjuries, probs = 0.995),
isWorstEventInjuries = numInjuries == max(numInjuries)) %>%
filter(isBadEventFatalities == TRUE | isBadEventInjuries == TRUE)
The storm event types which have the 5% largest number of cases can then be ploted and the worst event type is highlighted on light blue.
p1 <- ggplot(data = healthEventTypeEffect, aes(x = reorder(EVTYPE, -numFatalities),
y = numFatalities,
colour = isWorstEventFatalities,
fill = isWorstEventFatalities)) +
geom_col(alpha = 0.1) +
labs(title = "Worst storm event types in terms of fatalities", x = "Event type", y = "Number of fatalities") +
theme(legend.position = "none")
p2 <- ggplot(data = healthEventTypeEffect, aes(x = reorder(EVTYPE, -numInjuries),
y = numInjuries,
colour = isWorstEventInjuries,
fill = isWorstEventInjuries)) +
geom_col(alpha = 0.1) +
labs(title = "Worst storm event types in terms of injuries", x = "Event type", y = "Number of injuries") +
theme(legend.position = "none")
grid.arrange(p1,p2)
In both cases, tornados are the most harmful.
To answer this, we group the storm events by type of event and sort them by decreasing amount of damage on crops and properties separately. The processing is very similar to the one assessing the impact of health shown above.
economyEventTypeEffect <- data %>%
group_by(EVTYPE) %>%
summarize(cropDamages = sum(CROPDMG, na.rm = TRUE), propDamages = sum(PROPDMG, na.rm = TRUE)) %>%
mutate(isBadEventCrop = cropDamages > quantile(cropDamages, probs = 0.995),
isWorstEventCrop = cropDamages == max(cropDamages),
isBadEventProp = propDamages > quantile(propDamages, probs = 0.995),
isWorstEventProp = propDamages == max(propDamages)) %>%
filter(isBadEventCrop == TRUE | isBadEventProp == TRUE)
The storm event types which have the 5% largest amount of damage can then be ploted and the worst event type is highlighted on light blue.
p3 <- ggplot(data = economyEventTypeEffect, aes(x = reorder(EVTYPE, -cropDamages),
y = cropDamages,
colour = isWorstEventCrop,
fill = isWorstEventCrop)) +
geom_col(alpha = 0.1) +
labs(title = "Worst storm event types in terms of crop damage", x = "Event type", y = "Damage cost (USD)") +
theme(legend.position = "none")
p4 <- ggplot(data = economyEventTypeEffect, aes(x = reorder(EVTYPE, -propDamages),
y = propDamages,
colour = isWorstEventProp,
fill = isWorstEventProp)) +
geom_col(alpha = 0.1) +
labs(title = "Worst storm event types in terms of property damage", x = "Event type", y = "Damage cost (USD)") +
theme(legend.position = "none")
grid.arrange(p3,p4)
Here we see that hail is the storm type that causes the most damage to crops but tornado is the one impacting properties the most. However, by looking at the scale of the plots, we see that damages on properties cost about an order of magnitude more than damages on crops. Tornado is therefore the most harmful storm type in terms of economic costs.