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 document is a very preliminary study on the consequences of storms and other extreme natural events that shows the devastating effects, both on population health and on economy, that these events have.
The research conducted is completely reproducible because the data and the code are provided to the scientific community.
The data for the analysis can be downloaded from here.
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.5.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(RColorBrewer)
# Disable scientific notation
options(scipen = 999)
# Data file name
datafilename <- "./repdata_data_StormData.csv.bz2"
datafileurl <- "https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
# 1. Read dataset
if(!file.exists(datafilename)) {
download.file(url=datafileurl, destfile = datafilename)
}
df <- read.csv(datafilename)
# Converts values in the PROPEXP and CROPEXP columns into the corresponding power of 10.
# This indicates the multiplier of the values of the PROPDMG and CROPDMG columns.
# Symbols are mapped to values as follows:
# h or H -> 100
# k or K -> 1000
# m or M -> 1000000
# b or B -> 1000000000
# from 1 to 8 -> 10^x
# 0, +, -, ? -> 1
convertExp <- function(x) {
if(x[[1]] == "") 0
else if(x == "h" | x == "H") 100
else if(x == "k" | x == "K") 1000
else if(x == "m" | x == "M") 1000000
else if(x == "b" | x == "B") 1000000000
else if(x == "0") 0
else if(x == "1") 10
else if(x == "2") 100
else if(x == "3") 1000
else if(x == "4") 10000
else if(x == "5") 100000
else if(x == "6") 1000000
else if(x == "7") 10000000
else if(x == "8") 100000000
else 1
}
In the following plot the number of casualties and the number of injuries are taken as a measure of the impact on population health.
par(mfrow=c(2,1), mar=c(2,3,2,1))
pal <- colorRampPalette(brewer.pal(8,"Set2"))
deaths <- df %>% group_by(EVTYPE) %>% summarise(FATALITIES=sum(FATALITIES)) %>% arrange(desc(FATALITIES)) %>% head(8)
barplot(deaths$FATALITIES, names.arg = deaths$EVTYPE, axisnames = T, col = pal(8),
main="Fatalities per event type", xlab="Event type")
pal <- colorRampPalette(brewer.pal(8,"Set1"))
injuries <- df %>% group_by(EVTYPE) %>% summarise(INJURIES=sum(INJURIES)) %>% arrange(desc(INJURIES)) %>% head(8)
barplot(injuries$INJURIES, names.arg = injuries$EVTYPE, axisnames = T, col = pal(8),
main="Injuries per event type", xlab="Event type")
Across the United States, the following events (as indicated in the EVTYPE variable) are most harmful with respect to population health:
head(deaths,8)
## # A tibble: 8 x 2
## EVTYPE FATALITIES
## <fct> <dbl>
## 1 TORNADO 5633
## 2 EXCESSIVE HEAT 1903
## 3 FLASH FLOOD 978
## 4 HEAT 937
## 5 LIGHTNING 816
## 6 TSTM WIND 504
## 7 FLOOD 470
## 8 RIP CURRENT 368
head(injuries,8)
## # A tibble: 8 x 2
## EVTYPE INJURIES
## <fct> <dbl>
## 1 TORNADO 91346
## 2 TSTM WIND 6957
## 3 FLOOD 6789
## 4 EXCESSIVE HEAT 6525
## 5 LIGHTNING 5230
## 6 HEAT 2100
## 7 ICE STORM 1975
## 8 FLASH FLOOD 1777
Across the United States, which types of events have the greatest economic consequences? The economic consequences are calculated as the sum of the property damage and the crop damage.
# Calculate multipliers of the PROPDMG and CROPDMG values
propertyDamageMultipliers <- sapply(df$PROPDMGEXP, FUN = convertExp)
cropDamageMultipliers <- sapply(df$CROPDMGEXP, FUN = convertExp)
# Calculate property and crop damage
propertyDamage <- df$PROPDMG * propertyDamageMultipliers
cropDamage <- df$CROPDMG * cropDamageMultipliers
totalPropertyDamage <- round((sum(propertyDamage))/10^9, 2)
totalCropDamage <- round((sum(cropDamage))/10^9, 2)
totalDamage <- totalPropertyDamage + totalCropDamage
The following table shows the economic damage from 1950 to 2011 in the US.
| Damage | Amount (billions of $) |
|---|---|
| Property | 428.22 |
| Crop | 49.1 |
| Total | 477.32 |
The results suggest that it is advisable to pursue political decisions targeted at
prevention of natural disaster (for instance by fighting climate change)
reduction of the effects on population health and economic loss