Impact of weather events on population health and economic damage

This report is addressed to public authorities responsible for preserving the safety of the population and maintaining economic activity. In this study, the US National Oceanic and Atmospheric Administration (NOAA) storm database was used. 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 deaths, injuries, and property damage. The objective of this study was to try to identify the climate events most harmful to the health of the population and economic activity.

Data Processing

The first step is to load the database from NOAA and inspect the variables.

df <- read.csv("repdata_data_StormData.csv.bz2")
str(df)
## 'data.frame':    902297 obs. of  37 variables:
##  $ STATE__   : num  1 1 1 1 1 1 1 1 1 1 ...
##  $ BGN_DATE  : chr  "4/18/1950 0:00:00" "4/18/1950 0:00:00" "2/20/1951 0:00:00" "6/8/1951 0:00:00" ...
##  $ BGN_TIME  : chr  "0130" "0145" "1600" "0900" ...
##  $ TIME_ZONE : chr  "CST" "CST" "CST" "CST" ...
##  $ COUNTY    : num  97 3 57 89 43 77 9 123 125 57 ...
##  $ COUNTYNAME: chr  "MOBILE" "BALDWIN" "FAYETTE" "MADISON" ...
##  $ STATE     : chr  "AL" "AL" "AL" "AL" ...
##  $ EVTYPE    : chr  "TORNADO" "TORNADO" "TORNADO" "TORNADO" ...
##  $ BGN_RANGE : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ BGN_AZI   : chr  "" "" "" "" ...
##  $ BGN_LOCATI: chr  "" "" "" "" ...
##  $ END_DATE  : chr  "" "" "" "" ...
##  $ END_TIME  : chr  "" "" "" "" ...
##  $ COUNTY_END: num  0 0 0 0 0 0 0 0 0 0 ...
##  $ COUNTYENDN: logi  NA NA NA NA NA NA ...
##  $ END_RANGE : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ END_AZI   : chr  "" "" "" "" ...
##  $ END_LOCATI: chr  "" "" "" "" ...
##  $ LENGTH    : num  14 2 0.1 0 0 1.5 1.5 0 3.3 2.3 ...
##  $ WIDTH     : num  100 150 123 100 150 177 33 33 100 100 ...
##  $ F         : int  3 2 2 2 2 2 2 1 3 3 ...
##  $ MAG       : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ FATALITIES: num  0 0 0 0 0 0 0 0 1 0 ...
##  $ INJURIES  : num  15 0 2 2 2 6 1 0 14 0 ...
##  $ PROPDMG   : num  25 2.5 25 2.5 2.5 2.5 2.5 2.5 25 25 ...
##  $ PROPDMGEXP: chr  "K" "K" "K" "K" ...
##  $ CROPDMG   : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ CROPDMGEXP: chr  "" "" "" "" ...
##  $ WFO       : chr  "" "" "" "" ...
##  $ STATEOFFIC: chr  "" "" "" "" ...
##  $ ZONENAMES : chr  "" "" "" "" ...
##  $ LATITUDE  : num  3040 3042 3340 3458 3412 ...
##  $ LONGITUDE : num  8812 8755 8742 8626 8642 ...
##  $ LATITUDE_E: num  3051 0 0 0 0 ...
##  $ LONGITUDE_: num  8806 0 0 0 0 ...
##  $ REMARKS   : chr  "" "" "" "" ...
##  $ REFNUM    : num  1 2 3 4 5 6 7 8 9 10 ...
head(df)
##   STATE__           BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE  EVTYPE
## 1       1  4/18/1950 0:00:00     0130       CST     97     MOBILE    AL TORNADO
## 2       1  4/18/1950 0:00:00     0145       CST      3    BALDWIN    AL TORNADO
## 3       1  2/20/1951 0:00:00     1600       CST     57    FAYETTE    AL TORNADO
## 4       1   6/8/1951 0:00:00     0900       CST     89    MADISON    AL TORNADO
## 5       1 11/15/1951 0:00:00     1500       CST     43    CULLMAN    AL TORNADO
## 6       1 11/15/1951 0:00:00     2000       CST     77 LAUDERDALE    AL TORNADO
##   BGN_RANGE BGN_AZI BGN_LOCATI END_DATE END_TIME COUNTY_END COUNTYENDN
## 1         0                                               0         NA
## 2         0                                               0         NA
## 3         0                                               0         NA
## 4         0                                               0         NA
## 5         0                                               0         NA
## 6         0                                               0         NA
##   END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG FATALITIES INJURIES PROPDMG
## 1         0                      14.0   100 3   0          0       15    25.0
## 2         0                       2.0   150 2   0          0        0     2.5
## 3         0                       0.1   123 2   0          0        2    25.0
## 4         0                       0.0   100 2   0          0        2     2.5
## 5         0                       0.0   150 2   0          0        2     2.5
## 6         0                       1.5   177 2   0          0        6     2.5
##   PROPDMGEXP CROPDMG CROPDMGEXP WFO STATEOFFIC ZONENAMES LATITUDE LONGITUDE
## 1          K       0                                         3040      8812
## 2          K       0                                         3042      8755
## 3          K       0                                         3340      8742
## 4          K       0                                         3458      8626
## 5          K       0                                         3412      8642
## 6          K       0                                         3450      8748
##   LATITUDE_E LONGITUDE_ REMARKS REFNUM
## 1       3051       8806              1
## 2          0          0              2
## 3          0          0              3
## 4          0          0              4
## 5          0          0              5
## 6          0          0              6

The data set has 902297 rows and 37 columns. We will be focused in the variable EVTYPE that defines the weather events. There are some events that are much similar, such as THUNDERSTORM WIND which appears as several names, as shown below:

thunder <- unique(df[grepl("*THUNDERSTORM WIND*", df$EVTYPE), 'EVTYPE'])
thunder
##  [1] "THUNDERSTORM WINDS"             "THUNDERSTORM WIND"             
##  [3] "THUNDERSTORM WINS"              "THUNDERSTORM WINDS LIGHTNING"  
##  [5] "THUNDERSTORM WINDS/HAIL"        "THUNDERSTORM WINDS HAIL"       
##  [7] "THUNDERSTORM WINDS/FUNNEL CLOU" "SEVERE THUNDERSTORM WINDS"     
##  [9] "LIGHTNING THUNDERSTORM WINDSS"  "THUNDERSTORM WINDS 60"         
## [11] "THUNDERSTORM WINDSS"            "LIGHTNING THUNDERSTORM WINDS"  
## [13] "LIGHTNING AND THUNDERSTORM WIN" "THUNDERSTORM WINDS53"          
## [15] "THUNDERSTORM WINDS 13"          "THUNDERSTORM WINDS URBAN FLOOD"
## [17] "THUNDERSTORM WINDS SMALL STREA" "THUNDERSTORM WINDS 2"          
## [19] "THUNDERSTORM WINDS 61"          "THUNDERSTORM WINDS/ HAIL"      
## [21] "THUNDERSTORM WIND/LIGHTNING"    "THUNDERSTORM WIND G50"         
## [23] "THUNDERSTORM WINDS/HEAVY RAIN"  "THUNDERSTORM WINDS      LE CEN"
## [25] "THUNDERSTORM WINDS G"           "THUNDERSTORM WIND G60"         
## [27] "THUNDERSTORM WINDS."            "THUNDERSTORM WIND G55"         
## [29] "THUNDERSTORM WINDS G60"         "THUNDERSTORM WINDS FUNNEL CLOU"
## [31] "THUNDERSTORM WINDS 62"          "THUNDERSTORM WINDS/FLASH FLOOD"
## [33] "THUNDERSTORM WINDS 53"          "THUNDERSTORM WIND 59"          
## [35] "THUNDERSTORM WIND 52"           "THUNDERSTORM WIND 69"          
## [37] "THUNDERSTORM WIND 60 MPH"       "THUNDERSTORM WIND 65MPH"       
## [39] "THUNDERSTORM WIND/ TREES"       "THUNDERSTORM WIND/AWNING"      
## [41] "THUNDERSTORM WIND 98 MPH"       "THUNDERSTORM WIND TREES"       
## [43] "THUNDERSTORM WIND 59 MPH"       "THUNDERSTORM WINDS 63 MPH"     
## [45] "THUNDERSTORM WIND/ TREE"        "THUNDERSTORM WIND 65 MPH"      
## [47] "THUNDERSTORM WIND."             "THUNDERSTORM WIND 59 MPH."     
## [49] "THUNDERSTORM WINDSHAIL"         "THUNDERSTORM WINDS AND"        
## [51] "THUNDERSTORM WINDS 50"          "THUNDERSTORM WIND G52"         
## [53] "THUNDERSTORM WINDS 52"          "THUNDERSTORM WIND G51"         
## [55] "THUNDERSTORM WIND G61"          "THUNDERSTORM WINDS/FLOODING"   
## [57] "THUNDERSTORM WIND 50"           "THUNDERSTORM WIND 56"          
## [59] "THUNDERSTORM WIND/HAIL"         "THUNDERSTORM WINDS/ FLOOD"     
## [61] "THUNDERSTORM WINDS HEAVY RAIN"  "THUNDERSTORM WIND (G40)"       
## [63] "GUSTY THUNDERSTORM WINDS"       "GUSTY THUNDERSTORM WIND"       
## [65] "MARINE THUNDERSTORM WIND"

We will substitute those names for THUNDERSTORM WIND.

df[df$EVTYPE %in% thunder, "EVTYPE"] <- "THUNDERSTORM WIND"

By the same reason we will do the same procedure for TSTM WIND which also denotes THUNDERSTORM WIND:

tstm <- unique(df[grepl("TSTM WIND*", df$EVTYPE), 'EVTYPE'])
tstm
##  [1] "TSTM WIND"                  "TORNADOES, TSTM WIND, HAIL"
##  [3] "TSTM WIND 51"               "TSTM WIND 50"              
##  [5] "TSTM WIND 52"               "TSTM WIND 55"              
##  [7] "TSTM WIND G58"              "TSTM WIND DAMAGE"          
##  [9] "TSTM WINDS"                 "TSTM WIND 65)"             
## [11] "TSTM WIND/HAIL"             "TSTM WIND (G45)"           
## [13] "TSTM WIND 40"               "TSTM WIND 45"              
## [15] "TSTM WIND (41)"             "TSTM WIND (G40)"           
## [17] " TSTM WIND"                 "TSTM WIND AND LIGHTNING"   
## [19] " TSTM WIND (G45)"           "TSTM WIND  (G45)"          
## [21] "TSTM WIND (G35)"            "TSTM WIND G45"             
## [23] "NON-TSTM WIND"              "NON TSTM WIND"             
## [25] "MARINE TSTM WIND"

The words NON-TSM WIND and NON TSTM WIND will be removed from tstm:

tstm <- tstm[tstm != "NON-TSTM WIND"]
tstm <- tstm[tstm != "NON TSTM WIND"]
df[df$EVTYPE %in% tstm, "EVTYPE"] <- "THUNDERSTORM WIND"

The same procedure applies to LIGHTNING:

lightning <- unique(df[grepl("LIGHTNING*", df$EVTYPE), 'EVTYPE'])
lightning
##  [1] "LIGHTNING"                "LIGHTNING AND HEAVY RAIN"
##  [3] "HEAVY RAIN/LIGHTNING"     "LIGHTNING/HEAVY RAIN"    
##  [5] "LIGHTNING INJURY"         "LIGHTNING."              
##  [7] "LIGHTNING FIRE"           "LIGHTNING DAMAGE"        
##  [9] "LIGHTNING AND WINDS"      "LIGHTNING  WAUSEON"      
## [11] " LIGHTNING"

The words LIGHTNING AND WINDS and TSTM WIND AND LIGHTNING will be removed from lightning since they are combined events:

lightning <- lightning[lightning != "LIGHTNING AND WINDS"]
lightning <- lightning[lightning != "TSTM WIND AND LIGHTNING"]
df[df$EVTYPE %in% lightning, "EVTYPE"] <- "LIGHTNING"

Since we are dealing with types of events, we will transform EVTYPE as a factor variable:

df$EVTYPE <- as.factor(df$EVTYPE)

We will create a variable damage that encompasses property damage (PROPDMG) and damage to crops (CROPDMG).

df$DAMAGE <- df$PROPDMG + df$CROPDMG

Results

In this section we will analyze the events that are most critical to the health of the population and that cause the greatest economic damage.

Which events are most harmful to population health?

We will start by calculating some statistical properties for variables FATALITIES and INJURIES:

summary(df$FATALITIES)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##   0.0000   0.0000   0.0000   0.0168   0.0000 583.0000
summary(df$INJURIES)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
##    0.0000    0.0000    0.0000    0.1557    0.0000 1700.0000

The results showed that most of the values are zero. To overcome this fact, we will only consider fatalities and injuries greater than the average of these variables.

# FOR FATALITY
df.fatal <- subset(df, df$FATALITIES >= mean(df$FATALITIES))

most_fatalities <- sort(table(df.fatal$EVTYPE), decreasing = TRUE)[1:5]
most_fatalities <- as.data.frame(most_fatalities)
names(most_fatalities) <- c("event", "Freq")

most_fatalities_ordered <- most_fatalities %>% mutate(event = fct_reorder(event, Freq))

# FOR INURY
df.injury <- subset(df, df$INJURIES >= mean(df$INJURIES))

most_injuries <- sort(table(df.injury$EVTYPE), decreasing = TRUE)[1:5]
most_injuries <- as.data.frame(most_injuries)
names(most_injuries) <- c("event", "Freq")

most_injuries_ordered <- most_injuries %>% mutate(event = fct_reorder(event, Freq))
plot1 <- ggplot(data = most_fatalities_ordered, aes(x=Freq, y=event, fill=event)) +
        geom_bar(stat = "identity") +
        scale_fill_manual(values = c("darkorange", "darkgreen", "magenta", "darkblue", "darkred")) +
        labs(x="Number of fatalities",
             y="Weather event",
             title = "Most fatalities") +
        theme(axis.text=element_text(size=16, face="bold"),
              axis.title=element_text(size=20, face="bold"),
              plot.title=element_text(size=20, face = "bold"),
              legend.position = "none")



plot2 <- ggplot(data = most_injuries_ordered, aes(x=Freq, y=event, fill=event)) +
        geom_bar(stat = "identity") +
        scale_fill_manual(values = c("magenta", "black", "darkblue", "darkgreen", "darkred")) +
        labs(x="Number of injuries",
             y="",
             title = "Most injuries") +
        theme(axis.text=element_text(size=16, face="bold"),
              axis.title=element_text(size=20, face="bold"),
              plot.title=element_text(size=20, face = "bold"),
              legend.position = "none")
       

fig1 <- plot_grid(plot1, plot2, labels = "AUTO")
title_gg <- ggplot() + 
  labs(title = "Figure 1. Weather events with most fatalities (A) and injuries (B)") +
        theme(plot.title = element_text(hjust = 0.5, size=22, face="bold"))
plot_grid(title_gg, fig1, ncol = 1, rel_heights = c(0.05, 1))

Figure 1 shows that tornadoes are the most damaging weather event for the population. Lightning is also dangerous as it is the second event with the highest number of fatalities and the third in terms of injuries, according to panels A and B of Figure 1. Considering the number of deaths and injuries, we can list tornadoes, lightning and thunderstorm winds as the most harmful to the health of the population.

Which events have the greatest economic consequences?

We will start by calculating the statistical properties for the variable DAMAGE:

summary(df$DAMAGE)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   13.59    1.00 5000.00

As with deaths and injuries, most damage values are also zero and only above-average damage values will be considered.

df.damage <- subset(df, df$DAMAGE >= mean(df$DAMAGE))

most_damage <- sort(table(df.damage$EVTYPE), decreasing = TRUE)[1:5]
most_damage <- as.data.frame(most_damage)
names(most_damage) <- c("event", "Freq")

most_damage_ordered <- most_damage %>% mutate(event = fct_reorder(event, Freq))
plot3 <- ggplot(data = most_damage_ordered, aes(x=Freq, y=event, fill=event)) +
        geom_bar(stat = "identity") +
        scale_fill_manual(values = c("black", "black", "magenta", "darkred", "darkgreen")) +
        labs(x="Property and crop damages",
             y="Event",
             title = "") +
        theme(axis.text=element_text(size=12, face="bold"),
              axis.title=element_text(size=16, face="bold"),
              plot.title=element_text(size=18, face = "bold"),
              legend.position = "none")
title_gg2 <- ggplot() + 
  labs(title = "Figure 2. Weather events with the greatest economic consequences") +
        theme(plot.title = element_text(hjust = 0.5, size=16, face="bold"))
plot_grid(title_gg2, plot3, ncol = 1, rel_heights = c(0.05, 1))

Figure 2 shows that the weather events with the greatest economic consequences are thunderstorm wind, tornado and flash flood. Comparing Figures 1 and 2 it can be seen that:

  • Tornadoes are the most dangerous in terms of deaths and injuries, while thunderstorm winds have the greatest economic impact;
  • Lightning strikes are dangerous in terms of deaths and injuries, although they are not listed among the weather events with the greatest economic impact.

We encourage governments or municipal managers to prioritize resources to face the consequences of the main climate events portrayed in this report.