Synopsis

In this report we explore the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database to assess the public health and economic consequences of severe weather events in the United States.

The NOAA storm data indicates that across the United States:

  1. Tornados are the most harmful severe weather event in terms of population health;
  2. Floods are the most harmful severe weather event in terms of economic consequences.

Data Processing

From the NOAA Storm Database we obtained data on major weather events in the United States, including details of when and where they occur, as well as estimates of any fatalities, injuries, and property damage.

We first read in the NOAA storm data from zip archive.

setwd("~/Coursera/ReproducibleResearch/Project2")
#read data from "repdata_data_StormData.csv.bz2"
inputdata<-read.csv(bzfile("repdata_data_StormData.csv.bz2"))

Next, we process the inputdata frame and create a new dataframe, df1 containing data relevant for our analysis of severe weather events. For economic cost we ensure that economic damage is expressed in USD. The scaling convention is described in section 2.7 of National Weather Service Storm Data Documentation.

# Extract BGN_DATE and convert from character array to dates
BGN_DATE<-  as.Date(as.character(strsplit(inputdata$BGN_DATE," 0:00:00")),"%m/%d/%Y")   

#Create array corresponding to the year
YEAR<-format(BGN_DATE,"%Y")

#Scale crop damage data to have same units

CROPDMG<-rep(0,length(inputdata$CROPDMGEXP))
CROPDMG[inputdata$CROPDMGEXP==""]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP==""])
CROPDMG[inputdata$CROPDMGEXP=="K"]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP=="K"])*1000
CROPDMG[inputdata$CROPDMGEXP=="k"]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP=="k"])*1000
CROPDMG[inputdata$CROPDMGEXP=="M"]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP=="M"])*1000000
CROPDMG[inputdata$CROPDMGEXP=="m"]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP=="m"])*1000000
CROPDMG[inputdata$CROPDMGEXP=="B"]<-as.numeric(inputdata$CROPDMG[inputdata$CROPDMGEXP=="B"])*1000000000

#Scale property damage data to have same units

PROPDMG<-rep(0,length(inputdata$CROPDMGEXP))
PROPDMG[inputdata$PROPDMGEXP==""]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP==""])
PROPDMG[inputdata$PROPDMGEXP=="K"]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP=="K"])*1000
PROPDMG[inputdata$PROPDMGEXP=="k"]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP=="k"])*1000
PROPDMG[inputdata$PROPDMGEXP=="M"]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP=="M"])*1000000
PROPDMG[inputdata$PROPDMGEXP=="m"]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP=="m"])*1000000
PROPDMG[inputdata$PROPDMGEXP=="B"]<-as.numeric(inputdata$PROPDMG[inputdata$PROPDMGEXP=="B"])*1000000000

# Calculate total damage
TOTALDMG<-CROPDMG+PROPDMG

# Create dataframe df1 and rename columns
df1<-data.frame(BGN_DATE,YEAR,inputdata$STATE,as.factor(inputdata$EVTYPE),inputdata$FATALITIES,inputdata$INJURIES,PROPDMG,CROPDMG,paste(YEAR,inputdata$EVTYPE),TOTALDMG)
colnames(df1)<-c("DATE","YEAR","STATE","EVTYPE","FATALITIES","INJURIES","PROPDMG","CROPDMG","YEAR_EVTYPE","TOTALDMG")

Next, we prepare summaries of the data in terms of fatalities, injuries and total economic cost from which we can assess the most damaging type of severe weather events observed in United States. The key figures from this analysis are presented in the result section below.

FATALITIES.by.EVTYPE<-with(df1,tapply(FATALITIES,EVTYPE,FUN = sum))
maxFATALITIES.by.EVTYPE<-FATALITIES.by.EVTYPE[FATALITIES.by.EVTYPE==max(FATALITIES.by.EVTYPE)]

INJURIES.by.EVTYPE<-with(df1,tapply(INJURIES,EVTYPE,FUN = sum))
maxINJURIES.by.EVTYPE<-INJURIES.by.EVTYPE[INJURIES.by.EVTYPE==max(INJURIES.by.EVTYPE)]

TOTALDMG.by.EVTYPE<-with(df1,tapply(TOTALDMG,EVTYPE,FUN = sum))
maxTOTALDMG.by.EVTYPE<-TOTALDMG.by.EVTYPE[TOTALDMG.by.EVTYPE==max(TOTALDMG.by.EVTYPE)]

CROPDMG.worst<-sum(subset(df1,EVTYPE==names(maxTOTALDMG.by.EVTYPE))$CROPDMG     )
PROPDMG.worst<-sum(subset(df1,EVTYPE==names(maxTOTALDMG.by.EVTYPE))$PROPDMG     )

Results

In terms of population health, tornados are the most harmful severe weather event in the United States. Between 1950 and 2011:

In terms of economic consequences, floods are the most harmful severe weather event in the United States. Between 1950 and 2011, USD 150 billion of damage was caused by floods in the United States of which:

Additional Figures

The following plot shows the top 5 severe weather events in the United States during 1950-2011 in terms of fatalities.

Top5Fatalities<-sort(FATALITIES.by.EVTYPE, TRUE)[1:5]
plot(Top5Fatalities,ylim=c(0,max(Top5Fatalities)*1.2),xlim=c(0.5,6) ,col="red" ,xlab="Top 5 severe weather events",ylab="Total Fatalities, 1950-2011")
text(Top5Fatalities,labels=names(Top5Fatalities),cex=0.7,pos=3,col="blue")
title(main="Fatalities due to severe weather events in US")

The following plot shows the top 5 severe weather events in the United States during 1950-2011 in terms of injuries.

Top5Injuries<-sort(INJURIES.by.EVTYPE, TRUE)[1:5]
plot(Top5Injuries,ylim=c(0,max(Top5Injuries)*1.2),xlim=c(0.5,6) ,col="red" ,xlab="Top 5 severe weather events",ylab="Total Injuries, 1950-2011")
text(Top5Injuries,labels=names(Top5Injuries),cex=0.7,pos=3,col="blue")
title(main="Injuries due to severe weather events in US")

The following plot shows the top 5 severe weather events in the United States during 1950-2011 in terms of economic cost.

Top5EC<-sort(TOTALDMG.by.EVTYPE, TRUE)[1:5]
plot(Top5EC/1000000000,ylim=c(0,max(Top5EC/1000000000)*1.2),xlim=c(0.5,6) ,col="red" ,xlab="Top 5 severe weather events",ylab="Total Cost (USD Billions), 1950-2011")
text(Top5EC/1000000000,labels=names(Top5EC),cex=0.7,pos=3,col="blue")
title(main="Economic cost due to severe weather events in US")