It is well known that storms and other severe weather events cause both public health and economic problems for communities and municipalities. To demonstrate this, the following analysis has the objective of inspecting the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. This done with the purpose of obtaining useful information about the impact of storms and other severe weather events. Since our analysis is driven by an economic and health focus, we will mostly take into consideration the estimates of any fatalities, injuries, property damage and crop damage.
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(knitr)
setwd("~/Documents/Online Courses/John Hopkins Data Science Specialization/(Course 5) Reproducible Research")
df <- read.csv("repdata_data_StormData.csv")
In the following section, the analysis of how storms and other severe weather events cause public health problems for communities and municipalities is provided. The main variables to study are “EVTYPE”, “FATALITIES” and “INJURIES”.
df.fatalities <- df %>% select(EVTYPE, FATALITIES) %>% group_by(EVTYPE) %>% summarise(total.fatalities=sum(FATALITIES))
df.fatalities.arranged <- arrange(df.fatalities, desc(total.fatalities))
df.injuries <- df %>% select(EVTYPE, INJURIES) %>% group_by(EVTYPE) %>% summarise(total.injuries = sum(INJURIES))
df.injuries.arranged <- arrange(df.injuries, desc(total.injuries))
df.health <- merge(df.fatalities.arranged, df.injuries.arranged, by = "EVTYPE")
df.health$total.injuries.and.fatalities = df.health$total.fatalities+df.health$total.injuries
df.health.arranged <- arrange(df.health, desc(total.injuries.and.fatalities))
df.health <- merge(df.fatalities.arranged, df.injuries.arranged, by = "EVTYPE")
df.health$total.injuries.and.fatalities = df.health$total.fatalities+df.health$total.injuries
df.health.arranged <- arrange(df.health, desc(total.injuries.and.fatalities))
In the following section, the analysis of how storms and other severe weather events cause economic problems for communities and municipalities is provided. The main variables to study are “EVTYPE”, “PROPDMG” and “CROPDMG”.
df.propdmg <- df %>% select(EVTYPE, PROPDMG) %>% group_by(EVTYPE) %>% summarise(total.property.damage = sum(PROPDMG)) %>% arrange(desc(total.property.damage))
df.cropdmg <- df %>% select(EVTYPE, CROPDMG) %>% group_by(EVTYPE) %>% summarise(total.crop.damage = sum(CROPDMG)) %>% arrange(desc(total.crop.damage))
ggplot(data = df.fatalities.arranged[1:10,], aes(x=reorder(EVTYPE, -total.fatalities), y=total.fatalities)) +
geom_bar(stat = "identity", color = "steel blue 4") +
theme(axis.text.x = element_text(face="bold", color="#993333", size=8, angle=65)) +
ggtitle("Top 10 fatalities caused by severe weather") +
xlab("Severe weather event") +
ylab("Number of fatalities")
ggplot(data = df.injuries.arranged[1:10,], aes(x=reorder(EVTYPE, -total.injuries), y=total.injuries)) +
geom_bar(stat = "identity", color = "steel blue 4") +
theme(axis.text.x = element_text(size=8, angle=65)) +
ggtitle("Top 10 injuries caused by severe weather") +
xlab("Severe weather event") +
ylab("Number of injuries")
ggplot(data = df.propdmg[1:10,], aes(x=reorder(EVTYPE, -total.property.damage/1000), y=total.property.damage/1000)) +
geom_bar(stat = "identity", color = "forestgreen") +
theme(axis.text.x = element_text(size=8, angle=65)) +
ggtitle("Top 10 highest economic losses caused by severe weather") +
xlab("Severe weather event") +
ylab("Total economic impact")
We can conclude from the data processing and data analysis that the severe weather event which causes the greatest economic growth and greatest fatality and injury rate are tornadoes. Flas floods, floods, Ligthning and TSTM Winds are also weather events of great concern given that they are in the top 10 weather events with the most negative economic and health impact. Regarding this analysis, it is important to take into consideration the results to take action into preventing such outcomes to the extent possible.