Synopsis

Storms and other severe weather events can cause both public health and economic problems for communities and municipalities. Many severe events can result in fatalities, injuries, and property damage, and preventing such outcomes to the extent possible is a key concern.

This project involves exploring the U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database. This database tracks characteristics of major storms and weather events in the United States, including when and where they occur, as well as estimates of any fatalities, injuries, and property damage.

Data Loading

We load the data from the csv file and trim it down to only the columns that we need for the analysis.

StormDataFile <- read.csv("StormData.csv")
head(StormDataFile)
##   STATE__           BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE
## 1       1  4/18/1950 0:00:00     0130       CST     97     MOBILE    AL
## 2       1  4/18/1950 0:00:00     0145       CST      3    BALDWIN    AL
## 3       1  2/20/1951 0:00:00     1600       CST     57    FAYETTE    AL
## 4       1   6/8/1951 0:00:00     0900       CST     89    MADISON    AL
## 5       1 11/15/1951 0:00:00     1500       CST     43    CULLMAN    AL
## 6       1 11/15/1951 0:00:00     2000       CST     77 LAUDERDALE    AL
##    EVTYPE BGN_RANGE BGN_AZI BGN_LOCATI END_DATE END_TIME COUNTY_END
## 1 TORNADO         0                                               0
## 2 TORNADO         0                                               0
## 3 TORNADO         0                                               0
## 4 TORNADO         0                                               0
## 5 TORNADO         0                                               0
## 6 TORNADO         0                                               0
##   COUNTYENDN END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG FATALITIES
## 1         NA         0                      14.0   100 3   0          0
## 2         NA         0                       2.0   150 2   0          0
## 3         NA         0                       0.1   123 2   0          0
## 4         NA         0                       0.0   100 2   0          0
## 5         NA         0                       0.0   150 2   0          0
## 6         NA         0                       1.5   177 2   0          0
##   INJURIES PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP WFO STATEOFFIC ZONENAMES
## 1       15    25.0          K       0                                    
## 2        0     2.5          K       0                                    
## 3        2    25.0          K       0                                    
## 4        2     2.5          K       0                                    
## 5        2     2.5          K       0                                    
## 6        6     2.5          K       0                                    
##   LATITUDE LONGITUDE LATITUDE_E LONGITUDE_ REMARKS REFNUM
## 1     3040      8812       3051       8806              1
## 2     3042      8755          0          0              2
## 3     3340      8742          0          0              3
## 4     3458      8626          0          0              4
## 5     3412      8642          0          0              5
## 6     3450      8748          0          0              6
dim(StormDataFile)
## [1] 902297     37
StormData <- StormDataFile[ , c(8, 23:28)]
rm(StormDataFile)
head(StormData)
##    EVTYPE FATALITIES INJURIES PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP
## 1 TORNADO          0       15    25.0          K       0           
## 2 TORNADO          0        0     2.5          K       0           
## 3 TORNADO          0        2    25.0          K       0           
## 4 TORNADO          0        2     2.5          K       0           
## 5 TORNADO          0        2     2.5          K       0           
## 6 TORNADO          0        6     2.5          K       0

1. Across the United States, which types of events (as indicated in the EVTYPE variable) are most harmful with respect to population health?

Data Processing

We calculate the aggregate of fatalities and injuries caused by the different event types

Injuries <- aggregate(INJURIES~EVTYPE, StormData, sum)
Injuries <- arrange(Injuries, desc(INJURIES))
Injuries <- Injuries[1:20, ]
Injuries
##                EVTYPE INJURIES
## 1             TORNADO    91346
## 2           TSTM WIND     6957
## 3               FLOOD     6789
## 4      EXCESSIVE HEAT     6525
## 5           LIGHTNING     5230
## 6                HEAT     2100
## 7           ICE STORM     1975
## 8         FLASH FLOOD     1777
## 9   THUNDERSTORM WIND     1488
## 10               HAIL     1361
## 11       WINTER STORM     1321
## 12  HURRICANE/TYPHOON     1275
## 13          HIGH WIND     1137
## 14         HEAVY SNOW     1021
## 15           WILDFIRE      911
## 16 THUNDERSTORM WINDS      908
## 17           BLIZZARD      805
## 18                FOG      734
## 19   WILD/FOREST FIRE      545
## 20         DUST STORM      440
Fatalities <- aggregate(FATALITIES~EVTYPE, StormData, sum)
Fatalities <- arrange(Fatalities, desc(FATALITIES))
Fatalities <- Fatalities[1:20, ]
Fatalities
##                     EVTYPE FATALITIES
## 1                  TORNADO       5633
## 2           EXCESSIVE HEAT       1903
## 3              FLASH FLOOD        978
## 4                     HEAT        937
## 5                LIGHTNING        816
## 6                TSTM WIND        504
## 7                    FLOOD        470
## 8              RIP CURRENT        368
## 9                HIGH WIND        248
## 10               AVALANCHE        224
## 11            WINTER STORM        206
## 12            RIP CURRENTS        204
## 13               HEAT WAVE        172
## 14            EXTREME COLD        160
## 15       THUNDERSTORM WIND        133
## 16              HEAVY SNOW        127
## 17 EXTREME COLD/WIND CHILL        125
## 18             STRONG WIND        103
## 19                BLIZZARD        101
## 20               HIGH SURF        101

Results

We plot the results by merging the fatality and injury datasets

HealthHarm <- merge(Fatalities, Injuries, by.x = "EVTYPE", by.y = "EVTYPE")
HealthHarm <-arrange (HealthHarm,desc(FATALITIES+INJURIES))
Events <- HealthHarm$EVTYPE
barplot(t(HealthHarm[,-1]), names.arg = Events, ylim = c(0,95000), beside = T, cex.names = 0.8, las=2, col = c("light blue", "dark blue"), main="Events Harmful for Population Health")
legend("topright",c("Fatalities","Injuries"),fill=c("light blue","dark blue"),bty = "n")

From the plot above, we see that Tornados are most harmful for population health.

2. Across the United States, which types of events have the greatest economic consequences?

Data Processing

We convert the propdmg and cropdmg data from factors H,K, etc to numbers

StormData$PROPDAMAGE = 0
StormData[StormData$PROPDMGEXP == "H", ]$PROPDAMAGE = StormData[StormData$PROPDMGEXP == "H", ]$PROPDMG * 10^2
StormData[StormData$PROPDMGEXP == "K", ]$PROPDAMAGE = StormData[StormData$PROPDMGEXP == "K", ]$PROPDMG * 10^3
StormData[StormData$PROPDMGEXP == "M", ]$PROPDAMAGE = StormData[StormData$PROPDMGEXP == "M", ]$PROPDMG * 10^6
StormData[StormData$PROPDMGEXP == "B", ]$PROPDAMAGE = StormData[StormData$PROPDMGEXP == "B", ]$PROPDMG * 10^9

StormData$CROPDAMAGE = 0
StormData[StormData$CROPDMGEXP == "H", ]$CROPDAMAGE = StormData[StormData$CROPDMGEXP == "H", ]$CROPDMG * 10^2
StormData[StormData$CROPDMGEXP == "K", ]$CROPDAMAGE = StormData[StormData$CROPDMGEXP == "K", ]$CROPDMG * 10^3
StormData[StormData$CROPDMGEXP == "M", ]$CROPDAMAGE = StormData[StormData$CROPDMGEXP == "M", ]$CROPDMG * 10^6
StormData[StormData$CROPDMGEXP == "B", ]$CROPDAMAGE = StormData[StormData$CROPDMGEXP == "B", ]$CROPDMG * 10^9

We calculate the aggregate of economic damage by merging propdmg and cropdmg

EconomicHarm <- aggregate(PROPDAMAGE + CROPDAMAGE ~ EVTYPE, StormData, sum)
names(EconomicHarm) = c("EVENT_TYPE", "TOTAL_DAMAGE")
EconomicHarm <- arrange(EconomicHarm, desc(TOTAL_DAMAGE))
EconomicHarm <- EconomicHarm[1:20, ]
EconomicHarm$TOTAL_DAMAGE <- EconomicHarm$TOTAL_DAMAGE/10^9
EconomicHarm$EVENT_TYPE <- factor(EconomicHarm$EVENT_TYPE, levels = EconomicHarm$EVENT_TYPE)
head(EconomicHarm)
##          EVENT_TYPE TOTAL_DAMAGE
## 1             FLOOD    150.31968
## 2 HURRICANE/TYPHOON     71.91371
## 3           TORNADO     57.34061
## 4       STORM SURGE     43.32354
## 5              HAIL     18.75290
## 6       FLASH FLOOD     17.56213

Results

We plot the results to understand the economic damage

with(EconomicHarm, barplot(TOTAL_DAMAGE, names.arg = EVENT_TYPE, beside = T, cex.names = 0.8, las=2, col = "purple", main = "Total Property and Crop Damage by Top 20 Event Types", ylab = "Total Damage in USD (10^9)"))

From the plot above, we see that Floods are most harmful for economic damage.