Analysis of Fatalities, Injuries, and Properties Damage Relating to Storm and Other Severe Weather Events in the U.S.

Synopsis

In the past years, we have seen severe weather events leading to catastrophic consequences on public health and economy. Finding out the severity of damage caused by each type of whether events is a critical step involved in assessing the pre-event preventive measures and planning out for the post-event management. Using the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database, we will address the following questions.

1) Across the United States, which types of events are most harmful with respect to population health?

2) Across the United States, which type of events have the greatest economic consequences?

Obtaining and Loading the data

fileName <- 'stormData.csv.bz2'
if(!file.exists(fileName)){
    dataUrl <- 'http://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2'
    download.file(dataUrl, destfile=fileName)
}
dataset = read.csv(fileName, header=TRUE, sep=",")

Data Processing

Extracting the data according to the type of damage: fatalities, injuries, and property damage

Fatalities
fatalities_by_events <- data.frame(EVTYPE=dataset$EVTYPE, FATALITIES=dataset$FATALITIES)
fatalities_by_events <- aggregate(fatalities_by_events$FATALITIES, 
                                  list(EVTYPE=fatalities_by_events$EVTYPE), sum)
fatalities_by_events <- fatalities_by_events[order(fatalities_by_events$x),]
top_20_fatalities <- tail(fatalities_by_events, 20)
Injuries
injuries_by_events <- data.frame(EVTYPE=dataset$EVTYPE,INJURIES=dataset$INJURIES)
injuries_by_events <- aggregate(injuries_by_events$INJURIES, list(EVTYPE=injuries_by_events$EVTYPE), sum)
injuries_by_events <- injuries_by_events[order(injuries_by_events$x),]
top_20_injuries <- tail(injuries_by_events, 20)
Property and Crop damage
economic_damage_by_events <- data.frame(EVTYPE=dataset$EVTYPE, PROPDMG=dataset$PROPDMG, 
                                            PROPDMGEXP=dataset$PROPDMGEXP, CROPDMG=dataset$CROPDMG,
                                            CROPDMGEXP=dataset$CROPDMGEXP)
Converting the damage cost values by their corresponding unit [K, M, B]
prop_dmg_indices = c(which(economic_damage_by_events$PROPDMGEXP=='K'),
      which(economic_damage_by_events$PROPDMGEXP=='M'),
      which(economic_damage_by_events$PROPDMGEXP=='B'))
economic_damage_by_events = economic_damage_by_events[prop_dmg_indices,]

crop_dmg_indices = c(which(economic_damage_by_events$CROPDMGEXP=='K'),
  which(economic_damage_by_events$CROPDMGEXP=='M'),
  which(economic_damage_by_events$CROPDMGEXP=='B'))
economic_damage_by_events = economic_damage_by_events[crop_dmg_indices,]

economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='K')] = 
    economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='K')]*(10^3)
economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='M')] = 
    economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='M')]*(10^6)
economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='B')] = 
    economic_damage_by_events$PROPDMG[which(economic_damage_by_events$PROPDMGEXP=='B')]*(10^9)

economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='K')] = 
    economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='K')]*(10^3)
economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='M')] = 
    economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='M')]*(10^6)
economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='B')] = 
    economic_damage_by_events$CROPDMG[which(economic_damage_by_events$CROPDMGEXP=='B')]*(10^9)
Adding the property damage cost and crop damage cost to produce the overall economic damage cost
economic_damage_by_events = data.frame(EVTYPE = economic_damage_by_events$EVTYPE, 
                                       OVERALL_COST = economic_damage_by_events$PROPDMG + 
                                           economic_damage_by_events$CROPDMG)

economic_damage_by_events_summary = aggregate(economic_damage_by_events$OVERALL_COST, 
          list(EVTYPE=economic_damage_by_events$EVTYPE), sum)
economic_damage_by_events_summary = economic_damage_by_events_summary[
    order(economic_damage_by_events_summary$x),]

top_20_eco_dmg = tail(economic_damage_by_events_summary,20)

Result

Weather events causing ’top 20 fatalities*
par(mai=c(1.2,3.6,1,1))
barplot(top_20_fatalities$x, horiz=TRUE, main="Top 20 Weather related Fatalities", xlab="Number of Fatalities",
        names.arg=top_20_fatalities$EVTYPE , las=1)

plot of chunk top_20_fatalities

Weather events causing top 20 injuries
par(mai=c(1.2,3.6,1,1))
barplot(top_20_injuries$x, horiz=TRUE, main="Top 20 Weather related Injuries", xlab="Number of Injuries",
        names.arg=top_20_injuries$EVTYPE , las=1)

plot of chunk top_20_injuries

Weather events causing top 20 economic damage
par(mai=c(1.2,3.6,1,1))
barplot(top_20_eco_dmg$x, horiz=TRUE, main="Top 20 Weather related Economic Damage", xlab="Damage Cost in Dollars", names.arg=top_20_eco_dmg$EVTYPE , las=1)

plot of chunk top_20_eco_dmg

Conclusion

The Weather events relating to the most severe damages

- Fatalities: Tornado
- Injuries: Tornado
- Economic Damage: Flood