Synopsis

This report analyzes the impact of severe weather events on both public health and the economy in the United States using the NOAA Storm Database. The data spans over several decades, recording characteristics of major storms and weather phenomena. For public health impact, we aggregate and evaluate the total number of fatalities and injuries across different event types to find the most harmful events. For economic impact, we look into property and crop damages, converting exponential codes to compute total financial losses. The results clearly indicate that tornadoes are the most devastating events for human health, causing the highest number of casualties. On the other hand, floods inflict the greatest economic consequences overall, leading to billions of dollars in property and crop damages. Other events like excessive heat and hurricanes also pose significant threats but vary in their specific types of damage. This comprehensive analysis provides crucial insights for emergency management and resource allocation to mitigate future disasters.

Data Processing

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
# Loading the storm data
storm <- read.csv("repdata_data_StormData1.csv")

# Filtering and selecting relevant variables
sub_storm <- storm %>%
 select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)

Results

1. Public Health Impact

To find the most harmful weather events to public health, we sum up the total casualties (Fatalities + Injuries) for each event type.

health_data <- sub_storm %>%
 group_by(EVTYPE) %>%
 summarize(Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
           Total_Injuries = sum(INJURIES, na.rm = TRUE),
           Total_Casualties = sum(FATALITIES + INJURIES, na.rm = TRUE)) %>%
 arrange(desc(Total_Casualties)) %>%
 slice(1:5)
## `summarise()` ungrouping output (override with `.groups` argument)
# Plotting the health impact
ggplot(health_data, aes(x = reorder(EVTYPE, -Total_Casualties), y = Total_Casualties, fill = EVTYPE)) +
 geom_bar(stat = "identity") +
 theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
 labs(title = "Top 5 Harmful Weather Events to Public Health",
      x = "Event Type", y = "Total Casualties") +
 theme(legend.position = "none")

2. Economic Consequences

We convert the exponential multipliers (K = Thousands, M = Millions, B = Billions) to calculate the actual total cost of damages.

# Function to convert exponential expressions to numbers
convert_exp <- function(x) {
 x <- toupper(x)
 if (x == "K") return(1000)
 if (x == "M") return(1000000)
 if (x == "B") return(1000000000)
 return(1)
}

sub_storm$PROP_MULT <- sapply(sub_storm$PROPDMGEXP, convert_exp)
sub_storm$CROP_MULT <- sapply(sub_storm$CROPDMGEXP, convert_exp)

# Calculating total cost
economic_data <- sub_storm %>%
 mutate(Prop_Cost = PROPDMG * PROP_MULT,
        Crop_Cost = CROPDMG * CROP_MULT,
        Total_Cost = Prop_Cost + Crop_Cost) %>%
 group_by(EVTYPE) %>%
 summarize(Total_Damage = sum(Total_Cost, na.rm = TRUE)) %>%
 arrange(desc(Total_Damage)) %>%
 slice(1:5)
## `summarise()` ungrouping output (override with `.groups` argument)
# Plotting the economic impact
ggplot(economic_data, aes(x = reorder(EVTYPE, -Total_Damage), y = Total_Damage/1e+09, fill = EVTYPE)) +
 geom_bar(stat = "identity") +
 theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
 labs(title = "Top 5 Weather Events with Greatest Economic Impact",
      x = "Event Type", y = "Total Damage (in Billions USD)") +
 theme(legend.position = "none")