This analysis examines the impact of severe weather events in the U.S. on public health and economic losses using NOAA Storm Data. Tornadoes cause the most fatalities and injuries, making them the most harmful to population health. For economic damage, floods lead by far, followed by hurricanes and tornadoes. Property and crop damages were calculated using reported values and standardized exponent codes. Event types were normalized to ensure consistency. Visualizations supported the identification of the top 10 most harmful events.
Import NOAA Storm Database
storm_data <- read.csv("repdata_data_StormData.csv.bz2")
Select relevant columns for the analysis of the most harmful event types and convert EVTYPE to upper case for consistency
health_data <- storm_data %>%
select(EVTYPE, FATALITIES, INJURIES) %>%
mutate(EVTYPE = toupper(EVTYPE))
Convert Exponents to Multipliers
# Set multipliers and replace with 1 if not in map
economic_data <- storm_data %>%
mutate(
PROPDMGEXP = toupper(PROPDMGEXP),
CROPDMGEXP = toupper(CROPDMGEXP),
prop_multiplier = recode(PROPDMGEXP,
"K" = 1e3, "M" = 1e6, "B" = 1e9,
"0" = 1, "1" = 10, "2" = 100, "3" = 1000,
"4" = 1e4, "5" = 1e5, "6" = 1e6,
"7" = 1e7, "8" = 1e8, "9" = 1e9,
.default = 1),
crop_multiplier = recode(CROPDMGEXP,
"K" = 1e3, "M" = 1e6, "B" = 1e9,
"0" = 1, "1" = 10, "2" = 100, "3" = 1000,
"4" = 1e4, "5" = 1e5, "6" = 1e6,
"7" = 1e7, "8" = 1e8, "9" = 1e9,
.default = 1)
)
Summarize Health Impact by Event Type
health_impact <- health_data %>%
group_by(EVTYPE) %>%
summarise(
total_fatalities = sum(FATALITIES, na.rm = TRUE),
total_injuries = sum(INJURIES, na.rm = TRUE),
total_harmed = total_fatalities + total_injuries
) %>%
arrange(desc(total_harmed))
Calculate Actual Damages
economic_data <- economic_data %>%
mutate(
property_damage = PROPDMG * prop_multiplier,
crop_damage = CROPDMG * crop_multiplier,
total_damage = property_damage + crop_damage,
EVTYPE = toupper(EVTYPE) # Normalize event types
)
Group by Event Type
economic_impact <- economic_data %>%
group_by(EVTYPE) %>%
summarise(total_property_damage = sum(property_damage, na.rm = TRUE),
total_crop_damage = sum(crop_damage, na.rm = TRUE),
total_economic_damage = sum(total_damage, na.rm = TRUE)) %>%
arrange(desc(total_economic_damage))
View Top 10 Most Harmful Events
top_events <- head(health_impact, 10)
print(top_events)
## # A tibble: 10 × 4
## EVTYPE total_fatalities total_injuries total_harmed
## <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
Visualization
ggplot(top_events, aes(x = reorder(EVTYPE, total_harmed), y = total_harmed)) +
geom_bar(stat = "identity", fill = "red") +
coord_flip() +
labs(title = "Top 10 Harmful Weather Events to Population Health",
x = "Event Type", y = "Total People Harmed (Fatalities + Injuries)")
View Top 10 Most Economically Damaging Events
top_economic_events <- head(economic_impact, 10)
print(top_economic_events)
## # A tibble: 10 × 4
## EVTYPE total_property_damage total_crop_damage total_economic_damage
## <chr> <dbl> <dbl> <dbl>
## 1 FLOOD 144657709807 5661968450 150319678257
## 2 HURRICANE/TYPH… 69305840000 2607872800 71913712800
## 3 TORNADO 56947380676. 414953270 57362333946.
## 4 STORM SURGE 43323536000 5000 43323541000
## 5 HAIL 15735267018. 3025954473 18761221491.
## 6 FLASH FLOOD 16822673978. 1421317100 18243991078.
## 7 DROUGHT 1046106000 13972566000 15018672000
## 8 HURRICANE 11868319010 2741910000 14610229010
## 9 RIVER FLOOD 5118945500 5029459000 10148404500
## 10 ICE STORM 3944927860 5022113500 8967041360
Visualization
ggplot(top_economic_events, aes(x = reorder(EVTYPE, total_economic_damage), y = total_economic_damage)) +
geom_bar(stat = "identity", fill = "darkgreen") +
coord_flip() +
labs(title = "Top 10 Weather Events by Economic Damage",
x = "Event Type", y = "Total Damage (USD)")