Introduction

This analysis explores the effects of severe weather events on population health and the economy using the U.S. National Oceanic and Atmospheric Administration (NOAA) Storm Database.

storm_data <- read.csv("repdata_data_StormData (1).csv.bz2")

storm_data$BGN_DATE <- as.Date(
  sub(" .*", "", storm_data$BGN_DATE),
  format = "%m/%d/%Y"
)

storm_data$EVTYPE <- toupper(storm_data$EVTYPE)

Population Health Analysis

health_impact <- aggregate(
  cbind(FATALITIES, INJURIES) ~ EVTYPE,
  data = storm_data,
  FUN = sum
)

health_impact <- health_impact[
  order(
    -health_impact$FATALITIES,
    -health_impact$INJURIES
  ),
]

head(health_impact, 10)
##             EVTYPE FATALITIES INJURIES
## 758        TORNADO       5633    91346
## 116 EXCESSIVE HEAT       1903     6525
## 138    FLASH FLOOD        978     1777
## 243           HEAT        937     2100
## 418      LIGHTNING        816     5230
## 779      TSTM WIND        504     6957
## 154          FLOOD        470     6789
## 524    RIP CURRENT        368      232
## 320      HIGH WIND        248     1137
## 19       AVALANCHE        224      170

Economic Impact Analysis

prop_multiplier <- ifelse(
  toupper(storm_data$PROPDMGEXP) == "K", 1000,
  ifelse(
    toupper(storm_data$PROPDMGEXP) == "M", 1000000,
    ifelse(
      toupper(storm_data$PROPDMGEXP) == "B", 1000000000,
      1
    )
  )
)

crop_multiplier <- ifelse(
  toupper(storm_data$CROPDMGEXP) == "K", 1000,
  ifelse(
    toupper(storm_data$CROPDMGEXP) == "M", 1000000,
    ifelse(
      toupper(storm_data$CROPDMGEXP) == "B", 1000000000,
      1
    )
  )
)

storm_data$PROPERTY_DAMAGE <- storm_data$PROPDMG * prop_multiplier
storm_data$CROP_DAMAGE <- storm_data$CROPDMG * crop_multiplier

economic_impact <- aggregate(
  cbind(PROPERTY_DAMAGE, CROP_DAMAGE) ~ EVTYPE,
  data = storm_data,
  FUN = sum
)

economic_impact$TOTAL_DAMAGE <-
  economic_impact$PROPERTY_DAMAGE +
  economic_impact$CROP_DAMAGE

economic_impact <- economic_impact[
  order(-economic_impact$TOTAL_DAMAGE),
]

head(economic_impact, 10)
##                EVTYPE PROPERTY_DAMAGE CROP_DAMAGE TOTAL_DAMAGE
## 154             FLOOD    144657709807  5661968450 150319678257
## 372 HURRICANE/TYPHOON     69305840000  2607872800  71913712800
## 758           TORNADO     56937160779   414953270  57352114049
## 599       STORM SURGE     43323536000        5000  43323541000
## 212              HAIL     15732267048  3025954473  18758221521
## 138       FLASH FLOOD     16140812067  1421317100  17562129167
## 84            DROUGHT      1046106000 13972566000  15018672000
## 363         HURRICANE     11868319010  2741910000  14610229010
## 529       RIVER FLOOD      5118945500  5029459000  10148404500
## 387         ICE STORM      3944927860  5022113500   8967041360

Results

Events Most Harmful to Population Health

top_health <- head(health_impact, 10)

barplot(
  top_health$FATALITIES,
  names.arg = top_health$EVTYPE,
  las = 2,
  main = "Top 10 Events by Fatalities",
  ylab = "Total Fatalities",
  cex.names = 0.7
)

Events with Greatest Economic Consequences

top_economic <- head(economic_impact, 10)

barplot(
  top_economic$TOTAL_DAMAGE,
  names.arg = top_economic$EVTYPE,
  las = 2,
  main = "Top 10 Events by Total Economic Damage",
  ylab = "Total Damage (US Dollars)",
  cex.names = 0.7
)

Conclusion

The analysis identifies the severe weather events that have the greatest effects on population health and the economy. Population health was evaluated using fatalities and injuries, while economic consequences were evaluated using property and crop damage after applying the reported damage multipliers. The results show that tornadoes have a particularly large impact on both human health and economic losses.