knitr::opts_chunk$set(echo = TRUE, cache = TRUE)
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(ggplot2)
library(tidyr)
This report analyzes the NOAA Storm Database to determine which severe weather events cause the most severe consequences regarding population health and economic damage across the United States. By processing storm records from 1950 to 2011, we aggregate total fatalities, injuries, and property/crop damage by event type (EVTYPE). The findings indicate that specific weather phenomena disproportionately impact public safety and financial infrastructure. Government and municipal managers can utilize these insights to prioritize emergency preparedness resources and disaster mitigation strategies effectively.
In this section, we load the raw storm data directly from the source archive, clean the event types, and compute the total health and economic impact metrics.
csv_file <- "StormData.csv"
storm_data <- read.csv(csv_file)
We aggregate fatalities and injuries by event type to evaluate population health impact.
health_data <- storm_data %>%
group_by(EVTYPE) %>%
summarise(
Fatalities = sum(FATALITIES, na.rm = TRUE),
Injuries = sum(INJURIES, na.rm = TRUE),
Total_Health_Impact = Fatalities + Injuries
) %>%
arrange(desc(Total_Health_Impact))
# Top 10 harmful weather events for health
top_health <- head(health_data, 10)
print(top_health)
## # A tibble: 10 × 4
## EVTYPE Fatalities Injuries Total_Health_Impact
## <chr> <dbl> <dbl> <dbl>
## 1 TORNADO 5633 91346 96979
## 2 EXCESSIVE HEAT 1903 6525 8428
## 3 TSTM WIND 504 6957 7461
## 4 FLOOD 470 6789 7259
## 5 LIGHTNING 816 5230 6046
## 6 HEAT 937 2100 3037
## 7 FLASH FLOOD 978 1777 2755
## 8 ICE STORM 89 1975 2064
## 9 THUNDERSTORM WIND 133 1488 1621
## 10 WINTER STORM 206 1321 1527
We convert property and crop damage exponent characters (PROPDMGEXP, CROPDMGEXP) into numerical multipliers to calculate total economic loss.
# Function to convert exponent letters to multipliers
get_multiplier <- function(exp) {
exp <- toupper(as.character(exp))
case_when(
exp == "H" ~ 100,
exp == "K" ~ 1000,
exp == "M" ~ 1e6,
exp == "B" ~ 1e9,
exp %in% c("1", "2", "3", "4", "5", "6", "7", "8") ~ 10^as.numeric(exp),
TRUE ~ 1
)
}
economic_data <- storm_data %>%
mutate(
Prop_Multiplier = get_multiplier(PROPDMGEXP),
Crop_Multiplier = get_multiplier(CROPDMGEXP),
Total_Prop_Damage = PROPDMG * Prop_Multiplier,
Total_Crop_Damage = CROPDMG * Crop_Multiplier,
Total_Economic_Damage = Total_Prop_Damage + Total_Crop_Damage
) %>%
group_by(EVTYPE) %>%
summarise(Economic_Damage = sum(Total_Economic_Damage, na.rm = TRUE)) %>%
arrange(desc(Economic_Damage))
## Warning: There were 2 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `Prop_Multiplier = get_multiplier(PROPDMGEXP)`.
## Caused by warning:
## ! NAs introduced by coercion
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
# Top 10 weather events with greatest economic consequences
top_economic <- head(economic_data, 10)
print(top_economic)
## # A tibble: 10 × 2
## EVTYPE Economic_Damage
## <chr> <dbl>
## 1 FLOOD 150319678257
## 2 HURRICANE/TYPHOON 71913712800
## 3 TORNADO 57362333946.
## 4 STORM SURGE 43323541000
## 5 HAIL 18761221986.
## 6 FLASH FLOOD 18243991078.
## 7 DROUGHT 15018672000
## 8 HURRICANE 14610229010
## 9 RIVER FLOOD 10148404500
## 10 ICE STORM 8967041360
In this section, we present our findings using figures that visualize the events most harmful to health and the economy.
top_health_long <- top_health %>%
select(EVTYPE, Fatalities, Injuries) %>%
pivot_longer(cols = c(Fatalities, Injuries), names_to = "Damage_Type", values_to = "Count")
ggplot(top_health_long, aes(x = reorder(EVTYPE, Count), y = Count, fill = Damage_Type)) +
geom_bar(stat = "identity") +
coord_flip() +
labs(
title = "Top 10 Weather Events Most Harmful to US Population Health",
x = "Event Type",
y = "Number of Casualties",
fill = "Casualty Type"
) +
theme_minimal()
### Figure 2: Top Weather Events with Greatest Economic Consequences
ggplot(top_economic, aes(x = reorder(EVTYPE, Economic_Damage / 1e9), y = Economic_Damage / 1e9)) +
geom_bar(stat = "identity", fill = "steelblue") +
coord_flip() +
labs(
title = "Top 10 Weather Events with Greatest Economic Consequences",
x = "Event Type",
y = "Total Damage (in Billions USD)"
) +
theme_minimal()