Consequences of climatic events in the United States

1. Synopsis

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 economic damages. 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. We analyzed the consequences of weather to population health (fatalities/injuries) and to economy (property damages, crop damages, and total cost damages). The top 5 weather events most frequently related to fatalities/injuries as well as the top 5 weather events related to the greatest economic consequences were demonstrated through tables and barplots. We conclude that tornado is the most dangerous to the society regarding to population health. Floods are the resposible for the highest total and property damages, while droughts are responsible for the highest crop damages.

2. Data Processing

2.1. Data Source

Analysis were carried out using R version 4.0.0 (2020-04-24), with the following attached packages:

  • dplyr_1.0.0
  • ggplot2_3.3.1
  • knitr_1.28

Data was obtained from the Coursera website and downloaded through the link Storm Data. The data for this assignment come in the form of a comma-separated-value file compressed via the bzip2 algorithm to reduce its size. The commands download.file() and read.csv were used for this.

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

fileUrl<-"https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(fileUrl,destfile = "./week4.csv",method = "curl")
file1<-read.csv("week4.csv",header = T,stringsAsFactors = F)

2.2 Assignment questions

    1. Across the United States, which types of events (as indicated in EVTYPE variable) are most harmful with respect to population health?
    1. Across the United States, which types of events have the greatest economic consequences?

2.3. Data transformation

a) Harmful events to population health

To answer the first question, we analyzed the total number of injuries and fatalities per different weather event. Then, we listed the top 5 most harmful weather events (injuries and fatalities separetely). We used the commands aggregate() and arrange().

#Injuries data
harmInj<-aggregate(file1$INJURIES,by=list(file1$EVTYPE),FUN=sum)
harmInj<-arrange(harmInj,desc(harmInj$x))
harmInj5<-harmInj[1:5,]
colnames(harmInj5)<-c("Event","total of injuries")
#Fatalities data
harmFatal<-aggregate(file1$FATALITIES,by=list(file1$EVTYPE),FUN=sum)
harmFatal<-arrange(harmFatal,desc(harmFatal$x))
harmFatal5<-harmFatal[1:5,]
colnames(harmFatal5)<-c("Event","total of injuries")

b) Economic consequences

To address the second question, we assessed property damages followed by crop damages. Then we calculated the total damages (which was property damages + crop damages).

Property damages exponents for each level was listed out and assigned those values for the property exponent data. Invalid data was excluded by assigning the value as “0”. Then, property damage value was calculated by multiplying the property damage (PROPDMG) and property damage exponent value (PROPDMGEXP).

unique(file1$PROPDMGEXP)
##  [1] "K" "M" ""  "B" "m" "+" "0" "5" "6" "?" "4" "2" "3" "h" "7" "H" "-" "1" "8"

As some have lower character, we converted them to upper character. In addition, we replaced symbols other than character of numeric values to 0 (zero).

file1$PROPDMGEXP<-toupper(file1$PROPDMGEXP)
file1$PROPDMGEXP[file1$PROPDMGEXP%in%c("","+","-","?")]="0"

As PROPDMGEXP stands for the power of 10, we converted ‘B’ standing for billions to 9, ‘M’ standing for millions to 6, ‘K’ standing for thousand to 3, and ‘H’ for hundreds to 2.

file1$PROPDMGEXP[file1$PROPDMGEXP%in%c("B")]="9"
file1$PROPDMGEXP[file1$PROPDMGEXP%in%c("M")]="6"
file1$PROPDMGEXP[file1$PROPDMGEXP%in%c("K")]="3"
file1$PROPDMGEXP[file1$PROPDMGEXP%in%c("H")]="2"

Finally, to get the total property damage number, we multiplied the number listed in the PROPDMG with the corresponding exponent.

file1$PROPDMGEXP<-10^(as.numeric(file1$PROPDMGEXP))
file1<-file1%>%mutate(propdmg=PROPDMGEXP*PROPDMG)

As we did with injuries and fatalities, we calculated the total of property damage per different weather event using aggregate() and arrange() commands.

P_damage<-aggregate(file1$propdmg,by=list(file1$EVTYPE),FUN=sum)
P_damage<-arrange(P_damage,desc(P_damage$x))
P_damage<-P_damage[1:5,]  
P_damage$x<-round(P_damage$x/1000000000,digits = 2)
colnames(P_damage)<-c("Event","Damage in $ billions")

Similarly, we performed the same operations (assignment exponential values, replacement of symbols other than numbers with “0”, multiplication of CROPMG with the corresponding exponential value to obtain final total crop damage) with the variables CROPDMG and CROPDMGEXP.

unique(file1$CROPDMGEXP)
## [1] ""  "M" "K" "m" "B" "?" "0" "k" "2"
#Convert exponents
file1$CROPDMGEXP<-toupper(file1$CROPDMGEXP)
file1$CROPDMGEXP[file1$CROPDMGEXP%in%c("","?","0")]="0"
file1$CROPDMGEXP[file1$CROPDMGEXP%in%c("B")]="9"
file1$CROPDMGEXP[file1$CROPDMGEXP%in%c("M")]="6"
file1$CROPDMGEXP[file1$CROPDMGEXP%in%c("K")]="3"
file1$CROPDMGEXP[file1$CROPDMGEXP%in%c("H","2")]="2"
#Multiplication of CROPDMG with the corresponding exponent
file1$CROPDMGEXP<-10^(as.numeric(file1$CROPDMGEXP))
file1<-file1%>%mutate(cropdmg=CROPDMGEXP*CROPDMG)

As above variables, we examined the total crop damage per weather event using the command aggregate() and arrange().

C_damage<-aggregate(file1$cropdmg,by=list(file1$EVTYPE),FUN=sum)
C_damage<-arrange(C_damage,desc(C_damage$x))
C_damage<-C_damage[1:5,] 
C_damage$x<-round(C_damage$x/1000000000,digits = 2)
colnames(C_damage)<-c("Event","Damage in $ billions")

The total damage (property + crop damage) as well as total damage per different weather event were obtained.

#Total damage (property + crop)
file1<-file1%>%mutate(total_damage=propdmg+cropdmg)
#Total damage per weather event
file1<-file1%>%mutate(total_damage=propdmg+cropdmg)
T_damage<-aggregate(file1$total_damage,by=list(file1$EVTYPE),FUN=sum)
T_damage<-arrange(T_damage,desc(T_damage$x))
T_damage<-T_damage[1:5,] 
T_damage$x<-round(T_damage$x/1000000000,digits = 2)
colnames(T_damage)<-c("Event","Damage in $ billions")

3. Results

3.1 Population health

Across the United States, the events which are most harmful to population health regarding to injuries are summarized in the Table 1:

kable(harmInj5,caption = "Table 1")
Table 1
Event total of injuries
TORNADO 91346
TSTM WIND 6957
FLOOD 6789
EXCESSIVE HEAT 6525
LIGHTNING 5230

Figure 1 highlights these findings:

barplot(height = harmInj5$`total of injuries`,names.arg = harmInj5$Event,width = 3,cex.names = .7,main = "Figure 1: injuries by weather event",xlab = "Event",ylab = "Number of injuries")

Tornado represents markedly the most harmful weather event related to injuries.

In concerning to fatalites, we have the following findings summarized in the Table 2:

kable(harmFatal5,caption = "Table 2")
Table 2
Event total of injuries
TORNADO 5633
EXCESSIVE HEAT 1903
FLASH FLOOD 978
HEAT 937
LIGHTNING 816

Figure 2 highlights these findings:

barplot(height = harmFatal5$`total of injuries`,names.arg = harmFatal5$Event,width = 3,cex.names = .7,main = "Figure 2: fatalities by weather event",xlab = "Event",ylab = "Number of fatalities")

Similar to injury-related weather events, tornado is also the most harmful to population health reagarding to fatality, with 5633 cases.

3.2 Economic consequences

The climatic events which caused more costly property damages are demonstrated in the table below:

kable(P_damage,caption = "Table 3")
Table 3
Event Damage in $ billions
FLOOD 144.66
HURRICANE/TYPHOON 69.31
TORNADO 56.95
STORM SURGE 43.32
FLASH FLOOD 16.82

The climatic events which caused more costly crop damages are demonstrated in the table below:

kable(C_damage,caption = "Table 4")
Table 4
Event Damage in $ billions
DROUGHT 13.97
FLOOD 5.66
RIVER FLOOD 5.03
ICE STORM 5.02
HAIL 3.03

The total damage cost per weather event is listed in the Table 5:

kable(T_damage,caption = "Table 5")
Table 5
Event Damage in $ billions
FLOOD 150.32
HURRICANE/TYPHOON 71.91
TORNADO 57.36
STORM SURGE 43.32
HAIL 18.76

Damages caused by floods were most costly for properties, while droughts caused more expensive damages for crops. Overall the the greasted economic impact was caused by floods, with about 150 billions of dollars. These findings are highlighted in the figures below:

par(mfrow=c(1,3),mar=c(9,4,2,3))
barplot(height = P_damage$`Damage in $ billions`,names.arg = P_damage$Event,width = 3,cex.names = .7,cex.lab=.7,cex.main=.9,main = "Highest property damages",ylab = "Damage cost ($ billions)",col="darkblue",las=3)
barplot(height = C_damage$`Damage in $ billions`,names.arg = C_damage$Event,width = 3,cex.names = .7,cex.lab=.7,cex.main=.9,main = "Highest crop damages",ylab ="Damage cost ($ billions)",col="darkgreen",las=3)
barplot(height = T_damage$`Damage in $ billions`,names.arg = T_damage$Event,width = 3,cex.names = .7,cex.lab=.7,cex.main=.9,main = "Highest total cost damages",ylab = "Damage cost ($ billions)",col="red",las=3)

4. Conclusion

Tornados caused the highest number of injuries and fatalities. Floods were resposible for the most costly damages for properties and for the total damages, while droughts caused the greatest economic damages for crops.