This analysis examines the NOAA Storm Database to identify which types of weather events are most harmful to population health and which have the greatest economic consequences. Population health impact is measured using fatalities and injuries, while economic impact is measured using property and crop damage. The data is aggregated by event type to identify the most significant contributors. The results show that tornadoes are the most harmful to human health, while floods and hurricanes contribute most to economic damage.
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)
data <- read.csv("repdata_data_StormData.csv.bz2")
data$EVTYPE <- toupper(data$EVTYPE)
health <- data %>%
group_by(EVTYPE) %>%
summarise(
fatalities = sum(FATALITIES, na.rm = TRUE),
injuries = sum(INJURIES, na.rm = TRUE)
) %>%
mutate(total = fatalities + injuries) %>%
arrange(desc(total))
top_health <- head(health, 10)
ggplot(top_health, aes(x = reorder(EVTYPE, total), y = total)) +
geom_bar(stat = "identity") +
coord_flip() +
labs(title = "Top 10 Harmful Weather Events",
x = "Event Type",
y = "Fatalities + Injuries")
economic <- data %>%
group_by(EVTYPE) %>%
summarise(
prop = sum(PROPDMG, na.rm = TRUE),
crop = sum(CROPDMG, na.rm = TRUE)
) %>%
mutate(total = prop + crop) %>%
arrange(desc(total))
top_econ <- head(economic, 10)
ggplot(top_econ, aes(x = reorder(EVTYPE, total), y = total)) +
geom_bar(stat = "identity") +
coord_flip() +
labs(title = "Top 10 Costly Weather Events",
x = "Event Type",
y = "Economic Damage")
The analysis shows that tornadoes are the most harmful events in terms of population health, causing the highest number of injuries and fatalities. Excessive heat and floods also contribute significantly. In terms of economic consequences, floods, hurricanes, and storm surges result in the greatest financial damage. These findings highlight the importance of prioritizing preparedness for these types of events.