Extreme weather events have brought significant damage to society in recent years. An interesting question for public policy is determining which extreme weather event causes the greatest destruction.
In this comparative analysis, floods were found to bring the most significant economic disruption, with more than 150 billions US dollars of property damage. Tornadoes were found to cause the most number of deaths and injuries, with almost 97,000 injuries or fatalities in recent years.
# Load the data
stormData_raw <-read.csv("./data/repData-data-stormData.csv",header = TRUE, sep = ",");
# Remove unnecessary columns
good_columns <- c("EVTYPE", # Event type
"FATALITIES", "INJURIES", # Deaths & Injuries
"PROPDMG", "PROPDMGEXP", # Property damage & its exponential
"CROPDMG", "CROPDMGEXP") # Crop damage & its exponential
stormData <- stormData_raw[,good_columns]
summary(stormData)
## EVTYPE FATALITIES INJURIES
## HAIL :288661 Min. : 0.0000 Min. : 0.0000
## TSTM WIND :219940 1st Qu.: 0.0000 1st Qu.: 0.0000
## THUNDERSTORM WIND: 82563 Median : 0.0000 Median : 0.0000
## TORNADO : 60652 Mean : 0.0168 Mean : 0.1557
## FLASH FLOOD : 54277 3rd Qu.: 0.0000 3rd Qu.: 0.0000
## FLOOD : 25326 Max. :583.0000 Max. :1700.0000
## (Other) :170878
## PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP
## Min. : 0.00 :465934 Min. : 0.000 :618413
## 1st Qu.: 0.00 K :424665 1st Qu.: 0.000 K :281832
## Median : 0.00 M : 11330 Median : 0.000 M : 1994
## Mean : 12.06 0 : 216 Mean : 1.527 k : 21
## 3rd Qu.: 0.50 B : 40 3rd Qu.: 0.000 0 : 19
## Max. :5000.00 5 : 28 Max. :990.000 B : 9
## (Other): 84 (Other): 9
# remove the raw data to save memory
remove(stormData_raw)
# Calculate the total damage
levels(stormData$PROPDMGEXP) <- c(
"1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1",
"1000000000", "1", "1", "1000", "1000000", "1000000")
levels(stormData$CROPDMGEXP) <- c(
"1", "1", "1", "1", "1000000000", "1000",
"1000", "1000000", "1000000")
stormData$PROPDMG <- stormData$PROPDMG *
as.integer(as.character(stormData$PROPDMGEXP))
stormData$CROPDMG <- stormData$CROPDMG *
as.integer(as.character(stormData$CROPDMGEXP))
stormData$DAMAGE <- stormData$PROPDMG + stormData$CROPDMG
# Calculate total health impact as sum of injuries & fatalities
stormData$HEALTH <- stormData$INJURIES + stormData$FATALITIES
Across the United States, which types of extreme weather events (as indicated in the EVTYPE variable) are the most perjudicial to public health?
total <- sort(
tapply(stormData$HEALTH, stormData$EVTYPE, sum),
decreasing = T)
barplot(head(total,3),
main="Most perjudicial events",
xlab="Event type",
ylab="Total fatalities and injuries")
max(total)
## [1] 96979
The figure shows that tornadoes cause the highest number of injuries and fatalities with a total of 96,980 fatalities and injuries, significantly more than any other type of extreme weather events.
total <- sort(
tapply(stormData$DAMAGE, stormData$EVTYPE, sum),
decreasing = T)
barplot(head(total,3),
main="Cost of the most damaging extreme weather events",
xlab="Event type",
ylab="Total damage")
max(total)
## [1] 150319678257
The figure shows that floods cause the most significant economic damage (around 150 billions US dollars), much higher than any other extreme weather events.