Analysis Affect of the Disaster Events on the United States' Economy and population health

Synopsis

This paper analysis 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. The purpose of this paper is to address the two types of events that are most harmful with respect to population health and have the greatest economic consequences.

Data Processing

This section describe the data processing in this paper. I unzip the data and read the data into r first. I simply the data by subsetting the columns that relevant to the analysis.

library(R.utils)
## Loading required package: R.oo
## Loading required package: R.methodsS3
## R.methodsS3 v1.6.1 (2014-01-04) successfully loaded. See ?R.methodsS3 for help.
## R.oo v1.18.0 (2014-02-22) successfully loaded. See ?R.oo for help.
## 
## Attaching package: 'R.oo'
## 
## The following objects are masked from 'package:methods':
## 
##     getClasses, getMethods
## 
## The following objects are masked from 'package:base':
## 
##     attach, detach, gc, load, save
## 
## R.utils v1.32.4 (2014-05-14) successfully loaded. See ?R.utils for help.
## 
## Attaching package: 'R.utils'
## 
## The following object is masked from 'package:utils':
## 
##     timestamp
## 
## The following objects are masked from 'package:base':
## 
##     cat, commandArgs, getOption, inherits, isOpen, parse, warnings

bunzip2("repdata_data_StormData.csv.bz2", "stormdata.csv")
## Error: File already exists: stormdata.csv
stormdata <- read.csv("stormdata.csv", header = T)

data <- stormdata[, c(8, 23:28)]

Inorder to group the events, i check all the variables in EVTYPE. I use loop to group the events into 48 type that show in STORM DATA PREPARATION document. After group the events, i sum the four colunms data FATALITIES, INJURIES, PROPDMG and CROPDMG by the groups. I consider the sum of FATALITIES and INJURIES are the data for population health, the sum of PROPDMG and CROPDMG are the data for economy consequence.

# sort(unique(data[,1]))
data[, 1] <- as.character(data[, 1])

event_type <- c("Low Tide", "Avalanche", "Blizzard", "Coastal Flood", "(wind chill)|cold", 
    "Debris Flow", "Dense Fog", "Dense Smoke", "Drought", "Dust Devil", "Dust Storm", 
    "Excessive Heat", "Extreme [Cold|Wind Chill]", "Flash Flood", "Flood", "Freezing Fog", 
    "Frost|Freeze", "Funnel Cloud", "Hail", "Heat", "Heavy Rain", "Heavy Snow", 
    "High Surf", "High Wind", "Hurricane|Typhoon", "Ice Storm", "Lakeshore Flood", 
    "Lake Effect Snow", "Lightning", "Marine Hail", "Marine High Wind", "Marine Strong Wind", 
    "Marine Thunderstorm Wind", "Rip Current", "Seiche", "Sleet", "Storm Surge", 
    "Strong Wind", "Thunderstorm Wind", "Tornado", "Tropical Depression", "Tropical Storm", 
    "Tsunami", "Volcanic Ash", "Waterspout", "Wildfire", "Winter Storm", "Winter Weather")
e <- list()
for (i in event_type) {
    e[[i]] <- data[grepl(i, data[, 1], ignore.case = T), ]
    e[[i]]$type <- rep(i, nrow(e[[i]]))
}

alle <- do.call(rbind, e)
# head(alle)
result <- aggregate(alle[, c(2, 3, 4, 6)], list(alle$type), sum)
result$nb <- c(1:47)
result$health <- result[, 2] + result[, 3]
result$economic <- result[, 4] + result[, 5]
he <- result[sort(result$health, index.return = T, decreasing = T)$ix, ]
eco <- result[sort(result$economic, index.return = T, decreasing = T)$ix, ]

Result

This part shows the result of the analysis.

The table below shows the number that represent the events.

result[, c(1, 6)]  #The number that represent the events
##                      Group.1 nb
## 1                  Avalanche  1
## 2                   Blizzard  2
## 3              Coastal Flood  3
## 4                  Dense Fog  4
## 5                Dense Smoke  5
## 6                    Drought  6
## 7                 Dust Devil  7
## 8                 Dust Storm  8
## 9             Excessive Heat  9
## 10 Extreme [Cold|Wind Chill] 10
## 11               Flash Flood 11
## 12                     Flood 12
## 13              Freezing Fog 13
## 14              Frost|Freeze 14
## 15              Funnel Cloud 15
## 16                      Hail 16
## 17                      Heat 17
## 18                Heavy Rain 18
## 19                Heavy Snow 19
## 20                 High Surf 20
## 21                 High Wind 21
## 22         Hurricane|Typhoon 22
## 23                 Ice Storm 23
## 24          Lake Effect Snow 24
## 25           Lakeshore Flood 25
## 26                 Lightning 26
## 27                  Low Tide 27
## 28               Marine Hail 28
## 29          Marine High Wind 29
## 30        Marine Strong Wind 30
## 31  Marine Thunderstorm Wind 31
## 32               Rip Current 32
## 33                    Seiche 33
## 34                     Sleet 34
## 35               Storm Surge 35
## 36               Strong Wind 36
## 37         Thunderstorm Wind 37
## 38                   Tornado 38
## 39       Tropical Depression 39
## 40            Tropical Storm 40
## 41                   Tsunami 41
## 42              Volcanic Ash 42
## 43                Waterspout 43
## 44                  Wildfire 44
## 45         (wind chill)|cold 45
## 46              Winter Storm 46
## 47            Winter Weather 47

The first plot show the top ten event respect to population health. we can see Tornado has the highest effect on population health.

bp1 <- barplot(he[1:10, 7], names.arg = he[1:10, 6], axisnames = T, xlab = "event", 
    ylab = "number of injures plus fatalties")

plot of chunk unnamed-chunk-4

The second plot shows the top ten event that have the greatest economic consequences. we can see Tornado has the highest effect on economy.

bp2 <- barplot(eco[1:10, 8], names.arg = eco[1:10, 6], axisnames = T, xlab = "event", 
    ylab = "PROPDMG plus CROPDMG")

plot of chunk unnamed-chunk-5