Synopsis

This report aims to assess the impact of storms and other severe weather events in the United States between 1950 until November 2011, exploring both the public health and economic impacts in communities and municipalities. This analysis will focus on the events on fatalities, injuries, and crop and property damages. From this subset, it is evident that Tornado contributes the Highest Fatalities and Injuries in the population health; while Property Damage cost highest with flooding and Crop Damages cost highest due to drought.

Data Processing

From the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database, we obtain relevant information which include when and where they occur, as well as estimates of any fatalities, injuries, and property damage, including the costs of casualties. Please refer to National Weather Service Storm Data Documentation and National Climatic Data Center Storm Events FAQ for further guidance on how the data organized.

Loading and Preparing Data

Please make sure to unzip the file repdata_data_StormData.csv.bz2 to access the CSV file directly and change the path below accordingly:

stormData_raw <- read.csv("repdata_data_StormData.csv")
head(stormData_raw)

For this analysis, we will focus only on the health and economic consequences of severe weather events. We will be suing the following data subset wit columns (EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP):

stormData_events <- c("EVTYPE", "FATALITIES", "INJURIES", 
                             "PROPDMG","PROPDMGEXP","CROPDMG","CROPDMGEXP")
data <- stormData_raw[stormData_events]

Property Damage Data

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

Exponents for each level as shown above is assigned to the values for the property data, ‘0’ is assigne to invalid entries. The property damage value is then computed by multiplying the property damage and property exponent values as shown below:

# Assigning values for the property exponent data 
data$PROPEXP[data$PROPDMGEXP == "K"] <- 1000
data$PROPEXP[data$PROPDMGEXP == "M"] <- 1e+06
data$PROPEXP[data$PROPDMGEXP == ""] <- 1
data$PROPEXP[data$PROPDMGEXP == "B"] <- 1e+09
data$PROPEXP[data$PROPDMGEXP == "m"] <- 1e+06
data$PROPEXP[data$PROPDMGEXP == "0"] <- 1
data$PROPEXP[data$PROPDMGEXP == "5"] <- 1e+05
data$PROPEXP[data$PROPDMGEXP == "6"] <- 1e+06
data$PROPEXP[data$PROPDMGEXP == "4"] <- 10000
data$PROPEXP[data$PROPDMGEXP == "2"] <- 100
data$PROPEXP[data$PROPDMGEXP == "3"] <- 1000
data$PROPEXP[data$PROPDMGEXP == "h"] <- 100
data$PROPEXP[data$PROPDMGEXP == "7"] <- 1e+07
data$PROPEXP[data$PROPDMGEXP == "H"] <- 100
data$PROPEXP[data$PROPDMGEXP == "1"] <- 10
data$PROPEXP[data$PROPDMGEXP == "8"] <- 1e+08
# Assigning '0' to invalid exponent data
data$PROPEXP[data$PROPDMGEXP == "+"] <- 0
data$PROPEXP[data$PROPDMGEXP == "-"] <- 0
data$PROPEXP[data$PROPDMGEXP == "?"] <- 0
# Calculating the property damage value
data$PROPDMGVAL <- data$PROPDMG * data$PROPEXP

Crop Damage Data

unique(data$CROPDMGEXP)
## [1]   M K m B ? 0 k 2
## Levels:  ? 0 2 B k K m M

Exponents for each level as shown above is assigned to the values for the crop data, ‘0’ is assigne to invalid entries. The crop damage value is then computed by multiplying the crop damage and crop exponent values as shown below:

# Assigning values for the crop exponent data 
data$CROPEXP[data$CROPDMGEXP == "M"] <- 1e+06
data$CROPEXP[data$CROPDMGEXP == "K"] <- 1000
data$CROPEXP[data$CROPDMGEXP == "m"] <- 1e+06
data$CROPEXP[data$CROPDMGEXP == "B"] <- 1e+09
data$CROPEXP[data$CROPDMGEXP == "0"] <- 1
data$CROPEXP[data$CROPDMGEXP == "k"] <- 1000
data$CROPEXP[data$CROPDMGEXP == "2"] <- 100
data$CROPEXP[data$CROPDMGEXP == ""] <- 1
# Assigning '0' to invalid exponent data
data$CROPEXP[data$CROPDMGEXP == "?"] <- 0
# calculating the crop damage value
data$CROPDMGVAL <- data$CROPDMG * data$CROPEXP

Totals of Each Incident by Event Type

Below is the code where we get the aggreated sum of each events - Fatalities, Injuries, Propery Damage, and Crop Damage:

# Totalling the data by event
fatalities <- aggregate(FATALITIES ~ EVTYPE, data, FUN = sum)
injuries <- aggregate(INJURIES ~ EVTYPE, data, FUN = sum)
propertyDamage <- aggregate(PROPDMGVAL ~ EVTYPE, data, FUN = sum)
cropDamage <- aggregate(CROPDMGVAL ~ EVTYPE, data, FUN = sum)

Population Health:

Below shows the code and graph of the Top 10 Highest Fatalities and Injuries:

# Listing  events with highest fatalities
fatalitiesRanking <- fatalities[order(-fatalities$FATALITIES), ][1:10, ]
# Listing events with highest injuries
injuriesRanking <- injuries[order(-injuries$INJURIES), ][1:10, ]
# Plotting both into a graph
par(mfrow = c(1, 2), mar = c(12, 4, 3, 2), mgp = c(3, 1, 0), cex = 0.8)
barplot(fatalitiesRanking$FATALITIES, las = 3, 
        names.arg = fatalitiesRanking$EVTYPE, 
        main = "Ranking of Fatalities", 
        ylab = "Number of fatalities", col = "red")
barplot(injuriesRanking$INJURIES, las = 3, 
        names.arg = injuriesRanking$EVTYPE, 
        main = "Ranking of Injuries", 
        ylab = "Number of injuries", col = "red")

Economic Consequences:

Below shows the code and graph of the Top 10 Highest Property and Crop Damages:

# Finding events with highest property damage
propertyDamageRanking <- propertyDamage[order(-propertyDamage$PROPDMGVAL), ][1:10, ]
# Finding events with highest crop damage
cropDamageRanking <- cropDamage[order(-cropDamage$CROPDMGVAL), ][1:10, ]
# Plotting both into a graph
par(mfrow = c(1, 2), mar = c(12, 4, 3, 2), mgp = c(3, 1, 0), cex = 0.8)
barplot(propertyDamageRanking$PROPDMGVAL/(10^9), las = 3, 
        names.arg = propertyDamageRanking$EVTYPE, 
        main = "Ranking of Property Damages", 
        ylab = "Damage Cost ($ billions)", col = "red")
barplot(cropDamageRanking$CROPDMGVAL/(10^9), las = 3, 
        names.arg = cropDamageRanking$EVTYPE, 
        main = "Ranking of Crop Damages", 
        ylab = "Damage Cost ($ billions)", col = "red")

Results

Based on the data processed and presented above, the most harmful with respect to population health (for both Injuries and Fatalities) are tornados, excessive heat, and flash floods.

On the other hand, flood, hurricane/typhoon, and tordado contributed the highest economic consequences in property damage cost. While drough, flood, river flood, and ice storm resulted the highest in crop damage cost.