Graphical analysis of Economic & Health Damage causes by Storms in US during 1950-2011

Andrés Gordo Ortiz

Abstract

This study is aimed to present and clarify the main ten economical and health related consequences of Storms in the United States, provided the data for each of these atmospheric events from 1950 to 2011. Raw data can be accessed from the code, or from this link. Two plots were made for health damage, for fatalities and injuries respectively, and only one combined plot for economic damage. The reason being, It is sensible to combine the economic causes as everything is calculated in USD. Fatalities and Injuries are, however, not comparable.

Data Processing

First of all the libraries needed are loaded and the data downloaded.

Key variables used are:

  • EVTYPE : Type of the event

  • FATALITIES : Number of fatalities from the event

  • INJURIES : Number of injuries from the event

  • PROPDMG : Property damage measured

  • CROPDMG : Crop damage measured

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
library(ggplot2)

data_url<-"https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
if (!file.exists("repdata_data_StormData.csv.bz2")){
        download.file(data_url, "repdata_data_StormData.csv.bz2")
}
stormdata<-read.csv("repdata_data_StormData.csv.bz2") #We call the raw data as stormdata

Results

Let´s see how many causes have been classified:

cat("There are",length(unique(stormdata$EVTYPE)),"types of Storm related consequences")
## There are 985 types of Storm related consequences

Fatality Analysis

Now we will perform the same analysis on the two health related causes. Using the dplyr package to group and summarise the new datasets:

fatal<-stormdata%>%
        group_by(EVTYPE)%>% 
        summarise(Total_fatalities=sum(FATALITIES))%>% #The sum of events to tell which is maximum
        arrange(desc(Total_fatalities))

Let´s see which is the first cause out of the many:

first_cause_fatal<-fatal$EVTYPE[which.max(fatal$Total_fatalities)]
cat("The first cause for Fatality damage is", first_cause_fatal, "during 1950-2011")
## The first cause for Fatality damage is TORNADO during 1950-2011

And finally we plot the dataset arranged and sorted by the first ten causes:

f<-ggplot(fatal[1:10,], aes(reorder(EVTYPE, -Total_fatalities,decreasing=TRUE), Total_fatalities, fill=log(Total_fatalities)))
f2<-f+geom_col()+coord_flip()
f3<-f2+ylab("Number of Fatalities")+xlab(NULL)+ggtitle("Top Ten Fatality causes by Storms during 1950-2011")
f3+theme(legend.position = "none")

It seems Tornados are the main cause of Fatality Damage, as we saw previously.

Injury Analysis

Now, we repeat the same process for Injury Damage:

injury<-stormdata%>%
        group_by(EVTYPE)%>%
        summarise(Total_injuries=sum(INJURIES))%>%
        arrange(desc(Total_injuries))
first_cause_injury<-fatal$EVTYPE[which.max(fatal$Total_fatalities)]
cat("Again, the first cause for Injury damage is", first_cause_injury, "during 1950-2011")
## Again, the first cause for Injury damage is TORNADO during 1950-2011

When we plot the arranged dataset we find similar conclusions:

i<-ggplot(injury[1:10,], aes(reorder(EVTYPE, -Total_injuries, decreasing=TRUE), Total_injuries, fill=log(Total_injuries)))
i2<-i +geom_col()+coord_flip()+theme(legend.position = "none")
i2+ylab("Number of Injuries")+xlab(NULL)+ggtitle("Top Ten Injury causes by Storms during 1950-2011")

Even though some causes have changed, Tornados are still the undoubtedly most frequent cause for both Fatality and Injury. Just for fun let´s see which causes are in the top ten of both kinds of health damage:

intersect(fatal[1:5, 1], injury[1:5, 1])
## # A tibble: 3 × 1
##   EVTYPE        
##   <chr>         
## 1 TORNADO       
## 2 EXCESSIVE HEAT
## 3 LIGHTNING

Economic Damage

In this case the approach is slightly different, since we will combine Crop Damage & Property damage into one single variable accounting for both damages.

econ<-stormdata%>%
        group_by(EVTYPE)%>%
        summarise(USD=sum(PROPDMG+CROPDMG))%>%
        arrange(desc(USD))
first_cause_economy<-econ$EVTYPE[which.max(econ$USD)]
cat("And, finally, the first cause of economic damage by Storms is", first_cause_economy)
## And, finally, the first cause of economic damage by Storms is TORNADO

Now, we plot the newly arranged combined dataset:

e<-ggplot(econ[1:10,], aes(reorder(EVTYPE, -USD, decreasing=TRUE), USD, fill=log(USD)))
e2<-e +geom_col()+coord_flip()+theme(legend.position = "none")
e2+ylab("Total damage in USD")+xlab(NULL)+ggtitle("Top Ten Economic damage causes by Storms during 1950-2011")

Indeed, Tornados seem to be the first cause of any damage analysed so far.