The greatest people and economic consequences of storms in United State of America

Aranda N. Alfredo

sypnosis: In this study of the exploring the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database, I find out that the Tornados cause more fatalities and injuries people than other phenomena. In both cases, the excessive head is the second cause of death, however, Flood, Lightening and TSTM Wind provoke injured people in the same scale that first one. Finally, the events that have the greatest economic consequences is the Flood.

Data Processing

The data is re-called “stormdata” to simplfy its reading on Rstudio. I define a neew variable that contains just fatalities and injuries people.

# reading datasets from website NOAA
library(readr)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.4.3
stormdata <- read_csv("stormdata.csv")
## Parsed with column specification:
## cols(
##   .default = col_character(),
##   STATE__ = col_double(),
##   COUNTY = col_double(),
##   BGN_RANGE = col_double(),
##   COUNTY_END = col_double(),
##   END_RANGE = col_double(),
##   LENGTH = col_double(),
##   WIDTH = col_double(),
##   F = col_integer(),
##   MAG = col_double(),
##   FATALITIES = col_double(),
##   INJURIES = col_double(),
##   PROPDMG = col_double(),
##   CROPDMG = col_double(),
##   LATITUDE = col_double(),
##   LONGITUDE = col_double(),
##   LATITUDE_E = col_double(),
##   LONGITUDE_ = col_double(),
##   REFNUM = col_double()
## )
## See spec(...) for full column specifications.
stormDataNew <- data.frame(as.character(stormdata$EVTYPE),stormdata$FATALITIES,stormdata$INJURIES, stormdata$PROPDMG)
colnames(stormDataNew) <- c("EVTYPE","FATALITIES","INJURIES","PROPDMG")

Results

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

I aggregated fatalities and Injuries people by sum function and plot it greater than mean of this one.

Fatalities<- aggregate(FATALITIES ~ EVTYPE,stormDataNew, sum)
Fatalities<-Fatalities[Fatalities$FATALITIES>(mean(Fatalities$FATALITIES)),]
ggplot(aes(x=EVTYPE,y=FATALITIES),data=Fatalities)+
      geom_bar(stat = "identity",aes(fill = -FATALITIES))+
      coord_flip() +  
      theme(text = element_text(size=9),axis.text.x=element_text(angle=90, hjust=1))+ 
      labs(title="Total Fatalities by type of Storm", x="", y="Total Fatalities")

Injuries<- aggregate(INJURIES ~ EVTYPE,stormDataNew, sum)
Injuries<-Injuries[Injuries$INJURIES>(mean(Injuries$INJURIES)),]
ggplot(aes(x=EVTYPE,y=INJURIES),data=Injuries)+
      geom_bar(stat = "identity",aes(fill = -INJURIES))+
      coord_flip() +  
      theme(text = element_text(size=9),axis.text.x=element_text(angle=90, hjust=1))+ 
      labs(title="Total Injuries by type of Storm", x="", y="Total Injuries")

Havening this result, Tornado storms are most harmful phenomenon.

Q2 :Across the United States, which types of events have the greatest economic consequences?

Note here that PROPDMGEXP variable have thousands, millions and billions of dollars, in consequense, I created another variable called ecodamage that give the maximum impact economy caused by any storm,

ecoda<-stormdata[stormdata$PROPDMG>0&stormdata$PROPDMGEXP %in% c("K","M","B"),c("EVTYPE","PROPDMG","PROPDMGEXP")]
multi<-data.frame(PROPDMGEXP=c("K","M","B"),multiplier=c(1000,1000000,1000000000))
ecoda<-merge(ecoda,multi,by= "PROPDMGEXP")
ecoda$DAMAGE<-ecoda$PROPDMG*ecoda$multi/1000000000
ecodamage<- aggregate(DAMAGE ~ EVTYPE,ecoda, sum)
ecodamage<-ecodamage[ecodamage$DAMAGE>(mean(ecodamage$DAMAGE)),]
ggplot(aes(x=EVTYPE,,y=DAMAGE),data=ecodamage)+
      geom_bar(stat = "identity",aes(fill = -DAMAGE))+
      coord_flip() + 
      theme(axis.text.x=element_text(angle=90, hjust=1)) +
      labs(title="Total Damage($ billion) by type of Storm", x="", y="Total Damages")