This report analyzes NOAA storm data to determine which weather events are most harmful to population health and which have the greatest economic consequences.
The data for this analysis come from the U.S. National Oceanic and Atmospheric Administration (NOAA) Storm Database. The dataset is provided as a compressed CSV file and is loaded directly into R. Only relevant variables are selected, and damage values are converted into numeric form using the provided exponent fields.
# Load data
data <- read.csv("storm.csv.bz2")
data$EVTYPE <- toupper(data$EVTYPE)
## Processing Population Health Data
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))
}
}
## Processing Economic Damage Data
# 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(health$Harm, names.arg = health$Event,
main = "Health Impact", col = "red",
ylab = "Fatalities + Injuries")
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. Tornadoes have the greatest economic consequences based on total dollars of damage in this analysis. These findings suggest that resources for public safety and economic protection should be prioritized for tornadoes, as they impact both health and economy significantly.
This analysis is reproducible using the code provided above.