Storms and other severe weather events can cause both public health and economic problems for communities and municipalities. Many severe events can result in fatalities, injuries, and property damage, and preventing such outcomes to the extent possible is a key concern.
Here we analyse the data from U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database and list the key events which are most harmful with respect to population health and have greter economic consequencies.
Those appears to be Tornado with greatest impact on both aspects (health and economic).
Data are loaded from the provided URL.
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2",
destfile='stormdata.csv.bz2')
#read data into dataframe
stormdata <- read.csv("stormdata.csv.bz2")
In order to analyse the events which affect most on health and economic we need to group data by event type and calculate for each type summary statistics.
library(tidyverse)
fatalities <- stormdata %>%
group_by(EVTYPE) %>% #group by Event type
summarize(Fatalities=sum(FATALITIES, na.rm = TRUE)) %>% #calculate summary of fatalities
arrange(desc(Fatalities)) #sort by descending order
injuries <- stormdata %>%
group_by(EVTYPE) %>%#group by Event type
summarize(Injuries=sum(INJURIES, na.rm = TRUE)) %>%#calculate summary of injuries
arrange(desc(Injuries))#sort by descending order
In order to asses economic impact we sum the effect of property damage and crop damage.
prop_crop <- stormdata %>%
group_by(EVTYPE) %>%#group by Event type
summarise(all_damage=sum(CROPDMG,na.rm=TRUE)+sum(PROPDMG,na.rm=TRUE))%>%
arrange(desc(all_damage))
health_sum <- stormdata %>%
group_by(EVTYPE) %>%#group by Event type
summarise(health_damage=sum(FATALITIES,na.rm=TRUE)+sum(INJURIES,na.rm=TRUE))%>%
arrange(desc(health_damage))
Because there are a lot of data we’ll limit for display purposes only top 10 events for both categories: health and economic.
g1 <- ggplot(fatalities[1:10,])+
geom_col(aes(x=reorder(EVTYPE,-Fatalities) ,y=Fatalities),fill="salmon")+
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
xlab(label="Event types")+
ggtitle("Fatalties per event type")
g2 <- ggplot(injuries[1:10,])+
geom_col(aes(x=reorder(EVTYPE,-Injuries) ,y=Injuries),fill="turquoise")+
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
xlab(label="Event types")+
ggtitle("Injuries per event type")
library(gridExtra)
grid.arrange(g1,g2,nrow=1)
ggplot(health_sum[1:10,])+
geom_col(aes(x=reorder(EVTYPE,-health_damage),y=health_damage),
fill="sienna",alpha=.9)+
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
xlab(label="Event types")+
ylab(label="Health damage")+
ggtitle("Top 10 Health damage by event type")
The most dangerous for public health is tornado, followed by excessive heat.
ggplot(prop_crop[1:10,])+
geom_col(aes(x=reorder(EVTYPE,-all_damage),y=all_damage),
fill="violetred",alpha=.9)+
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
xlab(label="Event types")+
ylab(label="Damage, USD")+
ggtitle("Top 10 economic damage by event type")
As could be seen the top harmful even is tornado, followed by flash flood.