This report analyzes severe weather events data from the NOAA Storm Database, spanning 1950 to November 2011, to identify the types of events that significantly affect population health and have substantial economic consequences in the United States. Initial data processing involved cleaning and structuring a vast dataset to ensure accurate analysis. The study identifies key weather events causing the highest mortality, injuries, and economic losses, presenting the findings through descriptive statistics and visualizations. Results highlight specific severe weather types that require priority in resource allocation and preparedness strategies by municipal managers.
library(dplyr)
library(ggplot2)
library(readr)
library(data.table)
# Loading the compressed CSV file directly using data.table for efficiency
storm_data_raw <- fread("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2")
head(storm_data_raw)
## STATE__ BGN_DATE BGN_TIME TIME_ZONE COUNTY COUNTYNAME STATE
## <num> <char> <char> <char> <num> <char> <char>
## 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 COUNTYENDN
## <char> <num> <char> <char> <char> <char> <num> <lgcl>
## 1: TORNADO 0 0 NA
## 2: TORNADO 0 0 NA
## 3: TORNADO 0 0 NA
## 4: TORNADO 0 0 NA
## 5: TORNADO 0 0 NA
## 6: TORNADO 0 0 NA
## END_RANGE END_AZI END_LOCATI LENGTH WIDTH F MAG FATALITIES INJURIES
## <num> <char> <char> <num> <num> <int> <num> <num> <num>
## 1: 0 14.0 100 3 0 0 15
## 2: 0 2.0 150 2 0 0 0
## 3: 0 0.1 123 2 0 0 2
## 4: 0 0.0 100 2 0 0 2
## 5: 0 0.0 150 2 0 0 2
## 6: 0 1.5 177 2 0 0 6
## PROPDMG PROPDMGEXP CROPDMG CROPDMGEXP WFO STATEOFFIC ZONENAMES LATITUDE
## <num> <char> <num> <char> <char> <char> <char> <num>
## 1: 25.0 K 0 3040
## 2: 2.5 K 0 3042
## 3: 25.0 K 0 3340
## 4: 2.5 K 0 3458
## 5: 2.5 K 0 3412
## 6: 2.5 K 0 3450
## LONGITUDE LATITUDE_E LONGITUDE_ REMARKS REFNUM
## <num> <num> <num> <char> <num>
## 1: 8812 3051 8806 1
## 2: 8755 0 0 2
## 3: 8742 0 0 3
## 4: 8626 0 0 4
## 5: 8642 0 0 5
## 6: 8748 0 0 6
# Subset data for relevant columns
storm_data <- storm_data_raw[, .(EVTYPE, FATALITIES, INJURIES, PROPDMG, PROPDMGEXP, CROPDMG, CROPDMGEXP)]
# Convert EVTYPE to factor
storm_data$EVTYPE <- as.factor(storm_data$EVTYPE)
# Handle damage exponent to convert all damage figures to actual values
storm_data$PROPDMG <- storm_data$PROPDMG * 10^(nchar(storm_data$PROPDMGEXP)-1)
storm_data$CROPDMG <- storm_data$CROPDMG * 10^(nchar(storm_data$CROPDMGEXP)-1)
# Clean up the exponents now that they are no longer needed
storm_data <- storm_data[, .(EVTYPE, FATALITIES, INJURIES, PROPDMG, CROPDMG)]
head(storm_data)
## EVTYPE FATALITIES INJURIES PROPDMG CROPDMG
## <fctr> <num> <num> <num> <num>
## 1: TORNADO 0 15 25.0 0
## 2: TORNADO 0 0 2.5 0
## 3: TORNADO 0 2 25.0 0
## 4: TORNADO 0 2 2.5 0
## 5: TORNADO 0 2 2.5 0
## 6: TORNADO 0 6 2.5 0
# Sum fatalities and injuries by event type
health_impact <- storm_data[, .(Total_Fatalities = sum(FATALITIES),
Total_Injuries = sum(INJURIES)), by = EVTYPE]
# Sort to find the most harmful events
health_impact <- health_impact[order(-Total_Fatalities, -Total_Injuries)]
head(health_impact,10)
## EVTYPE Total_Fatalities Total_Injuries
## <fctr> <num> <num>
## 1: TORNADO 5633 91346
## 2: EXCESSIVE HEAT 1903 6525
## 3: FLASH FLOOD 978 1777
## 4: HEAT 937 2100
## 5: LIGHTNING 816 5230
## 6: TSTM WIND 504 6957
## 7: FLOOD 470 6789
## 8: RIP CURRENT 368 232
## 9: HIGH WIND 248 1137
## 10: AVALANCHE 224 170
# Plot for health impacts
ggplot(health_impact[1:10], aes(x = reorder(EVTYPE, -Total_Fatalities), y = Total_Fatalities)) +
geom_bar(stat = "identity", fill = "gray") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) + # Rotating labels 45 degrees
labs(title = "Top 10 Weather Events by Fatalities", x = "Event Type", y = "Number of Fatalities")
# Sum property and crop damage by event type
economic_impact <- storm_data[, .(Total_Property_Damage = sum(PROPDMG),
Total_Crop_Damage = sum(CROPDMG)), by = EVTYPE]
# Sort to find the events with greatest economic consequences
economic_impact <- economic_impact[order(-Total_Property_Damage, -Total_Crop_Damage)]
head(economic_impact,10)
## EVTYPE Total_Property_Damage Total_Crop_Damage
## <fctr> <num> <num>
## 1: TORNADO 3212255.5 100018.52
## 2: FLASH FLOOD 1419938.3 179200.46
## 3: TSTM WIND 1335965.6 109202.60
## 4: FLOOD 899932.2 168037.88
## 5: THUNDERSTORM WIND 876842.4 66791.45
## 6: HAIL 688642.1 579593.58
## 7: LIGHTNING 603349.1 3580.61
## 8: THUNDERSTORM WINDS 446112.3 18677.73
## 9: HIGH WIND 324731.6 17283.21
## 10: WINTER STORM 132720.6 1978.99
# Plot for economic impacts
ggplot(economic_impact[1:10], aes(x = reorder(EVTYPE, -Total_Property_Damage), y = Total_Property_Damage)) +
geom_bar(stat = "identity", fill = "steelblue") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) + # Rotating labels 45 degrees
labs(title = "Top 10 Weather Events by Property Damage", x = "Event Type", y = "Total Property Damage ($)")