Synopisis:

This study uses NOAA Storm Data from 1950 to Nov. 2011 to look at the nationwide effects of different storm event types. Two different storm effects are studied: Population Health effects, and overall Economic Costs.

Two measures of Population Health effects (Fatality and Injury counts) are given in the raw data. These two measures of health effects are analyzed seperately and summed across all years for the entire nation for each individual Storm Event Type. The Top 10 worst Fatalitiy Storm Event Types, and the Top 10 worst Injury Storm Event Types are identified and presented in tables and graphics.

A measure of overall Economic cost ($) for each storm is also generated from the raw data measures of Property Damage and Crop Damage (Economic Cost = Property Damage Cost + Crop Damage Cost). This overall Economic Cost measure is then summed across all years for the entire nation for each individual Storm Event Type. The Top 10 worst Economic Cost Storm Event Types are identified and presented in a table and a graphic.

Prepared for Courcera Course - Reproducible Research: Peer Assessment 2 - Author: R. Slagle - 12/2/2016

Data Processing

Accessing and Reading the NOAA Storm Data

The data used in this analysis is available from NOAA at: https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2 The first step in producing this analysis is to read the data into an R object from the original downloaded .bz2 zipped .csv file.

storm <- read.csv("repdata%2Fdata%2FStormData.csv.bz2")

Process the Health measurements (Fatalities and Injuries) aggregating by Event Type

The national health effect of Storm events will be looked at using two measures: Fatalities and Injuries. To get at a single value for each measurement type for each Event Type, the individual storm fatality counts and injury counts are summed seperately nationwide, across all years for each Storm Event Type.

# Calculate the sum of Fatality effects for each Storm Event Type
totalPopFatalities <- aggregate(x=list(fatalities=storm$FATALITIES), by=list(eventType=storm$EVTYPE), FUN=sum, na.rm=TRUE)

# Calculate the sum of Injuries effects for each Storm Event Type
totalPopInjuries <- aggregate(x=list(injuries=storm$INJURIES), by=list(eventType=storm$EVTYPE), FUN=sum, na.rm=TRUE)

Create a new measurment “Economic Cost”" by adjusting and adding raw cost measurements and aggregating by Event Type

To prepare the Economic data for analysis, we need to apply “Exponent” adjustments to the raw Property Cost data and the raw Crop Cost data. Next we create a new measure called Economic Cost by adding the adjusted costs for Property damage and Crop damage.

To get at a single measure of Economic Costs for each Event Type, the individual storm Economic Cost measures are summed nationwide, across all years for each Storm Event Type.

# Calculate Property Cost with adjutments for Exponent Codes
storm$propDmgCost <- storm$PROPDMG
storm[toupper(storm$PROPDMGEXP) == "H", ]$propDmgCost <- storm[toupper(storm$PROPDMGEXP) == "H", ]$PROPDMG * 100
storm[toupper(storm$PROPDMGEXP) == "K", ]$propDmgCost <- storm[toupper(storm$PROPDMGEXP) == "K", ]$PROPDMG * 1000
storm[toupper(storm$PROPDMGEXP) == "M", ]$propDmgCost <- storm[toupper(storm$PROPDMGEXP) == "M", ]$PROPDMG * 1000000
storm[toupper(storm$PROPDMGEXP) == "B", ]$propDmgCost <- storm[toupper(storm$PROPDMGEXP) == "B", ]$PROPDMG * 1000000000

# Calculate Crop Cost with adjutments for Exponent Codes
storm$cropDmgCost <- storm$CROPDMG
storm[toupper(storm$CROPDMGEXP) == "H", ]$cropDmgCost <- storm[toupper(storm$CROPDMGEXP) == "H", ]$CROPDMG * 100
storm[toupper(storm$CROPDMGEXP) == "K", ]$cropDmgCost <- storm[toupper(storm$CROPDMGEXP) == "K", ]$CROPDMG * 1000
storm[toupper(storm$CROPDMGEXP) == "M", ]$cropDmgCost <- storm[toupper(storm$CROPDMGEXP) == "M", ]$CROPDMG * 1000000
storm[toupper(storm$CROPDMGEXP) == "B", ]$cropDmgCost <- storm[toupper(storm$CROPDMGEXP) == "B", ]$CROPDMG * 1000000000

# Calculate the total Combined Economic Cost by adding the Property and Costs values
storm$economicCost <- storm$propDmgCost + storm$cropDmgCost

# Calculate the sum of of the Economic Costs for each Storm Event Type
totalEconomicCost <- aggregate(x=list(economicCost=storm$economicCost), by=list(eventType=storm$EVTYPE), FUN=sum, na.rm=TRUE)

Select the Worst Storm Event Types for each Health effect (Fatalities and Injuries)

To identify which Storm Event Types are most harmful with respect to Population Health nationwide, we rank the aggregated data using the Fatalities and Injuries measures seperately, and select just the top ten worst Fatality Event Types, and the top ten worst Injury Event Types.

# Select and Rank the Top Ten Worst Fatality Events
topFatalities <- totalPopFatalities[order(-totalPopFatalities$fatalities),]
topFatalities <- topFatalities[1:10,]
topFatalities$rank <- c(1:10)
# Add Rank to Event Type for Plot Display
topFatalities$eventTypeRank <- paste(c(1:10), topFatalities$eventType, sep="-")

# Select and Rank the Top Ten Worst Injury Events
topInjuries <- totalPopInjuries[order(-totalPopInjuries$injuries),]
topInjuries <- topInjuries[1:10,]
topInjuries$rank <- c(1:10)
# Add Rank to Event Type for Plot Display
topInjuries$eventTypeRank <- paste(c(1:10), topInjuries$eventType, sep="-")

Select the Worst Storm Event Types for Economic Cost

To identify which Storm Event Types are most harmful with respect to Economic Costs nationwide, we rank the aggregated data using the Economic Cost measure, and select just the top ten worst (highest Property damage + Crop damage) Event Types.

# Select and Rank the Top Ten Worst Economic Events
topEconomicCost <- totalEconomicCost[order(-totalEconomicCost$economicCost),]
topEconomicCost <- topEconomicCost[1:10,]
topEconomicCost$rank <- c(1:10)
# Add Rank to Event Type for Plot Display
topEconomicCost$eventTypeRank <- paste(c(1:10), topEconomicCost$eventType, sep="-")

Results

Event Types with Highest Health Effect - Fatalities

Below is Table 1 with the Top 10 Storm Event Types that caused the worst Fatalities nationwide for the study dates. Figure 1 shows a Bar Plot of that same data. #### Table 1 - Ten Worst Fatality Storm Event Types

# Print Events with High Fatalities
print (topFatalities[,c(3,1,2)], row.names = FALSE)
##  rank      eventType fatalities
##     1        TORNADO       5633
##     2 EXCESSIVE HEAT       1903
##     3    FLASH FLOOD        978
##     4           HEAT        937
##     5      LIGHTNING        816
##     6      TSTM WIND        504
##     7          FLOOD        470
##     8    RIP CURRENT        368
##     9      HIGH WIND        248
##    10      AVALANCHE        224

Figure 1 - Plot of Top Ten Worst Fatality Storm Event Types

# Plot Events with High Fatalities
barplot(topFatalities$fatalities, main="Top 10 Worst Fatality Storm Event Types", xlab="Rank", ylab="Total Number of Fatalities", col="red", legend.text=topFatalities$eventTypeRank, names.arg=topFatalities$rank)

These table and plot show that the Tornado Storm Events are by far the highest cause of Fatalities.

Event Types with Highest Health Effect - Injuries

And, below is Table 2 with the Top 10 Storm Event Types that caused the worst Injuries nationwide for the study dates. Figure 2 shows a Bar Plot of that same data.

Table 2 - Ten Worst Injury Storm Event Types

# Print Events with High Injuries
print (topInjuries[,c(3,1,2)], row.names = FALSE)
##  rank         eventType injuries
##     1           TORNADO    91346
##     2         TSTM WIND     6957
##     3             FLOOD     6789
##     4    EXCESSIVE HEAT     6525
##     5         LIGHTNING     5230
##     6              HEAT     2100
##     7         ICE STORM     1975
##     8       FLASH FLOOD     1777
##     9 THUNDERSTORM WIND     1488
##    10              HAIL     1361

Figure 2 - Plot of Top Ten Worst Injury Storm Event Types

# Plot Events with High Injuries
barplot(topInjuries$injuries, main="Top 10 Worst Injury Storm Event Types", xlab="Rank", ylab="Total Number of Injuries", col="red", legend.text=topInjuries$eventTypeRank, names.arg=topInjuries$rank)

These table and plot show that the Tornado Storm Events are by far the highest cause of Injuries.

Event Types with Highest Economic Costs

Below is Table 3 with the Top 10 Storm Event Types that caused the worst Economic Costs nationwide for the study dates. Figure 3 shows a Bar Plot of that same data.

Table 3 - Ten Worst Economic Cost Storm Event Types

# Print Events with High Economic Effects
print (topEconomicCost[,c(3,1,2)], row.names = FALSE)
##  rank         eventType economicCost
##     1             FLOOD 150319678257
##     2 HURRICANE/TYPHOON  71913712800
##     3           TORNADO  57352114049
##     4       STORM SURGE  43323541000
##     5              HAIL  18758222016
##     6       FLASH FLOOD  17562129167
##     7           DROUGHT  15018672000
##     8         HURRICANE  14610229010
##     9       RIVER FLOOD  10148404500
##    10         ICE STORM   8967041360

Figure 3 - Plot of Top Ten Worst Economic Cost Storm Event Types

# Plot Events with High Economic Effects
barplot(topEconomicCost$economicCost/1000000000, main="Top 10 Worst Economic Cost Storm Event Types", xlab="Rank", ylab="Total Economic Cost (Billions $)", col="red", legend.text=topEconomicCost$eventTypeRank, names.arg=topEconomicCost$rank)

These table and plot show that the Flood Storm Events are by far the highest cause of Economic damage, with Hurricane/Typhoon next at less than half the cost.

End of Report