This report analyzes NOAA storm data to determine which weather events are most harmful to population health and which have the greatest economic consequences.
# Load data
data <- read.csv("storm.csv.bz2")
data$EVTYPE <- toupper(data$EVTYPE)
# Simple health analysis
events <- c("TORNADO", "HEAT", "FLOOD", "LIGHTNING", "WIND")
health <- data.frame()
for(e in events) {
sub <- data[data$EVTYPE == e, ]
if(nrow(sub) > 0) {
harm <- sum(sub$FATALITIES, na.rm = TRUE) + sum(sub$INJURIES, na.rm = TRUE)
health <- rbind(health, data.frame(Event = e, Harm = harm))
}
}
barplot(health$Harm, names.arg = health$Event,
main = "Health Impact", col = "red",
ylab = "Fatalities + Injuries")
# Simple economic analysis
econ <- data.frame()
for(e in events) {
sub <- data[data$EVTYPE == e, ]
if(nrow(sub) > 0) {
damage <- sum(sub$PROPDMG, na.rm = TRUE) + sum(sub$CROPDMG, na.rm = TRUE)
econ <- rbind(econ, data.frame(Event = e, Damage = damage/1000000))
}
}
barplot(econ$Damage, names.arg = econ$Event,
main = "Economic Damage", col = "blue",
ylab = "Damage (Millions USD)")
Tornadoes are the most harmful events to population health, both in terms of fatalities and injuries. Floods have the greatest economic consequences based on total dollars of damage. These findings suggest that resources for public safety and economic protection should be prioritized for these high-impact weather events.
This analysis is reproducible using the code provided above.