Synopsis

This analysis examines severe weather events recorded in the NOAA Storm Database and evaluates their effects on population health and the economy in the United States. Population health effects are measured using the total number of fatalities and injuries associated with each event type. Economic consequences are estimated using reported property and crop damage after converting the damage exponent variables into monetary values. The results identify the event types associated with the greatest health and economic impacts. The analysis begins with the original compressed NOAA Storm Database and performs all data processing within R to ensure reproducibility.

Data Processing

The analysis begins with the original compressed CSV file supplied for the assignment. The data are loaded directly into R without any preprocessing outside the R Markdown document.

storm <- read.csv("repdata_data_StormData.csv.bz2",
                  stringsAsFactors = FALSE)

dim(storm)
## [1] 902297     37

Population Health Variables

Population health impact is measured using the total number of fatalities and injuries associated with each event type. Event type names are converted to uppercase and trimmed to reduce differences caused by capitalization or extra spaces.

storm$EVTYPE <- toupper(trimws(storm$EVTYPE))

health <- aggregate(cbind(FATALITIES, INJURIES) ~ EVTYPE,
                    data = storm,
                    FUN = sum,
                    na.rm = TRUE)

health$TOTAL <- health$FATALITIES + health$INJURIES

health <- health[order(health$TOTAL, decreasing = TRUE), ]

topHealth <- head(health, 10)

topHealth
##                EVTYPE FATALITIES INJURIES TOTAL
## 750           TORNADO       5633    91346 96979
## 108    EXCESSIVE HEAT       1903     6525  8428
## 771         TSTM WIND        504     6957  7461
## 146             FLOOD        470     6789  7259
## 410         LIGHTNING        816     5230  6046
## 235              HEAT        937     2100  3037
## 130       FLASH FLOOD        978     1777  2755
## 379         ICE STORM         89     1975  2064
## 677 THUNDERSTORM WIND        133     1488  1621
## 880      WINTER STORM        206     1321  1527

Economic Damage Variables

Economic impact is measured using reported property damage and crop damage. The NOAA database stores the numerical damage amount separately from an exponent variable. Common exponent values such as K, M, and B represent thousands, millions, and billions of dollars, respectively. These exponent values are converted to numerical multipliers before property and crop damage are combined.

convert_exp <- function(x) {
    x <- toupper(trimws(as.character(x)))
    
    multiplier <- rep(1, length(x))
    
    multiplier[x == "H"] <- 1e2
    multiplier[x == "K"] <- 1e3
    multiplier[x == "M"] <- 1e6
    multiplier[x == "B"] <- 1e9
    
    digit <- grepl("^[0-9]$", x)
    multiplier[digit] <- 10^as.numeric(x[digit])
    
    multiplier
}

storm$PROPDMG_VALUE <- storm$PROPDMG * convert_exp(storm$PROPDMGEXP)

storm$CROPDMG_VALUE <- storm$CROPDMG * convert_exp(storm$CROPDMGEXP)

storm$TOTAL_DAMAGE <- storm$PROPDMG_VALUE + storm$CROPDMG_VALUE

economic <- aggregate(TOTAL_DAMAGE ~ EVTYPE,
                      data = storm,
                      FUN = sum,
                      na.rm = TRUE)

economic <- economic[
    order(economic$TOTAL_DAMAGE, decreasing = TRUE), ]

topEconomic <- head(economic, 10)

topEconomic
##                EVTYPE TOTAL_DAMAGE
## 146             FLOOD 150319678257
## 364 HURRICANE/TYPHOON  71913712800
## 750           TORNADO  57362333946
## 591       STORM SURGE  43323541000
## 204              HAIL  18761221986
## 130       FLASH FLOOD  18244041078
## 76            DROUGHT  15018672000
## 355         HURRICANE  14610229010
## 521       RIVER FLOOD  10148404500
## 379         ICE STORM   8967041360

Results

Events Most Harmful to Population Health

Population health impact was evaluated using the combined number of fatalities and injuries for each event type. Tornadoes produced the largest combined health impact in the NOAA Storm Database, with 96,979 reported fatalities and injuries. Excessive heat, thunderstorm wind, floods, and lightning were also among the event types with the greatest health impacts.

par(mar = c(5, 10, 4, 2))

barplot(
    rev(topHealth$TOTAL),
    names.arg = rev(topHealth$EVTYPE),
    horiz = TRUE,
    las = 1,
    xlab = "Total Fatalities and Injuries",
    main = "Weather Events Most Harmful to Health"
)
Figure 1. Ten severe weather event types associated with the greatest combined number of fatalities and injuries in the United States.

Figure 1. Ten severe weather event types associated with the greatest combined number of fatalities and injuries in the United States.

Events with the Greatest Economic Consequences

Economic consequences were evaluated using the combined reported property and crop damage for each event type. Floods produced the greatest total economic damage, at approximately $150.3 billion. Hurricane/typhoon events, tornadoes, storm surges, and hail were also associated with substantial economic losses.

par(mar = c(5, 11, 4, 2))

barplot(
    rev(topEconomic$TOTAL_DAMAGE / 1e9),
    names.arg = rev(topEconomic$EVTYPE),
    horiz = TRUE,
    las = 1,
    xlab = "Total Damage (Billions of Dollars)",
    main = "Weather Events with Highest Economic Damage"
)
Figure 2. Ten severe weather event types associated with the greatest combined property and crop damage in the United States.

Figure 2. Ten severe weather event types associated with the greatest combined property and crop damage in the United States.