Introduction

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.

This report involves exploring 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.

Two fundamental questions will be investigated: 1. Across the United States, which types of events are most harmful with respect to population health? 2.Across the United States, which types of events have the greatest economic consequences?

Data Analysis Review

Population health impact was measured as number of fatalities and number of injuries for a particular adverse weather event. Since weather events vary in there ratio of fatalities to injuries these two metrics were not combined. The mean injuries and fatalities for each weather event type was computed and then the weather events were ranked from highest to lowest fatalties and injuries seperately. Weather events that ranked in the top 30 fatalities or top 30 injuries were then plotted. It appears that overall heat waves, Tropical Storm Gordon and wild fires had the highest number of people injured or killed. However, these mostly consisted of injuries. The three weather events leading to the most deathes were Tornadoes, Cold and Snow and Tropcial Storm Gordon.

The economic analysis combined the property and crop damage into a total damage in dollars. The average damage in dollar amount was computed for each event type and the top 30 were ranked and plotted. Tornadoes, Hurricane Opal and Hurricane/Typhoon were top 3.

Overall, Tornadoes are among the worst weather events as they cause the highest fatalities and the highest combined property and crop damage.

Data Processing

Load the data and necessary libraries.

suppressMessages(library(tidyverse))
## Warning: package 'tidyverse' was built under R version 3.2.5
## Warning: package 'ggplot2' was built under R version 3.2.5
## Warning: package 'tibble' was built under R version 3.2.5
## Warning: package 'tidyr' was built under R version 3.2.5
## Warning: package 'readr' was built under R version 3.2.5
## Warning: package 'purrr' was built under R version 3.2.5
## Warning: package 'dplyr' was built under R version 3.2.5
storm<-read_csv("storm.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.

Create a dataset called health. Calculate and rank the average fatalities and injuries for each weatehr event type. Keep only the top 30 fatality and injury ranks.

health<-
            storm %>%
              select(EVTYPE,FATALITIES,INJURIES) %>%
              group_by(EVTYPE) %>%
              summarize(
                Avg_Fatality=mean(FATALITIES,na.rm=TRUE),
                Avg_Injury=mean(INJURIES, na.rm=TRUE)
                ) %>%
              mutate(rank_fatality=min_rank(Avg_Fatality)) %>%
              mutate(rank_injury=min_rank(Avg_Injury)) %>%
              arrange(desc(rank_fatality,rank_injury)) %>%
              filter(rank_fatality>=948 | rank_injury>=948)

Reshape the data into a dataset called average to make an identity bar plot in the results.

##reshape data to make identity bar plot
fatality<-
            health %>%
             select(EVTYPE, Avg_Fatality) %>%
            rename(Average=Avg_Fatality) %>%
            mutate(flag="fatality")
injury<-
            health %>%
              select(EVTYPE, Avg_Injury) %>%
              rename(Average=Avg_Injury) %>%
              mutate(flag="injury")

average<-rbind(fatality,injury) 

Transform the dollar values to include the actual numeric values rather than the short form symbols (e.g., K=1000). This is done for both the property and crop damage and then these values are summed to get a total damage in dollars for each event. Calculate and rank the average damage in dollars for each weather event type and keep only the top 30.

damage<-
storm %>%
  select(EVTYPE,PROPDMG,PROPDMGEXP,CROPDMG,CROPDMGEXP) %>%
  mutate(prop_dollar=ifelse(PROPDMGEXP=="K",PROPDMG*1000,
                       ifelse(PROPDMGEXP=="M",PROPDMG*1000000,
                      ifelse(PROPDMGEXP=="B",PROPDMG*1000000000,NA)))) %>%
  mutate(crop_dollar= ifelse(CROPDMGEXP=="K",PROPDMG*1000,
                       ifelse(CROPDMGEXP=="M",PROPDMG*1000000,
                    ifelse(CROPDMGEXP=="B",PROPDMG*1000000000,NA)))) %>% 
  filter (!is.na(prop_dollar) | !is.na(crop_dollar)) %>%
  mutate(dollars=prop_dollar+crop_dollar) %>%
group_by(EVTYPE) %>%
  summarize(avg_dollars=mean(dollars,na.rm=TRUE))%>%
  mutate(rank_dollars=min_rank(avg_dollars)) %>%
              arrange(desc(avg_dollars))%>%
              filter(rank_dollars>=94)

Results

1.Population Health

ggplot(data=average, mapping=aes(reorder(EVTYPE,Average),Average, fill=flag))+
geom_bar(stat="identity")+
  labs(x="Weather Event Type",y="Average Number of People",title="USA Average Fatalities and Injuries for Extreme Weather Events", fill="Legend")+
  coord_flip()

Figure 1: Top 30 Mean Fatalities and Injuries plotted by Weather Event Type

—-> Heat Wave, Tropical Storm Gordon and Wild Fires among the highest combined injuries and fatalities and injuries alone. —-> Tornadoes, TSTM, Wind, Hail, Cold and Snow and Tropical Storm Gordon highest fatalties

2.Economic

  ggplot(data=damage,mapping=aes(reorder(x=EVTYPE,avg_dollars),y=avg_dollars))+
  geom_bar(stat="identity",fill="red")+
  labs(x="Weather Event Type", y="Dollars ($)", title="Average Damage Cost for Weather Events")+
  coord_flip()

Figure 2: Top 30 Mean Damage ($) plotted by Weather Event Type

—->Tornadoes, TSTM, Wind, Hail, Hurricane Opal and Hurricane/Typhoon were the top 3 weather events that caused the most economic damage.