Synopsis

This analysis explores the NOAA Storm Database to evaluate the impact of severe weather events in the United States from 1950 to 2011. The goal is to identify which types of events are most harmful to population health and which have the greatest economic consequences. Fatalities and injuries are used to measure health impact, while property and crop damage are used to assess economic impact. The analysis shows that tornadoes are most harmful to public health, and floods cause the greatest economic damage.


Data Processing

Loading Required Libraries

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
# Read the compressed CSV data
storm_data <- read.csv("repdata_data_StormData.csv.bz2")


# View dimensions and column names
dim(storm_data)
## [1] 902297     37
names(storm_data)
##  [1] "STATE__"    "BGN_DATE"   "BGN_TIME"   "TIME_ZONE"  "COUNTY"    
##  [6] "COUNTYNAME" "STATE"      "EVTYPE"     "BGN_RANGE"  "BGN_AZI"   
## [11] "BGN_LOCATI" "END_DATE"   "END_TIME"   "COUNTY_END" "COUNTYENDN"
## [16] "END_RANGE"  "END_AZI"    "END_LOCATI" "LENGTH"     "WIDTH"     
## [21] "F"          "MAG"        "FATALITIES" "INJURIES"   "PROPDMG"   
## [26] "PROPDMGEXP" "CROPDMG"    "CROPDMGEXP" "WFO"        "STATEOFFIC"
## [31] "ZONENAMES"  "LATITUDE"   "LONGITUDE"  "LATITUDE_E" "LONGITUDE_"
## [36] "REMARKS"    "REFNUM"
storm_data <- storm_data %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)


# Convert damage exponent to numeric multiplier
storm_data <- storm_data %>%
  mutate(PROPDMGEXP = toupper(PROPDMGEXP),
         CROPDMGEXP = toupper(CROPDMGEXP),
         prop_multiplier = case_when(
           PROPDMGEXP == "K" ~ 1e3,
           PROPDMGEXP == "M" ~ 1e6,
           PROPDMGEXP == "B" ~ 1e9,
           TRUE ~ 1
         ),
         crop_multiplier = case_when(
           CROPDMGEXP == "K" ~ 1e3,
           CROPDMGEXP == "M" ~ 1e6,
           CROPDMGEXP == "B" ~ 1e9,
           TRUE ~ 1
         ),
         total_prop_damage = PROPDMG * prop_multiplier,
         total_crop_damage = CROPDMG * crop_multiplier,
         total_economic_damage = total_prop_damage + total_crop_damage)
# Summarize fatalities and injuries by event type
health_impact <- storm_data %>%
  group_by(EVTYPE) %>%
  summarise(fatalities = sum(FATALITIES, na.rm = TRUE),
            injuries = sum(INJURIES, na.rm = TRUE)) %>%
  arrange(desc(fatalities + injuries)) %>%
  slice(1:10)

# Plot
ggplot(health_impact, aes(x = reorder(EVTYPE, fatalities + injuries), 
                          y = fatalities + injuries)) +
  geom_bar(stat = "identity", fill = "tomato") +
  coord_flip() +
  labs(title = "Top 10 Weather Events Harmful to Population Health",
       x = "Event Type", y = "Total Fatalities & Injuries")

# Summarize economic damage by event type
economic_impact <- storm_data %>%
  group_by(EVTYPE) %>%
  summarise(total_damage = sum(total_economic_damage, na.rm = TRUE)) %>%
  arrange(desc(total_damage)) %>%
  slice(1:10)

# Plot
ggplot(economic_impact, aes(x = reorder(EVTYPE, total_damage), 
                            y = total_damage / 1e9)) +
  geom_bar(stat = "identity", fill = "steelblue") +
  coord_flip() +
  labs(title = "Top 10 Weather Events by Economic Damage",
       x = "Event Type", y = "Total Damage (Billion USD)")