#Load required library
library(dplyr)
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. U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database is being used to analyze the impact of Storm and Other Severe Weather toward Population Health and Economic across the United States. Based on resulted analysis, we can conclude that Tornado has the most harmful impact toward US Population Health which are 5,633 Fatalities and 91,346 Injuries. While the most severe economic impact has been caused by Flood, resulted in loss of US$150,320 Million.
Data being used in this analyis is taken from U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. This database tracks characteristics of major storms and weather events in the United States, including when and where they occur, as well as estimates of any fatalities, injuries, and property damage.
Following is the code to load the raw data :
#Load the data from CSV file
StormData <- read.csv(file = "StormData.csv", header = TRUE, na.strings = NA)
To analyze which event that has the most harmfull impact toward US population health, we need to create a summary of Fatalities and Injuires by Event Type from the raw data. To simplify the data presentation, we will consider only top 10 of Fatalities and Injuries from the data summary. All of this data transformation process is accomplished using following code :
#Group and sum fatalities and injuries by Event Type
StormData_byevtype <- StormData %>%
select(EVTYPE, FATALITIES, INJURIES) %>%
group_by(EVTYPE)
StormData_byevtype_sum <- summarise_all(StormData_byevtype, sum)
#Top 10 Fatalities by Event Type
StormData_top10_Fatal <- arrange(StormData_byevtype_sum, desc(FATALITIES))[1:10,1:2]
StormData_top10_Fatal <- arrange(StormData_top10_Fatal, FATALITIES)
#Top 10 Injuries by Event Type
StormData_top10_Injur <- arrange(StormData_byevtype_sum, desc(INJURIES))[1:10,c(1,3)]
StormData_top10_Injur <- arrange(StormData_top10_Injur, INJURIES)
In the raw data, we can find two measurement of economic impact from the storm and other severe weather event, which are Crops Damage and Properties Damage. The measurement of Crop dan Property damages in the raw data is not uniform, it comes in thousands, millions, and billions, depends on the measurement code defined in CROPDMGEXP and PROPDMGEXP column which have the value of : B, M, K. Following data transformation code will make the measurement consistent across all the data, and we also calculate total damage which is the sum of crop damage and property damage :
#Transform Crops Damage and Properties Damage into consistent US Dollar value.
#Total Damage = Crops Damage + Properties Damage
StormData_dmg_byevtype <- StormData %>%
select(EVTYPE, CROPDMG, CROPDMGEXP, PROPDMG, PROPDMGEXP) %>%
mutate(
CROPDMG_CALC = case_when(
CROPDMGEXP == "K" | CROPDMGEXP == "k" ~ CROPDMG * 1000,
CROPDMGEXP == "M" | CROPDMGEXP == "m" ~ CROPDMG * 1000000,
CROPDMGEXP == "B" | CROPDMGEXP == "b" ~ CROPDMG * 1000000000,
TRUE ~ 0
),
PROPDMG_CALC = case_when(
PROPDMGEXP == "K" | PROPDMGEXP == "k" ~ PROPDMG * 1000,
PROPDMGEXP == "M" | PROPDMGEXP == "m" ~ PROPDMG * 1000000,
PROPDMGEXP == "B" | PROPDMGEXP == "b" ~ PROPDMG * 1000000000,
TRUE ~ 0
),
TOT_DMG = CROPDMG_CALC + PROPDMG_CALC
) %>%
select(EVTYPE, CROPDMG_CALC, PROPDMG_CALC, TOT_DMG) %>%
group_by(EVTYPE)
Now we have a consistent measurement of Crops Damage, Properties Damage, and Total Damage in US Dollar. We will summarize those measurments and group the data by Event Type. To simplify the data presentation, we will consider only top 10 of Total Damage from the summary data. All of this data transformation process is accomplished using following code :
#Group and summarized Crops Damage, Properties Damage and Total Damage by Event Type
StormData_dmg_byevtype_sum <- summarise_all(StormData_dmg_byevtype, sum)
#Top 10 Total Damage by Event Type
StormData_top10_TotDmg <-
arrange(StormData_dmg_byevtype_sum, desc(TOT_DMG))[1:10,c(1,4)]
StormData_top10_TotDmg <-
arrange(StormData_top10_TotDmg, TOT_DMG)
Please find following plot to find out which event that has the most harmfull efect toward population health across US states in term of Fatalities and Injuries :
#Plot the data
par(mfrow = c(1, 2), mar = c(5, 4, 2, 1), oma = c(0, 2, 0, 2))
with(StormData_top10_Fatal,
barplot(FATALITIES, names.arg = EVTYPE,
main = "Top 10 Fatalities by Events",
xlab = "Fatalities",
horiz=T, las=1, cex.names=0.5, cex.axis=0.75))
with(StormData_top10_Injur,
barplot(INJURIES, names.arg = EVTYPE,
main = "Top 10 Injuries by Events",
xlab = "Injuries",
horiz=T, las=1, cex.names=0.5, cex.axis=0.75))
From the above figure, we can conclude that Tornado is the natural disaster that has the most harmfull efect toward population health across US states, in term both of Fatalities and Injuries.
#Numerical Summary
StormData_top10_Fatal
## # A tibble: 10 x 2
## EVTYPE FATALITIES
## <fct> <dbl>
## 1 AVALANCHE 224.
## 2 HIGH WIND 248.
## 3 RIP CURRENT 368.
## 4 FLOOD 470.
## 5 TSTM WIND 504.
## 6 LIGHTNING 816.
## 7 HEAT 937.
## 8 FLASH FLOOD 978.
## 9 EXCESSIVE HEAT 1903.
## 10 TORNADO 5633.
StormData_top10_Injur
## # A tibble: 10 x 2
## EVTYPE INJURIES
## <fct> <dbl>
## 1 HAIL 1361.
## 2 THUNDERSTORM WIND 1488.
## 3 FLASH FLOOD 1777.
## 4 ICE STORM 1975.
## 5 HEAT 2100.
## 6 LIGHTNING 5230.
## 7 EXCESSIVE HEAT 6525.
## 8 FLOOD 6789.
## 9 TSTM WIND 6957.
## 10 TORNADO 91346.
Based on above summary table, Tornado has caused total of 5,633 Fatalities and 91,346 Injuries in USA from beginning of 1950 to November 2011.
Please find following plot to find out which event that has the greatest impact toward economy across the United States :
#Plot the data
with(StormData_top10_TotDmg,
barplot(TOT_DMG, names.arg = EVTYPE,
main = "Top 10 Total Damages (US$)",
xlab = "Total Damages (US$)",
horiz=T, las=1, cex.names=0.5, cex.axis=0.75))
From the above figures we can conclude that Flood has the most greatest economic impact across United States.
#Numerical Summary
StormData_top10_TotDmg
## # A tibble: 10 x 2
## EVTYPE TOT_DMG
## <fct> <dbl>
## 1 ICE STORM 8967041310.
## 2 RIVER FLOOD 10148404500.
## 3 HURRICANE 14610229010.
## 4 DROUGHT 15018672000.
## 5 FLASH FLOOD 17562128610.
## 6 HAIL 18758221170.
## 7 STORM SURGE 43323541000.
## 8 TORNADO 57352113590.
## 9 HURRICANE/TYPHOON 71913712800.
## 10 FLOOD 150319678250.
Based on above summary table, Flood has caused the most severe economic impact in United States, resulted in loss of US$150,320 Million from beginning of 1950 to November 2011.