Synopsis

This analysis examines the U.S. NOAA Storm Database to identify which weather events are most harmful to population health and which have the greatest economic consequences. The dataset spans from 1950 to 2011. Data were processed to calculate total fatalities, injuries, and economic damage by event type. Results show that tornadoes have the greatest impact on population health, while floods and hurricanes cause the most economic damage. The findings highlight key areas for disaster preparedness and resource allocation. All results are reproducible from the raw dataset.


Data Processing

Loading Required Libraries

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.3.3
## 
## 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)

Loading the Data (Local File)

# Load the dataset directly
storm_data <- read.csv("C:/Users/tniles/Documents/RR Course project 2/repdata_data_StormData.csv", stringsAsFactors = FALSE)

### Selecting Relevant Variables
data <- storm_data %>%
  select(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)

Data Transformation

# Function to convert damage exponent values
convert_exp <- function(exp) {
  ifelse(exp == "K", 1e3,
  ifelse(exp == "M", 1e6,
  ifelse(exp == "B", 1e9, 1)))
}

# Apply transformations
data <- data %>%
  mutate(
    PROP_MULT = convert_exp(PROPDMGEXP),
    CROP_MULT = convert_exp(CROPDMGEXP),
    PROP_DAMAGE = PROPDMG * PROP_MULT,
    CROP_DAMAGE = CROPDMG * CROP_MULT,
    TOTAL_DAMAGE = PROP_DAMAGE + CROP_DAMAGE,
    HEALTH_IMPACT = FATALITIES + INJURIES
  )

Aggregating Data

# Health impact
health_summary <- data %>%
  group_by(EVTYPE) %>%
  summarise(TOTAL_HEALTH = sum(HEALTH_IMPACT, na.rm = TRUE)) %>%
  arrange(desc(TOTAL_HEALTH)) %>%
  slice(1:10)

# Economic impact
economic_summary <- data %>%
  group_by(EVTYPE) %>%
  summarise(TOTAL_DAMAGE = sum(TOTAL_DAMAGE, na.rm = TRUE)) %>%
  arrange(desc(TOTAL_DAMAGE)) %>%
  slice(1:10)

Results

Most Harmful Events to Population Health

ggplot(health_summary, aes(x = reorder(EVTYPE, TOTAL_HEALTH), y = TOTAL_HEALTH)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  labs(
    title = "Top 10 Weather Events Harmful to Population Health",
    x = "Event Type",
    y = "Total Fatalities and Injuries"
  )

Figure 1: Tornadoes are the most harmful events in terms of population health, followed by excessive heat and floods.


Events with Greatest Economic Consequences

ggplot(economic_summary, aes(x = reorder(EVTYPE, TOTAL_DAMAGE), y = TOTAL_DAMAGE)) +
  geom_bar(stat = "identity") +
  coord_flip() +
  labs(
    title = "Top 10 Weather Events by Economic Damage",
    x = "Event Type",
    y = "Total Damage (USD)"
  )

Figure 2: Floods, hurricanes/typhoons, and storm surges cause the highest economic losses.


Summary Tables

health_summary
## # A tibble: 10 × 2
##    EVTYPE            TOTAL_HEALTH
##    <chr>                    <dbl>
##  1 TORNADO                  96979
##  2 EXCESSIVE HEAT            8428
##  3 TSTM WIND                 7461
##  4 FLOOD                     7259
##  5 LIGHTNING                 6046
##  6 HEAT                      3037
##  7 FLASH FLOOD               2755
##  8 ICE STORM                 2064
##  9 THUNDERSTORM WIND         1621
## 10 WINTER STORM              1527
economic_summary
## # A tibble: 10 × 2
##    EVTYPE             TOTAL_DAMAGE
##    <chr>                     <dbl>
##  1 FLOOD             150319678257 
##  2 HURRICANE/TYPHOON  71913712800 
##  3 TORNADO            57340614060.
##  4 STORM SURGE        43323541000 
##  5 HAIL               18752904943.
##  6 FLASH FLOOD        17562129167.
##  7 DROUGHT            15018672000 
##  8 HURRICANE          14610229010 
##  9 RIVER FLOOD        10148404500 
## 10 ICE STORM           8967041360

Conclusion

The analysis shows that tornadoes have the greatest impact on population health, while floods and hurricanes lead to the highest economic damage. These findings can assist policymakers in prioritizing disaster preparedness and resource allocation.