Impact of Severe Weather Events on Public Health and Economy in the United States.

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 property damage, and 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. 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.

In this report, our aim is to analyze the impact of different weather events on public health and economy based on the NOAA database.

Data Processing

## R version 3.1.0 (2014-04-10)
## Platform: x86_64-pc-linux-gnu (64-bit) 

## Dowloading data if it's not already downloaded into the current directory.
if(!file.exists("stormData.csv.bz2")) {
    download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2",
                  destfile = "stormData.csv.bz2", method = "curl")
    }

## Loading the dataset.
dsNOAA <- read.csv(bzfile("stormData.csv.bz2"), sep=",", header=T)

## Subsetting (NOAA) storm dataset.
cleanNOAA <- dsNOAA[,c('EVTYPE','FATALITIES','INJURIES', 'PROPDMG', 'PROPDMGEXP', 'CROPDMG', 'CROPDMGEXP')]

## Converting H, K, M, B units to calculate the Property Damage.
## H <- 10^2, K <- 10^3, M <- 10^6, B <- 10^9
cleanNOAA$PROPDMGVAL = 0
cleanNOAA[cleanNOAA$PROPDMGEXP == "H", ]$PROPDMGVAL = cleanNOAA[cleanNOAA$PROPDMGEXP == "H", ]$PROPDMG * 10^2
cleanNOAA[cleanNOAA$PROPDMGEXP == "K", ]$PROPDMGVAL = cleanNOAA[cleanNOAA$PROPDMGEXP == "K", ]$PROPDMG * 10^3
cleanNOAA[cleanNOAA$PROPDMGEXP == "M", ]$PROPDMGVAL = cleanNOAA[cleanNOAA$PROPDMGEXP == "M", ]$PROPDMG * 10^6
cleanNOAA[cleanNOAA$PROPDMGEXP == "B", ]$PROPDMGVAL = cleanNOAA[cleanNOAA$PROPDMGEXP == "B", ]$PROPDMG * 10^9

## Converting H, K, M, B units to calculate the Crop Damage.
## H <- 10^2, K <- 10^3, M <- 10^6, B <- 10^9
cleanNOAA$CROPDMGVAL = 0
cleanNOAA[cleanNOAA$CROPDMGEXP == "H", ]$CROPDMGVAL = cleanNOAA[cleanNOAA$CROPDMGEXP == "H", ]$CROPDMG * 10^2
cleanNOAA[cleanNOAA$CROPDMGEXP == "K", ]$CROPDMGVAL = cleanNOAA[cleanNOAA$CROPDMGEXP == "K", ]$CROPDMG * 10^3
cleanNOAA[cleanNOAA$CROPDMGEXP == "M", ]$CROPDMGVAL = cleanNOAA[cleanNOAA$CROPDMGEXP == "M", ]$CROPDMG * 10^6
cleanNOAA[cleanNOAA$CROPDMGEXP == "B", ]$CROPDMGVAL = cleanNOAA[cleanNOAA$CROPDMGEXP == "B", ]$CROPDMG * 10^9

Results

Q1 : Across the United States, which types of events (as indicated in the EVTYPE variable) are most harmful with respect to population health ?

## ggplot2 library has been used to plot the results.
library(ggplot2)

## Plotting the number of fatalities with the 10 most harmful event types.
fatalities <- aggregate(FATALITIES ~ EVTYPE, data=cleanNOAA, sum)
fatalities <- fatalities[order(-fatalities$FATALITIES), ][1:10, ]
fatalities$EVTYPE <- factor(fatalities$EVTYPE, levels = fatalities$EVTYPE)

ggplot(fatalities, aes(x = EVTYPE, y = FATALITIES)) + 
    geom_bar(stat = "identity", fill = "blue", las = 3) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) + 
    xlab("Event Type") + ylab("Fatalities") + ggtitle("Number of fatalities by top 10 Weather Events")

plot of chunk unnamed-chunk-2

## Plotting the number of injuries with the 10 most harmful event types.
injuries <- aggregate(INJURIES ~ EVTYPE, data=cleanNOAA, sum)
injuries <- injuries[order(-injuries$INJURIES), ][1:10, ]
injuries$EVTYPE <- factor(injuries$EVTYPE, levels = injuries$EVTYPE)

ggplot(injuries, aes(x = EVTYPE, y = INJURIES)) + 
    geom_bar(stat = "identity", fill = "blue", las = 3) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) + 
    xlab("Event Type") + ylab("Injuries") + ggtitle("Number of injuries by top 10 Weather Events")

plot of chunk unnamed-chunk-2

The top 10 weather events which cause the highest fatalities and the highest injuries across United States are showcased in above figures. The most harmful weather event to population health is Tornado, causing the highest fatalities and the highest injuries across United States.

Q2 : Across the United States, which types of events have the greatest economic consequences ?

## ggplot2 library has been used to plot the results.
library(ggplot2)

## Ploting the number of damages with the 10 most harmful event types.
damages <- aggregate(PROPDMGVAL + CROPDMGVAL ~ EVTYPE, data=cleanNOAA, sum)
names(damages) = c("EVTYPE", "TOTALDAMAGE")
damages <- damages[order(-damages$TOTALDAMAGE), ][1:10, ]
damages$EVTYPE <- factor(damages$EVTYPE, levels = damages$EVTYPE)

ggplot(damages, aes(x = EVTYPE, y = TOTALDAMAGE)) + 
    geom_bar(stat = "identity", fill = "blue", las = 3) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) + 
    xlab("Event Type") + ylab("Damages ($)") + ggtitle("Property & Crop Damages by top 10 Weather Events")

plot of chunk unnamed-chunk-3

According to the above figure, weather events which relates to the greatest economic consequences are: flood, drought, Tornado and Typhoon.