Synopsis

The U.S. National Oceanic and Atmospheric Administration’s (NOAA) storm database tracks characteristics of major storms and weather events in the United States. This analysis addresses which type of events are most harmful to population health and have the greatest economic consequences. It has been shown that tornadoes cause the most harm to public health, with a combined injury and fatality rate of nearly 1,500 per year. Flooding is by far the most economically costly weather event, causing a combined loss of eleven billion dollars per year in both property and crop damage. Grab an umbrella, it is starting to rain!

Data Processing

Loading the data

The data can be loaded into R using the url provided below. This data was recorded between January of 1950 and November of 2011 and only includes events in the United States.

url <- "https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download.file(url, destfile = "./NOAA_StormData.csv.bz2")
data <- read.csv("./NOAA_StormData.csv.bz2")

Filter and subset the data

The date was first reformatted from a character to a date object to simplify use and manipulation. Then, all events before Jan. 1996 were filtered out. This was the time point in which all possible weather event types were consistently recorded. Since the goal of the analysis is to examine which event type causes more health or economic harm, the data should be constrained to include only the range in which all event types were recorded. Finally, only the variables relevant to event type, health impacts, and economic impacts are necessary for this analysis. Thus, the data set was subsetted to include only the variables needed for the population health analysis and the economic consequence analysis. The rows with at least one recorded value for the variables were kept.

data <- data %>% 
        mutate(BGN_DATE = as.Date(BGN_DATE, "%m/%d/%Y")) %>%
        filter(BGN_DATE >= "1996-01-01") %>%
        subset(select =c(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)) %>%
        filter(FATALITIES > 0 | INJURIES > 0 | PROPDMG > 0 | CROPDMG > 0)

There are 48 official event type classifications as outlined on page 6 of the Storm Data Documentation. However, the raw data contains many more classifications and must be filtered to effectively compare weather events on population health and economic consequences. I decided to condense the original list to reflect more broad weather categories and only those weather categories present in the reduced data set. A column was added to the data set to reflect these more narrow group conditions, group_conditions.

Next, the total monetary value lost in crop and property damage was determined for each weather event. The raw data set uses ‘K’, ‘M’, and ‘B’ to denote the amount reflected in the property/crop damage (PROPDMG/CROPDMG) as being thousand, million, or billion dollars lost. To effectively extract the sum of damage for each weather event, I first had to multiply the property damage value by either 10^3, 10^6, or 10^9 to accurately represent the amount of US dollars lost. The final data frame, denoted as final_df includes the three columns that were added in the described data processing to ease the data analysis.

group_conditions <- case_when(
  grepl("thunderstorm|tstm|lightning", data$EVTYPE, ignore.case = TRUE) ~ "Thunderstorm",
  grepl("hail", data$EVTYPE, ignore.case = TRUE) ~ "Hail",
  grepl("cold|hypothermia", data$EVTYPE, ignore.case = TRUE) ~ "Cold",
  grepl("wind", data$EVTYPE, ignore.case = TRUE) ~ "Wind",
  grepl("wint|snow|ice|freez|icy|glaze|frost", data$EVTYPE, ignore.case = TRUE) ~ "Winter Weather",
  grepl("hurricane", data$EVTYPE, ignore.case = TRUE) ~ "Hurricane",
  grepl("heat|hyperthermia|warm weather|unseasonably warm", data$EVTYPE, ignore.case = TRUE) ~ "Heat", 
  grepl("flood|fld|dam break", data$EVTYPE, ignore.case = TRUE) ~ "Flooding",
  grepl("surf", data$EVTYPE, ignore.case = TRUE) ~ "High Surf",
  grepl("rip", data$EVTYPE, ignore.case = TRUE) ~ "Rip Current",
  grepl("costal storm|coastalstorm", data$EVTYPE, ignore.case = TRUE) ~ "Coastal Storm",
  grepl("surge|tide", data$EVTYPE, ignore.case = TRUE) ~ "Storm Surge/Tide",
  grepl("tornado|funnel", data$EVTYPE, ignore.case = TRUE) ~ "Tornado",
  grepl("fire", data$EVTYPE, ignore.case = TRUE) ~ "Fire",
  grepl("rain", data$EVTYPE, ignore.case = TRUE) ~ "Rain",
  grepl("drought", data$EVTYPE, ignore.case = TRUE) ~ "Drought",
  grepl("blizzard", data$EVTYPE, ignore.case = TRUE) ~ "Blizzard",
  grepl("landslide|mudslide|rock slide", data$EVTYPE, ignore.case = TRUE) ~ "Landslide",
  grepl("tropical storm", data$EVTYPE, ignore.case = TRUE) ~ "Tropical Storm",
  grepl("typhoon", data$EVTYPE, ignore.case = TRUE) ~ "Typhoon",
  grepl("tsunami", data$EVTYPE, ignore.case = TRUE) ~ "Tsunami",
  grepl("dust devil", data$EVTYPE, ignore.case = TRUE) ~ "Dust Devil",
  grepl("mixed prec", data$EVTYPE, ignore.case = TRUE) ~ "Mixed Precipitation",
  grepl("fog", data$EVTYPE, ignore.case = TRUE) ~ "Fog",
  TRUE ~ data$EVTYPE
)

final_df <- data %>%
        mutate(group_conditions) %>%
        mutate(PROPDMGEXP = case_when(
                PROPDMGEXP == "K" ~ 1000,
                PROPDMGEXP == "M" ~ 1000000,
                PROPDMGEXP == "B" ~ 1000000000,
                TRUE ~ as.numeric(PROPDMGEXP))) %>%
        mutate(CROPDMGEXP = case_when(
                CROPDMGEXP == "K" ~ 1000,
                CROPDMGEXP == "M" ~ 1000000,
                CROPDMGEXP == "B" ~ 1000000000,
                TRUE ~ as.numeric(CROPDMGEXP))) %>%
        mutate(PropDMG_total = PROPDMGEXP*PROPDMG) %>%
        mutate(CropDMG_total = CROPDMGEXP*CROPDMG)
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `PROPDMGEXP = case_when(...)`.
## Caused by warning:
## ! NAs introduced by coercion
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `CROPDMGEXP = case_when(...)`.
## Caused by warning:
## ! NAs introduced by coercion

Results

Which types of events are most harmful to population health?

The plot below portrays the combined fatality and injury count from the nine most harmful weather events in the US between January 1996 and November 2011. It can be concluded that tornadoes are most harmful to public health, with a fatality and injury count of 22,178. This is more than double that of the next most harmful weather event, thunderstorms. The top 4 weather events causing most harm, in order, are tornadoes, thunderstorms, flooding, and heat.

# Plot of combined fatality and injury counts for each weather condition.
final_df %>%
        aggregate(x = FATALITIES + INJURIES ~ group_conditions, FUN = sum) %>%
        rename(fatal_and_inj = "FATALITIES + INJURIES") %>%
        filter(fatal_and_inj > 1000) %>%
        ggplot(aes(y = fatal_and_inj, x = reorder(group_conditions, -fatal_and_inj))) + 
                geom_col(fill = rgb(0.2, 0.4, 0.6, 0.8)) +
                geom_text(aes(label = fatal_and_inj), vjust = 1.2, color = "white") +
                labs(y = "Injuries/Fatalities", x = "", title = "15 Year Fatality and Injury Count from Weather Events in the US")

Which types of events have the greatest economic consequences?

The first plot below titled “Weather Events in the US Causing the Most Monetary Loss in Crop Damage” portrays the fourteen most costly weather events in the US between January 1996 and November 2011 in terms of crop damage. It can be concluded that droughts, flooding, and hurricanes have caused the most expensive crop damage during this time frame. Droughts have caused over 13 billion US dollars in crop damage! That comes out to nearly one billion dollars in damage per year.

The second plot below titled “Weather Events in the US Causing the Most Monetary Loss in Property Damage” shows the fifteen most costly weather events in the US between January 1996 and November 2011 in terms of property damage. It can be concluded that flooding, hurricanes, and storm surges have caused the most costly property damage during this time frame. Floods have caused over 150 billion US dollars in property damage, which is ten billion dollars in damage per year. Flooding is by far the most costly weather event, taking into consideration both property and crop damage.

# Plot of monetary value lost in crop damage for each weather condition.
final_df %>%
        aggregate(x = CropDMG_total ~ group_conditions, FUN = sum) %>%
        filter(CropDMG_total > 10000000) %>%
        ggplot(aes(y = CropDMG_total, x = reorder(group_conditions, +CropDMG_total))) +
                geom_bar(stat = "identity", fill = rgb(0.2, 0.4, 0.6, 0.8)) +
                scale_y_continuous() +
                coord_flip() +
                labs(x = "", y = "US Dollars", title = "Weather Events in the US Causing the Most Monetary Loss in Crop Damage")

# Plot of monetary value lost in property damage for each weather condition.
final_df %>%
        aggregate(x = PropDMG_total ~ group_conditions, FUN = sum) %>%
        filter(PropDMG_total > 300000000) %>%
        ggplot(aes(y = PropDMG_total, x = reorder(group_conditions, +PropDMG_total))) +
                geom_bar(stat = "identity", fill = rgb(0.2, 0.4, 0.6, 0.8)) +
                scale_y_continuous() +
                coord_flip() +
                labs(x = "", y = "US Dollars", title = "Weather Events in the US Causing the Most Monetary Loss in Property Damage")