This analysis explores the NOAA Storm Database to identify the types of severe weather events that are most harmful to population health and have the greatest economic consequences across the United States. Using R for data processing and visualization, we examined event types to quantify their impact on fatalities, injuries, property damage, and crop damage. The findings highlight the significant threats posed by certain weather events and can inform resource allocation for disaster preparedness and response.
The data for this analysis comes from the NOAA Storm Database, which contains records of severe weather events in the United States. The raw data file (repdata_data_StormData.csv.bz2) was loaded directly into R for processing. The steps involved in data processing included:
The compressed CSV file was read into an R dataframe. Subsetting the Data: We selected relevant columns for analysis, including event type, fatalities, injuries, property damage, and crop damage. Data Cleaning: Missing values were handled, and event types were standardized for consistency. Transformation: Economic damage values were converted to a common unit (e.g., millions of dollars) for comparison.
# Install and load necessary packages
if (!requireNamespace("readr", quietly = TRUE)) {
install.packages("readr")
}
if (!requireNamespace("dplyr", quietly = TRUE)) {
install.packages("dplyr")
}
if (!requireNamespace("ggplot2", quietly = TRUE)) {
install.packages("ggplot2")
}
library(readr)
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)
# Download and load the data
url <- "http://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(url, destfile = "repdata_data_StormData.csv.bz2", method = "curl")
data <- read_csv("repdata_data_StormData.csv.bz2")
## Rows: 902297 Columns: 37
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (18): BGN_DATE, BGN_TIME, TIME_ZONE, COUNTYNAME, STATE, EVTYPE, BGN_AZI,...
## dbl (18): STATE__, COUNTY, BGN_RANGE, COUNTY_END, END_RANGE, LENGTH, WIDTH, ...
## lgl (1): COUNTYENDN
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Subset the data
data <- data %>% select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)
# Clean and transform data
# Convert property and crop damage to a common unit
convert_damage <- function(damage, exp) {
exp <- toupper(exp)
factor <- ifelse(exp == "K", 1e3, ifelse(exp == "M", 1e6, ifelse(exp == "B", 1e9, 1)))
return(damage * factor)
}
data <- data %>%
mutate(PROPDMG = convert_damage(PROPDMG, PROPDMGEXP),
CROPDMG = convert_damage(CROPDMG, CROPDMGEXP)) %>%
select(EVTYPE, FATALITIES, INJURIES, PROPDMG, CROPDMG)
To determine which types of events are most harmful to population health, we summed the fatalities and injuries for each event type and identified the top contributors.
# Summarize health impact
health_impact <- data %>%
group_by(EVTYPE) %>%
summarize(Total_Fatalities = sum(FATALITIES, na.rm = TRUE),
Total_Injuries = sum(INJURIES, na.rm = TRUE)) %>%
arrange(desc(Total_Fatalities + Total_Injuries))
# Plot the top 10 events
top_health_impact <- health_impact %>% top_n(10, Total_Fatalities + Total_Injuries)
ggplot(top_health_impact, aes(x = reorder(EVTYPE, -(Total_Fatalities + Total_Injuries)), y = Total_Fatalities + Total_Injuries)) +
geom_bar(stat = "identity") +
labs(title = "Top 10 Weather Events by Health Impact", x = "Event Type", y = "Total Fatalities and Injuries") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
To assess the economic impact, we combined property and crop damage for each event type and highlighted the events causing the most financial loss.
# Summarize economic impact
economic_impact <- data %>%
group_by(EVTYPE) %>%
summarize(Total_Damage = sum(PROPDMG + CROPDMG, na.rm = TRUE)) %>%
arrange(desc(Total_Damage))
# Plot the top 10 events
top_economic_impact <- economic_impact %>% top_n(10, Total_Damage)
ggplot(top_economic_impact, aes(x = reorder(EVTYPE, -Total_Damage), y = Total_Damage / 1e6)) +
geom_bar(stat = "identity") +
labs(title = "Top 10 Weather Events by Economic Impact", x = "Event Type", y = "Total Damage (in millions USD)") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
The analysis reveals that tornadoes are the most harmful weather events to population health, causing the highest number of fatalities and injuries. Floods and hurricanes, on the other hand, lead to the greatest economic losses, primarily due to extensive property and crop damage. These insights can help prioritize resources for disaster preparedness and response to mitigate the impacts of severe weather events.
Figure 1: Top 10 Weather Events by Health Impact Figure 1 shows the top 10 weather events that have caused the most fatalities and injuries combined.
Figure 2: Top 10 Weather Events by Economic Impact Figure 2 displays the top 10 weather events based on total economic damage (property and crop damage combined).