We analyse here the how the the economic and human population impacts vary based on different type of storm event. The analysis will use mean crop and property damage to assess the economic impact of an event while using mean number of fatalities to assess the population impact of an event. It is intended that such analysis would inform relevant stakeholders about their response to storm events.
The analysis will make use of the following R libraries.
library(dplyr)
##
## 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
The following will download historical storm data and pre-process it. The approach will then be to match entries which correspond to the official list of event classifications. Events with descriptions that do not match will be disregarded as there is a sufficiently large number of remaining events in order to be confident that estimates of mean damage and fatalities for each event type will still be meaningful. The mean damage and fatalities for each event type will be computed and the highest impact events will be filtered out for plotting purposes.
# download and read file
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2","stormdata.csv.bz2")
data <-read.csv("stormdata.csv.bz2")
# Convert property damage into a value in thousands of dollars
data <-mutate(data,PropertyDamage = PROPDMG*ifelse(tolower(PROPDMGEXP)=="h",0.1,ifelse(tolower(PROPDMGEXP)=="k",1,ifelse(tolower(PROPDMGEXP)=="m",1000,ifelse(tolower(PROPDMGEXP)=="b",1000000,0)))))
# Convert crop damage into a value in thousands of dollars
data <-mutate(data,CropDamage = CROPDMG*ifelse(tolower(CROPDMGEXP)=="h",0.1,ifelse(tolower(CROPDMGEXP)=="k",1,ifelse(tolower(CROPDMGEXP)=="m",1000,ifelse(tolower(CROPDMGEXP)=="b",1000000,0)))))
# Compute total damage
data <- mutate(data,TotalDamage =
CropDamage + PropertyDamage)
# Create a lookup table to clean up events
table = c(
"Astronomical Low Tide",
"Avalanche",
"Blizzard",
"Coastal Flood",
"Cold/Wind Chill",
"Debris Flow",
"Dense Fog",
"Dense Smoke",
"Drought",
"Dust Devil",
"Dust Storm",
"Excessive Heat",
"Extreme Cold/Wind Chill",
"Flash Flood",
"Flood",
"Frost/Freeze",
"Funnel Cloud",
"Freezing Fog",
"Hail",
"Heat",
"Heavy Rain",
"Heavy Snow",
"High Surf",
"High Wind",
"Hurricane (Typhoon)",
"Ice Storm",
"Lake-Effect Snow",
"Lakeshore Flood",
"Lightning",
"Marine Hail",
"Marine High Wind",
"Marine Strong Wind",
"Marine Thunderstorm Wind",
"Rip Current",
"Seiche",
"Sleet",
"Storm Surge/Tide",
"Strong Wind",
"Thunderstorm Wind",
"Tornado",
"Tropical Depression",
"Tropical Storm",
"Tsunami",
"Volcanic Ash",
"Waterspout",
"Wildfire",
"Winter Storm",
"Winter Weather"
)
# Event types that do not match the above will be excluded from the analysis
data<-mutate(data, EventType = table[match(tolower(as.character(EVTYPE)),tolower(table))])
data <-data[!is.na(data$EventType),]
# Group by Event Type and Compute Mean Damage, Injuries and Fatalities for each Event Type
byevent <- group_by(data,EventType)
eventsummary <- summarise(byevent,TotalDmg = mean(TotalDamage),CropDmg = mean(CropDamage),PropDmg = mean(PropertyDamage),injuries = mean(INJURIES), fatalities = mean(FATALITIES))
# Create Table of Top Damage Events (Defined as mean damage more than $2m)
topdamage <- arrange(eventsummary[eventsummary$TotalDmg>2000,],-TotalDmg)
# Create Table of Top Fatality Events (Defined as mean deaths more than 0.2)
topdeaths <- arrange(eventsummary[eventsummary$fatalities>0.2,],-fatalities)
The below chart shows mean damage done for event types which have mean damage of more than $2 million:
barplot(t(as.matrix(select(topdamage,CropDmg,PropDmg))),
main="Event Types with Mean Damage more than $2m",
xlab = "Event Type",
ylab = "Mean Damage (thousands of $)",
legend = c("Crop Damage","Property Damage"),
col = c("blue","red"),
names.arg = topdamage$EventType,
cex.names = 0.8)
Damage, in particular damage to property, is highest, by a very significant margin, on average for Storm Surge events.
The below chart shows mean fatalities and injuries for event types which have mean fatalities of more than 0.2:
barplot(t(as.matrix(select(topdeaths,fatalities,injuries))),
main="Event Types with Mean Fatalities more than 0.2",
xlab = "Event Type",
ylab = "mean frequency",
legend = c("fatalities","injuries"),
col = c("orange","yellow"),
names.arg = topdeaths$EventType,
cex.names = 0.8,
beside = TRUE)
Tsunamis and heat related events produce the greatest number of injuries and fatalities on average.