Synopsis
Storms have a (usually negative) effect on human populations, and in this analysis we study the overall impact on public health (in terms of deaths or injuries caused by the events), as well as the financial losses incurred by damage to property and crops.
The data being used was provided in the “Reproducible Research” course (Coursera, August 2014 session), based on the NOAA NCDC Storm Events database. The data was cleaned up, recoding the event types to comply with the official list of event classes mentioned in the accompanying documentation.
In terms of the effects of storms in human health, the results show that tornadoes are the most deleterious, causing about 62% of the deaths and injuries registered in the data set: 97,043 people or were injured over the 1950-2011 time period, ~1,500 people/year. In fact, 10 of the event types (out of 50 types considered by NOAA) are responsible for over 92% of human victims, in descending order: Tornadoes, lightning, excessive heat, flooding (including flash floods), thunderstorms, winter/ice storms, high winds and wildfire.
An analysis of the financial impact of storms, indicate that floods are the number one threat to properties, representing about 150.2 billions1 USD over the 1950-2011 period (a rate of loss of ~2.5 billion USD a year).
A similar analysis indicate that drought and floods are responsible for more than half of the losses for damaged crops, for a total of 24.83 billions USD over the 1993-2011 period (~ 1.3 billions USD a year).
Data Processing
1 # knitr configuration
2 library(knitr)
3 opts_knit$set(progress=FALSE)
4 opts_chunk$set(echo=TRUE, message=FALSE, tidy=TRUE, comment=NA,
5 cache=TRUE, fig.path="img/figure/2014-08-22_impact-storms_",
6 fig.keep="high", fig.width=10, fig.height=6,
7 fig.align="center")
8 # load required libs
9 library(dplyr, quietly=TRUE, warn.conflicts=FALSE)
10 library(ggplot2, quietly=TRUE, warn.conflicts=FALSE)
11 library(pander, quietly=TRUE, warn.conflicts=FALSE)
12 library(gridExtra, quietly=TRUE, warn.conflicts=FALSE)
Data Source
The data for this analysis has been given as part of August 2014 session of the course “Reproducible Research” (Coursera), and comprised of records from the NOAA Storm Database, and ancillary documentation.
- Storm data set (https://d396qusza40orc.cloudfront.net/repdata/data/StormData.csv.bz2)
- Documentation:
- National Weather Service Storm Data Documentation (https://d396qusza40orc.cloudfront.net/repdata/peer2_doc/pd01016005curr.pdf)
- National Climatic Data Center Storm Events FAQ (https://d396qusza40orc.cloudfront.net/repdata/peer2_doc/NCDC%20Storm%20Events-FAQ%20Page.pdf)
The data set and its documentation were dowloaded using the following code
1 datasrc <- "https://d396qusza40orc.cloudfront.net/repdata/data/StormData.csv.bz2"
2 download.file(url = datasrc, destfile = "StormData.csv.bz2", method = "curl")
3 datadoc <- "https://d396qusza40orc.cloudfront.net/repdata/peer2_doc/pd01016005curr.pdf"
4 download.file(url = datadoc, destfile = "pd01016005curr.pdf", method = "curl")
5 datafaq <- "https://d396qusza40orc.cloudfront.net/repdata/peer2_doc/NCDC%20Storm%20Events-FAQ%20Page.pdf"
6 download.file(url = datadoc, destfile = "NCDC Storm Events-FAQ Page.pdf", method = "curl")
Data exploration
To get an idea of the structure of the data set, the first 10 lines of the data file were read.
1 tmp1 <- read.csv("StormData.csv.bz2", nrows = 10)
2 str(tmp1)
'data.frame': 10 obs. of 37 variables:
$ STATE__ : num 1 1 1 1 1 1 1 1 1 1
$ BGN_DATE : Factor w/ 7 levels "11/15/1951 0:00:00",..: 6 6 5 7 1 1 2 3 4 4
$ BGN_TIME : int 130 145 1600 900 1500 2000 100 900 2000 2000
$ TIME_ZONE : Factor w/ 1 level "CST": 1 1 1 1 1 1 1 1 1 1
$ COUNTY : num 97 3 57 89 43 77 9 123 125 57
$ COUNTYNAME: Factor w/ 9 levels "BALDWIN","BLOUNT",..: 7 1 4 6 3 5 2 8 9 4
$ STATE : Factor w/ 1 level "AL": 1 1 1 1 1 1 1 1 1 1
$ EVTYPE : Factor w/ 1 level "TORNADO": 1 1 1 1 1 1 1 1 1 1
$ BGN_RANGE : num 0 0 0 0 0 0 0 0 0 0
$ BGN_AZI : logi NA NA NA NA NA NA ...
$ BGN_LOCATI: logi NA NA NA NA NA NA ...
$ END_DATE : logi NA NA NA NA NA NA ...
$ END_TIME : logi NA NA NA NA NA NA ...
$ COUNTY_END: num 0 0 0 0 0 0 0 0 0 0
$ COUNTYENDN: logi NA NA NA NA NA NA ...
$ END_RANGE : num 0 0 0 0 0 0 0 0 0 0
$ END_AZI : logi NA NA NA NA NA NA ...
$ END_LOCATI: logi NA NA NA NA NA NA ...
$ LENGTH : num 14 2 0.1 0 0 1.5 1.5 0 3.3 2.3
$ WIDTH : num 100 150 123 100 150 177 33 33 100 100
$ F : int 3 2 2 2 2 2 2 1 3 3
$ MAG : num 0 0 0 0 0 0 0 0 0 0
$ FATALITIES: num 0 0 0 0 0 0 0 0 1 0
$ INJURIES : num 15 0 2 2 2 6 1 0 14 0
$ PROPDMG : num 25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25
$ PROPDMGEXP: Factor w/ 1 level "K": 1 1 1 1 1 1 1 1 1 1
$ CROPDMG : num 0 0 0 0 0 0 0 0 0 0
$ CROPDMGEXP: logi NA NA NA NA NA NA ...
$ WFO : logi NA NA NA NA NA NA ...
$ STATEOFFIC: logi NA NA NA NA NA NA ...
$ ZONENAMES : logi NA NA NA NA NA NA ...
$ LATITUDE : num 3040 3042 3340 3458 3412 ...
$ LONGITUDE : num 8812 8755 8742 8626 8642 ...
$ LATITUDE_E: num 3051 0 0 0 0 ...
$ LONGITUDE_: num 8806 0 0 0 0 ...
$ REMARKS : logi NA NA NA NA NA NA ...
$ REFNUM : num 1 2 3 4 5 6 7 8 9 10
The data set has 37 columns, several of those are relevant to the analysis at
hand, namely those that indicate the date the event was reported (BGN_DATE
),
in what US State the even occurred (STATE
), the event type (EVTYPE
), the
number of people dying (FATALITIES
) or being injured (INJURIES
) due to the
event, the economical cost of the damages (PROPDMG
, PROPDMGEXP
, CROPDMG
,
and CROPDMGEXP
)
# removing temporary data frame
rm(tmp1)
Reading, Cleaning and Normalizing the data
To simplify the analysis (and save time and memory), only the relevant columns will be read from the data file:
1 storm <- read.csv("StormData.csv.bz2", colClasses = c("NULL", "character", rep("NULL",
2 4), rep("character", 2), rep("NULL", 14), rep("numeric", 3), "character",
3 "numeric", "character", rep("NULL", 9)))
4 str(storm)
'data.frame': 902297 obs. of 9 variables:
$ BGN_DATE : chr "4/18/1950 0:00:00" "4/18/1950 0:00:00" "2/20/1951 0:00:00" "6/8/1951 0:00:00" ...
$ STATE : chr "AL" "AL" "AL" "AL" ...
$ EVTYPE : chr "TORNADO" "TORNADO" "TORNADO" "TORNADO" ...
$ FATALITIES: num 0 0 0 0 0 0 0 0 1 0 ...
$ INJURIES : num 15 0 2 2 2 6 1 0 14 0 ...
$ PROPDMG : num 25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25 ...
$ PROPDMGEXP: chr "K" "K" "K" "K" ...
$ CROPDMG : num 0 0 0 0 0 0 0 0 0 0 ...
$ CROPDMGEXP: chr "" "" "" "" ...
The read data set, contains 902297 rows and 9 columns.
According to the original data source, the event type column (EVTYPE
)
comprises a definite and limited vocabulary of 50 valid event names.
The list of valid events was extracted from the file pd01016005curr.pdf
(section 2.1.1 “Storm Data Event Table”), and saved to a csv file
(valid_events.csv
)
1 valid_events <- read.csv("valid_events.csv", stringsAsFactors = FALSE)
2 valid_events$Event.Name <- toupper(valid_events$Event.Name)
3 # number of valid event names
4 n_valid <- length(valid_events$Event.Name)
5 # number of unique event names in the data set
6 n_evtype <- length(unique(storm$EVTYPE))
7 goodrows <- subset(storm, EVTYPE %in% valid_events$Event.Name)$EVTYPE
8 fraction_good <- 100 * length(goodrows)/nrow(storm)
The crucial EVTYPE
column did contain more than the documented
50
unique values, in fact it had 985
possible distinct values.
Not only that, but only about 70.4% of the records in the data set correspond to the documented vocabulary for the event type.
Also, there seems to be a great diversity in the way some events have been recorded over the years, including misspellings, case-mixing, combination of a an event with some sort of numeric value, etc.
1 set.seed(567)
2 sample(unique(subset(storm, !EVTYPE %in% valid_events$Event.Name)$EVTYPE), 20)
[1] "Summary of July 26" "HIGH WIND (G40)"
[3] "Erosion/Cstl Flood" "RECORD SNOW/COLD"
[5] "STREET FLOOD" "GRADIENT WINDS"
[7] "HEAVY SNOW/WIND" "THUNERSTORM WINDS"
[9] "DRY PATTERN" "SNOWMELT FLOODING"
[11] "HEAVY SNOW AND ICE" "HEAVY SNOW/BLIZZARD"
[13] "HAIL 0.88" "TORNADO DEBRIS"
[15] "THUNDERSTORM WINDS/HAIL" "HIGH WIND/HEAVY SNOW"
[17] "COLD/WINDS" "Summary of June 16"
[19] "COLD" "HAIL 1.75"
Therefore, some serious data cleanup needs to be done on this column.
1 # normalize all to uppercase
2 storm$EVTYPE <- toupper(storm$EVTYPE)
3 events <- storm$EVTYPE
4 # replace extraneous chars by a single space
5 events <- gsub("( ){1,}", " ", gsub("[^A-Z0-9 ]", " ", events))
6 # FLOOD related events
7 events[grepl("COASTAL|STORM SURGE", events)] <- "COASTAL FLOOD"
8 events[grepl("FLASH", events)] <- "FLASH FLOOD"
9 events[!grepl("FLASH|COASTAL", events) & grepl("FLOOD", events)] <- "FLOOD"
10 events[grepl("STREAM|URBAN", events)] <- "FLOOD"
11 # HEAT related events
12 events[grepl("HEAT|DRY", events)] <- "EXCESSIVE HEAT"
13 events[grepl("HOT|WARM", events)] <- "EXCESSIVE HEAT"
14 events[grepl("RECORD (HIGH|.*TEMP)|HIGH TEMPERA", events)] <- "EXCESSIVE HEAT"
15 # COLD related events
16 events[grepl("SLEET", events)] <- "SLEET"
17 events[grepl("BLIZZARD", events)] <- "BLIZZARD"
18 events[grepl("EXTREME", events) & grepl("CHILL|COLD", events)] <- "EXTREME COLD/WIND CHILL"
19 events[!grepl("EXTREME", events) & grepl("CHILL|COLD", events)] <- "COLD/WIND CHILL"
20 events[grepl("LAKE", events) & grepl("SNOW", events)] <- "LAKE-EFFECT SNOW"
21 events[!grepl("LAKE", events) & grepl("SNOW", events)] <- "HEAVY SNOW"
22 events[grepl("FROST|FREEZE", events)] <- "FROST/FREEZE"
23 events[!grepl("FROST", events) & grepl("FREEZE", events)] <- "SLEET"
24 events[grepl("FREEZ", events) & grepl("RAIN", events)] <- "SLEET"
25 events[grepl("DRIZZLE", events)] <- "SLEET"
26 events[grepl("(RECORD LOW|LOW TEMP)", events)] <- "EXTREME COLD/WIND CHILL"
27 events[grepl("GLAZE", events)] <- "EXTREME COLD/WIND CHILL"
28 events[grepl("ICE", events)] <- "ICE STORM"
29 events[grepl("WINT", events)] <- "WINTER STORM"
30 events[grepl("HAIL", events)] <- "HAIL"
31 # WIND, RAIN and LIGHTING related events
32 events <- gsub("WINDS", "WIND", events)
33 events[!grepl("DERSTORM WIND", events) & grepl("THUN|TSTM", events)] <- "LIGHTNING"
34 events[grepl("LIGHT|LIGN", events)] <- "LIGHTNING"
35 events[grepl("DERSTORM WIND", events)] <- "THUNDERSTORM WIND"
36 events[grepl("TORN", events)] <- "TORNADO"
37 events[grepl("SPOUT", events)] <- "WATERSPOUT"
38 events[grepl("HURRICANE|TYPHOON", events)] <- "HURRICANE (TYPHOON)"
39 events[grepl("FIRE", events)] <- "WILDFIRE"
40 events[!grepl("MARINE", events) & grepl("HIGH WIND", events)] <- "HIGH WIND"
41 events[grepl("GUST", events)] <- "STRONG WIND"
42 events[!grepl("COLD|MARINE|THUNDER|STRONG|HIGH", events) & grepl("WIND", events)] <- "STRONG WIND"
43 events[grepl("FUNNEL", events)] <- "FUNNEL CLOUD"
44 events[grepl("TROPICAL STORM", events)] <- "TROPICAL STORM"
45 events[!grepl("FREEZIN", events) & grepl("FOG|VOG", events)] <- "DENSE FOG"
46 events[grepl("WET|RAIN|SHOWER|PRECIP", events)] <- "HEAVY RAIN"
47 # DUST related events
48 events[grepl("DUST DEVEL", events)] <- "DUST DEVIL"
49 events[!grepl("DEVIL", events) & grepl("DUST", events)] <- "DUST STORM"
50 # MARINE EVENTS
51 events[grepl("RIP CURRENT", events)] <- "RIP CURRENT"
52 events[!grepl("LOW", events) & grepl("TIDE|WAVE|SWELL", events)] <- "STORM SURGE/TIDE"
53 events[grepl("SURF", events)] <- "HIGH SURF"
54 # MISC events
55 events[grepl("VOLCAN", events)] <- "VOLCANIC ASH"
56 # Not a storm, but is there, so we will classify it
57 events[grepl("(MUD|LAND|ROCK).*SLIDE", events)] <- "LANDSLIDE"
58 # everything else
59 events[grepl("SUMMARY", events)] <- "OTHER/UNKOWN"
60 events[!events %in% c("LANDSLIDE", "OTHER", valid_events$Event.Name)] <- "OTHER/UNKNOWN"
61
62 # re-assign the cleaned up column values
63 storm$EVTYPE <- events
To be able to accumulate by year, a variable was created to store the value
extracted from the BGN_DATE
column
1 storm$BGN_DATE <- as.Date(storm$BGN_DATE, format = "%m/%d/%Y %H:%M:%S")
2 storm$year <- as.POSIXlt(storm$BGN_DATE)$year + 1900
Finally, to be able to estimate the monetary cost due to damage caused by the storms, we have to examine the appropriate columns.
1 # values in
2 tp <- table(storm$PROPDMGEXP)
3 tc <- table(storm$CROPDMGEXP)
4 pander(tp, caption = "*Property damage 'exponents'*", style = "rmarkdown")
- | ? | + | 0 | 1 | 2 | 3 | 4 | 5 | |
---|---|---|---|---|---|---|---|---|---|
465934 | 1 | 8 | 5 | 216 | 25 | 13 | 4 | 4 | 28 |
Table: Property damage ‘exponents’ (continued below)
6 | 7 | 8 | B | h | H | K | m | M |
---|---|---|---|---|---|---|---|---|
4 | 5 | 1 | 40 | 1 | 6 | 424665 | 7 | 11330 |
1 pander(tc, caption = "*Crop damage 'exponents'*", style = "rmarkdown")
? | 0 | 2 | B | k | K | m | M | |
---|---|---|---|---|---|---|---|---|
618413 | 7 | 19 | 1 | 9 | 21 | 281832 | 1 | 1994 |
Table: Crop damage ‘exponents’
It would seem that there are a mixture of coding standards for these columns, and the great majority of the “exponents” (multipliers really) correspond to a coding such that:
- H or h: x100
- K or k: x1000
- M or m: x1’000,000
- B or b: x1,000’000,000
The meaning of the other codes is not clear. Even after checking the documentation on the site that was the source for the data, several incompatible definitions could be glimpsed:
- The numbers are exponents base 10 ( \( 10^n \) )
- The numbers are really an artifact of conversion to CSV, and are part of the
decimals of the
PROPDMG
column. Even if we accept this interpretation, there is the issue as to whether the units are in thousands, millions, or billions - The numbers are used to indicate categories that represent ranges of values,
according to a 1959 document (“STORM DATA”, May 1959, Volume I No. 5)2:
- Cat. 1 –> Less than USD 50
- Cat. 2 –> USD 50 to USD 500
- Cat. 3 –> USD 500 to USD 5,000
- Cat. 4 –> USD 5,000 to USD 50,000
- Cat. 5 –> USD 50,000 to USD 500,000
- Cat. 6 –> USD 500,000 to USD 5’000,000
- Cat. 7 –> USD 5’000,000 to USD 50’000,000
- Cat. 8 –> USD 50’000,000 to USD 500’000,000
- Cat. 9 –> USD 500’000,000 to USD 5,000’000,000
The bottomline is that is not feasible to apply only one interpretation to the numeric codes in these columns.
To assertain if it would be possible to omit them in the analysis, we calculated
the percentage of these codes in the column, from among the records that have
a value for PROPDMG
1 storm$PROPDMGEXP <- toupper(storm$PROPDMGEXP)
2 storm$CROPDMGEXP <- toupper(storm$CROPDMGEXP)
3 pdmg_storm <- subset(storm, PROPDMG > 0)
4 cdmg_storm <- subset(storm, CROPDMG > 0)
5
6 undef_p <- 100 * sum(!pdmg_storm$PROPDMGEXP %in% c("B", "H", "K", "M"))/nrow(pdmg_storm)
7 undef_c <- 100 * sum(!cdmg_storm$CROPDMGEXP %in% c("B", "H", "K", "M"))/nrow(cdmg_storm)
8
9 badcode_storm <- data.frame(column = c("PROPDMGEXP", "CROPDMGEXP"), percent = c(paste0(round(undef_p,
10 3), "%"), paste0(round(undef_c, 3), "%")))
11 colnames(badcode_storm) <- c("Column", "Percent of undefined codes")
12 pander(badcode_storm, style = "rmarkdown")
Column | Percent of undefined codes |
---|---|
PROPDMGEXP | 0.134% |
CROPDMGEXP | 0.068% |
As can be seen, the fraction of records with uninterpretable codes is very small (<< 1%), thus we can safely drop them from the respective data frames.
1 pdmg_storm <- subset(pdmg_storm, PROPDMGEXP %in% c("B", "H", "K", "M"))
2 cdmg_storm <- subset(cdmg_storm, CROPDMGEXP %in% c("B", "H", "K", "M"))
Results
In the cleaned up storm
data set, there is an unequal distribution of the
reported events during the period under analysis, as can be seen from the
table below
1 # summary of all events
2 t_event <- storm %>% group_by(EVTYPE) %>% summarise(total = n()) %>% mutate(perc_total = 100 *
3 total/sum(total)) %>% arrange(desc(total))
4 # top 10
5 top10_events <- t_event[1:10, ]
6 top10_percent <- sum(top10_events$perc_total)
7 colnames(top10_events) <- c("Event Class", "Frequency", "Percentage of reports")
8 pander(top10_events, caption = "*Top 10 events reported in the storm data set*",
9 round = 2, style = "rmarkdown")
Event Class | Frequency | Percentage of reports |
---|---|---|
HAIL | 290400 | 32.18 |
LIGHTNING | 242116 | 26.83 |
THUNDERSTORM WIND | 109353 | 12.12 |
TORNADO | 60699 | 6.73 |
FLASH FLOOD | 55677 | 6.17 |
FLOOD | 29618 | 3.28 |
HIGH WIND | 21777 | 2.41 |
WINTER STORM | 19693 | 2.18 |
HEAVY SNOW | 16968 | 1.88 |
HEAVY RAIN | 11981 | 1.33 |
Table: Top 10 events reported in the storm data set
The top 10 events in the data set (vide supra) are responsible for 95.12% of the reports from 1950–2011
Human health impact
The data contains columns that can help us measure the impact of storms in Public Health, understood in term of the number of victims that suffer death or injury as a result of one of these events.
1 # records indicating impact on human health
2 hi_storm <- subset(storm, FATALITIES > 0 | INJURIES > 0)
3 hi_storm$victims <- hi_storm$FATALITIES + hi_storm$INJURIES
About 2.43% of the records in the Storm data indicate that there were human victims.
In the table below we can see the top 10 storm types (events) that impacted more human health in the time period under consideration
1 hi_table <- hi_storm %>% group_by(EVTYPE) %>% summarise(c_tot = sum(victims)) %>%
2 arrange(desc(c_tot)) %>% mutate(c_perc = 100 * c_tot/sum(c_tot), c_cummperc = cumsum(c_perc))
3 colnames(hi_table) <- c("Event type", "Deaths/Injuries", "Percent", "Cumm Percent")
4 pander(hi_table[1:10, ], caption = "Top 10 causes of death or injury due to storms [1950-2011]",
5 round = 1, style = "rmarkdown")
Event type | Deaths/Injuries | Percent | Cumm Percent |
---|---|---|---|
TORNADO | 97043 | 62.3 | 62.3 |
LIGHTNING | 13575 | 8.7 | 71.1 |
EXCESSIVE HEAT | 12453 | 8 | 79.1 |
FLOOD | 7386 | 4.7 | 83.8 |
FLASH FLOOD | 2837 | 1.8 | 85.6 |
THUNDERSTORM WIND | 2646 | 1.7 | 87.3 |
WINTER STORM | 2247 | 1.4 | 88.8 |
ICE STORM | 2234 | 1.4 | 90.2 |
HIGH WIND | 1750 | 1.1 | 91.3 |
WILDFIRE | 1698 | 1.1 | 92.4 |
Table: Top 10 causes of death or injury due to storms [1950-2011]
We can see that the top 10 causes comprise about 92.4% of all the victims affected in all those years, and that Tornadoes are by far the most important cause of death or injuries to humans.
The impact on humans has not been constant over the years, in fact there have been major events that went outside the norm, as can be seen in the graph below.
1 t_ph_year <- hi_storm %>% group_by(year) %>% summarize(t_fatal = sum(FATALITIES),
2 t_injur = sum(INJURIES))
3 pdeath <- ggplot(t_ph_year, aes(x = year, y = t_fatal)) + geom_line(stat = "identity",
4 col = "black", size = 1.5) + xlab("") + ylab("Number of deaths") + theme_bw() +
5 theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.margin = unit(c(1,
6 1, -1, 1), "cm"))
7 pinjur <- ggplot(t_ph_year, aes(x = year, y = t_injur)) + geom_line(stat = "identity",
8 col = "red", size = 1.5) + xlab("Year") + ylab("Number of injuries") + theme_bw() +
9 theme(plot.margin = unit(c(0, 1, 0, 1), "cm"))
10 grid.arrange(pdeath, pinjur, main = "Deaths and injuries due to storms [1950-2011]")
The graph shows events such as 1995’s Chicago Heat Wave3, shown as the maximum value in the top chart, which, during the month of July of that year caused about many deaths in a period of only five days4.
1 chicago1995 <- subset(hi_storm, STATE == "IL" & (BGN_DATE >= "1995-07-12" &
2 BGN_DATE <= "1995-07-16"))
3 chicago1995$BGN_DATE <- as.character(chicago1995$BGN_DATE)
4 pander(as.list(chicago1995[, 1:5]), style = "rmarkdown")
- BGN_DATE: 1995-07-12
- STATE: IL
- EVTYPE: EXCESSIVE HEAT
- FATALITIES: 583
- INJURIES: 0
Also of note are 1998’s South Texas floods 5 6, that in October of that year caused a great number of injuries and death. This event is responsible for the maximum value in the injuries plot.
1 texas1998 <- subset(hi_storm, STATE == "TX" & EVTYPE == "FLOOD" & year == 1998 &
2 months(hi_storm$BGN_DATE, abbreviate = TRUE) == "Oct") %>% group_by(BGN_DATE,
3 STATE, EVTYPE) %>% summarise(tot_fatal = sum(FATALITIES), tot_injur = sum(INJURIES))
4 texas1998$BGN_DATE <- as.character(texas1998$BGN_DATE)
5 colnames(texas1998) <- c("Date", "State", "Event", "Total deaths", "Total injuries")
6 pander(texas1998[, 1:5], split.tables = 120, style = "rmarkdown")
Date | State | Event | Total deaths | Total injuries |
---|---|---|---|---|
1998-10-17 | TX | FLOOD | 24 | 4510 |
1998-10-18 | TX | FLOOD | 0 | 1520 |
Financial impact
The storms have also had a negative financial impact due to damage produced to property and crops.
About 26.47% of records in the data set include an estimate for the property damage, and 2.45% have data on the cost of damage to crops.
To evaluate the costs, we will add a column that traduces the character code into a multiplier, which will allow us to calculate the appropriate amount in each event.
The top 10 events in terms of property damage are listed in the table below, with flooding being the number one source of property loss.
1 mults <- list(H = 10^2, K = 10^3, M = 10^6, B = 10^9)
2 pdmg_storm$multiplier <- sapply(pdmg_storm$PROPDMGEXP, function(x) {
3 return(mults[[as.character(x)]])
4 })
5 pdmg_storm$amount <- pdmg_storm$PROPDMG * pdmg_storm$multiplier
6 pdmg_storm$type <- "Property damage"
7 summ_pdmg <- pdmg_storm %>% group_by(EVTYPE) %>% summarise(total = sum(amount)/10^9) %>%
8 mutate(percent = 100 * total/sum(total)) %>% arrange(desc(total))
9 colnames(summ_pdmg) <- c("Event", "Cost (in Billions USD)", "Percent from total")
10 pander(summ_pdmg[1:10, ], round = 2, style = "rmarkdown")
Event | Cost (in Billions USD) | Percent from total |
---|---|---|
FLOOD | 150.2 | 35.16 |
HURRICANE (TYPHOON) | 85.36 | 19.97 |
TORNADO | 56.99 | 13.34 |
COASTAL FLOOD | 48.4 | 11.33 |
HAIL | 17.62 | 4.12 |
FLASH FLOOD | 16.91 | 3.96 |
WILDFIRE | 8.5 | 1.99 |
TROPICAL STORM | 7.71 | 1.81 |
WINTER STORM | 6.78 | 1.59 |
LIGHTNING | 6.65 | 1.56 |
And the correspoding events for crop damage shows that drought and flooding (two counterposed atmospheric events) are responsible for more that 50% of losses to crops.
1 cdmg_storm$multiplier <- sapply(cdmg_storm$CROPDMGEXP, function(x) {
2 return(mults[[as.character(x)]])
3 })
4 cdmg_storm$amount <- cdmg_storm$CROPDMG * cdmg_storm$multiplier
5 cdmg_storm$type <- "Crop damage"
6 summ_cdmg <- cdmg_storm %>% group_by(EVTYPE) %>% summarise(total = sum(amount)/10^9) %>%
7 mutate(percent = 100 * total/sum(total)) %>% arrange(desc(total))
8 colnames(summ_cdmg) <- c("Event", "Cost (in Billions USD)", "Percent from total")
9 pander(summ_cdmg[1:10, ], round = 2, style = "rmarkdown")
Event | Cost (in Billions USD) | Percent from total |
---|---|---|
DROUGHT | 13.97 | 28.45 |
FLOOD | 10.86 | 22.11 |
HURRICANE (TYPHOON) | 5.52 | 11.23 |
ICE STORM | 5.02 | 10.23 |
HAIL | 3.11 | 6.34 |
FROST/FREEZE | 2 | 4.07 |
FLASH FLOOD | 1.53 | 3.12 |
EXTREME COLD/WIND CHILL | 1.33 | 2.71 |
HEAVY RAIN | 0.95 | 1.94 |
EXCESSIVE HEAT | 0.9 | 1.84 |
When looking at the total losses per year over the study period, we observe a definite growth trend due to property damage by storms. Whereas, for crops there has been a decrease, at least since 1993, which is the first record of such losses in the data set.
For illustration purposes (because it might not be the best model for this data), we are superimposing a linear estimate, mainly to drive home the possible underlying trend.
1 dmg <- rbind(pdmg_storm %>% select(STATE, EVTYPE, year, amount, type), cdmg_storm %>%
2 select(STATE, EVTYPE, year, amount, type))
3 dmg$type <- as.factor(dmg$type)
4 summyr_dmg <- dmg %>% group_by(type, year) %>% summarise(yr_damage = sum(amount)) %>%
5 arrange(type, year)
6 dmg_yr_plot <- ggplot(summyr_dmg, aes(x = year, y = yr_damage/10^9, colour = type)) +
7 geom_point(aes(group = type)) + scale_y_log10() + geom_smooth(method = "lm") +
8 ylab("Damage in billions of USD") + xlab("Year") + ggtitle("Property and Crop Damage caused by storms [1950-2011]") +
9 scale_color_discrete(guide = FALSE) + facet_wrap(~type, nrow = 1) + theme_bw()
10 dmg_yr_plot
Some non-exhaustive reasons could be advanced for these trends:
- There has been a steady increase in the size and density of urban populations, so storms can generate a bigger financial loss beacuse over the same area.
- There has been a decrease in the population of rural areas, and an increase in the yield of crops due to modernization of the agricultural methods.
- There is better forecasting and/or advanced warning of impending storms, so farmers can take measures to minimize loss.
Reproducibility information
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] gridExtra_0.9.1 pander_0.3.8 ggplot2_1.0.0 dplyr_0.2
[5] knitr_1.6 setwidth_1.0-3
loaded via a namespace (and not attached):
[1] assertthat_0.1 codetools_0.2-9 colorspace_1.2-2 digest_0.6.4
[5] evaluate_0.5.5 formatR_0.10 gtable_0.1.2 labeling_0.2
[9] magrittr_1.0.1 MASS_7.3-33 munsell_0.4.2 parallel_3.1.1
[13] plyr_1.8.1 proto_0.3-10 Rcpp_0.11.2 reshape2_1.4
[17] scales_0.2.4 stringr_0.6.2 tools_3.1.1
The source code for this document can be found at the URL: https://gist.github.com/jmcastagnetto/c4f9dad8f7b0fc146198
This document was originally published in RPubs at the URL: http://rpubs.com/jesuscastagnetto/storms-impact
- As this data comes from USA’s NOAA, we are using the “billion” definition commonly employed there, namely \( 10^9 \), equivalent to the ISO Giga- [return]
- http://www1.ncdc.noaa.gov/pub/data/swdi/stormevents/pub-pdf/storm_1959_05.pdf [return]
- http://en.wikipedia.org/wiki/1995_Chicago_heat_wave [return]
- http://www.annals.org/cgi/content/abstract/129/3/173 [return]
- http://en.wikipedia.org/wiki/October_1998_Texas_Flooding [return]
- http://www.nws.noaa.gov/om/assessments/pdfs/txflood.pdf [return]