Title

Severe weather events across the United States - Population health and economic consequences.

Synopsis

This study utilizes the NOAA Storm Database to investigate severe weather events across the United States, focusing on their impacts on population health and economic consequences. Through data analysis, we aim to identify the types of events that pose the greatest threat to population health and those with the most significant economic repercussions. The findings are intended to assist government or municipal managers in prioritizing resources for different types of severe weather events, aiding in better preparation and response strategies.

Data Processing

# Download the file
download.file("https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2", destfile = "StormData.csv.bz2")

# Check if the file exists
if (file.exists("StormData.csv")) {
  # If the file exists, remove it
  file.remove("StormData.csv")
}
## [1] TRUE
# Extract the contents of the BZIP2 file
bunzip2("StormData.csv.bz2", remove = FALSE)


# Load the data
storm_data <- read.csv("StormData.csv")
        


# Some data cleaning

# Convert countyname column to uppercase
storm_data$COUNTYNAME <- trimws(toupper(storm_data$COUNTYNAME))

# Convert 'evtype' column to uppercase
storm_data$EVTYPE <- trimws(toupper(storm_data$EVTYPE))

# List all unique values in 'countyname' column
unique_countynames <- unique(storm_data$COUNTYNAME)
#print(unique_countynames)

# List all unique values in 'evtype' column
unique_evtypes <- unique(storm_data$EVTYPE)
#print(unique_evtypes)

# List all unique values in 'State' column
unique_evtypes <- unique(storm_data$STATE)
#print(unique_evtypes)

# Create a vector of EVTYPE values from summary
summary_evtype <- c("YOUR", "SUMMARY", "VALUES", "HERE")

# Loop through each element of the 'evtype' column
for(i in 1:length(storm_data$EVTYPE)) {
        # Check if the current value is one of the summary_evtype values
        if(any(grepl(paste(summary_evtype, collapse = "|"), storm_data$EVTYPE[i], ignore.case = TRUE))) {
                
                # If it is, replace it with "NOT DEFINED"
                storm_data$EVTYPE[i] <- "NOT DEFINED"
        }
}

# Convert the BGN_DATE column to Date format
storm_data$BGN_DATE <- as.Date(storm_data$BGN_DATE, format = "%m/%d/%Y")

# Extract year and month from BGN_DATE
storm_data$Year <- format(storm_data$BGN_DATE, "%Y")
storm_data$Month <- format(storm_data$BGN_DATE, "%m")

# Create a new column combining year and month
storm_data$YearMonth <- paste(storm_data$Year, storm_data$Month, sep = "-")

# Count severe weather events by year and month
events_by_year_month <- table(storm_data$YearMonth)

Data Exploratory

List of variables:

# Summary of principal variables
summary(storm_data)
##     STATE__        BGN_DATE            BGN_TIME          TIME_ZONE        
##  Min.   : 1.0   Min.   :1950-01-03   Length:902297      Length:902297     
##  1st Qu.:19.0   1st Qu.:1995-04-20   Class :character   Class :character  
##  Median :30.0   Median :2002-03-18   Mode  :character   Mode  :character  
##  Mean   :31.2   Mean   :1998-12-27                                        
##  3rd Qu.:45.0   3rd Qu.:2007-07-28                                        
##  Max.   :95.0   Max.   :2011-11-30                                        
##                                                                           
##      COUNTY       COUNTYNAME           STATE              EVTYPE         
##  Min.   :  0.0   Length:902297      Length:902297      Length:902297     
##  1st Qu.: 31.0   Class :character   Class :character   Class :character  
##  Median : 75.0   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :100.6                                                           
##  3rd Qu.:131.0                                                           
##  Max.   :873.0                                                           
##                                                                          
##    BGN_RANGE          BGN_AZI           BGN_LOCATI          END_DATE        
##  Min.   :   0.000   Length:902297      Length:902297      Length:902297     
##  1st Qu.:   0.000   Class :character   Class :character   Class :character  
##  Median :   0.000   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :   1.484                                                           
##  3rd Qu.:   1.000                                                           
##  Max.   :3749.000                                                           
##                                                                             
##    END_TIME           COUNTY_END COUNTYENDN       END_RANGE       
##  Length:902297      Min.   :0    Mode:logical   Min.   :  0.0000  
##  Class :character   1st Qu.:0    NA's:902297    1st Qu.:  0.0000  
##  Mode  :character   Median :0                   Median :  0.0000  
##                     Mean   :0                   Mean   :  0.9862  
##                     3rd Qu.:0                   3rd Qu.:  0.0000  
##                     Max.   :0                   Max.   :925.0000  
##                                                                   
##    END_AZI           END_LOCATI            LENGTH              WIDTH         
##  Length:902297      Length:902297      Min.   :   0.0000   Min.   :   0.000  
##  Class :character   Class :character   1st Qu.:   0.0000   1st Qu.:   0.000  
##  Mode  :character   Mode  :character   Median :   0.0000   Median :   0.000  
##                                        Mean   :   0.2301   Mean   :   7.503  
##                                        3rd Qu.:   0.0000   3rd Qu.:   0.000  
##                                        Max.   :2315.0000   Max.   :4400.000  
##                                                                              
##        F               MAG            FATALITIES          INJURIES        
##  Min.   :0.0      Min.   :    0.0   Min.   :  0.0000   Min.   :   0.0000  
##  1st Qu.:0.0      1st Qu.:    0.0   1st Qu.:  0.0000   1st Qu.:   0.0000  
##  Median :1.0      Median :   50.0   Median :  0.0000   Median :   0.0000  
##  Mean   :0.9      Mean   :   46.9   Mean   :  0.0168   Mean   :   0.1557  
##  3rd Qu.:1.0      3rd Qu.:   75.0   3rd Qu.:  0.0000   3rd Qu.:   0.0000  
##  Max.   :5.0      Max.   :22000.0   Max.   :583.0000   Max.   :1700.0000  
##  NA's   :843563                                                           
##     PROPDMG         PROPDMGEXP           CROPDMG         CROPDMGEXP       
##  Min.   :   0.00   Length:902297      Min.   :  0.000   Length:902297     
##  1st Qu.:   0.00   Class :character   1st Qu.:  0.000   Class :character  
##  Median :   0.00   Mode  :character   Median :  0.000   Mode  :character  
##  Mean   :  12.06                      Mean   :  1.527                     
##  3rd Qu.:   0.50                      3rd Qu.:  0.000                     
##  Max.   :5000.00                      Max.   :990.000                     
##                                                                           
##      WFO             STATEOFFIC         ZONENAMES            LATITUDE   
##  Length:902297      Length:902297      Length:902297      Min.   :   0  
##  Class :character   Class :character   Class :character   1st Qu.:2802  
##  Mode  :character   Mode  :character   Mode  :character   Median :3540  
##                                                           Mean   :2875  
##                                                           3rd Qu.:4019  
##                                                           Max.   :9706  
##                                                           NA's   :47    
##    LONGITUDE        LATITUDE_E     LONGITUDE_       REMARKS         
##  Min.   :-14451   Min.   :   0   Min.   :-14455   Length:902297     
##  1st Qu.:  7247   1st Qu.:   0   1st Qu.:     0   Class :character  
##  Median :  8707   Median :   0   Median :     0   Mode  :character  
##  Mean   :  6940   Mean   :1452   Mean   :  3509                     
##  3rd Qu.:  9605   3rd Qu.:3549   3rd Qu.:  8735                     
##  Max.   : 17124   Max.   :9706   Max.   :106220                     
##                   NA's   :40                                        
##      REFNUM           Year              Month            YearMonth        
##  Min.   :     1   Length:902297      Length:902297      Length:902297     
##  1st Qu.:225575   Class :character   Class :character   Class :character  
##  Median :451149   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :451149                                                           
##  3rd Qu.:676723                                                           
##  Max.   :902297                                                           
## 
# Compute the sum of Fatalities and Injuries for each combination of STATE and EVTYPE
fatalities_injuries_tbl <- aggregate(cbind(FATALITIES, INJURIES) ~ STATE + EVTYPE, data = storm_data, sum)

# Display the resulting table
#print(fatalities_injuries_tbl)

# Aggregate the total Fatalities and Injuries for each event type
event_harmfulness <- aggregate(cbind(FATALITIES, INJURIES) ~ EVTYPE, data = storm_data, sum)

# Calculate a harm score for each event type (sum of Fatalities and Injuries)
event_harmfulness$HarmScore <- event_harmfulness$FATALITIES + event_harmfulness$INJURIES

# Sort the event types by their harm score in descending order
event_harmfulness <- event_harmfulness[order(event_harmfulness$HarmScore, decreasing = TRUE), ]

# Display the top harmful event types
#print(head(event_harmfulness, n = 10))

# Create a new column called DMG that represents the sum of PROPDMG and CROPDMG
storm_data$DMG <- storm_data$PROPDMG + storm_data$CROPDMG

# Aggregate the total Damage for each event type
event_damage <- aggregate(cbind(DMG) ~ EVTYPE, data = storm_data, sum)

# Sort the event types by their damage  in descending order
event_damage <- event_damage[order(event_damage$DMG, decreasing = TRUE), ]

# Display the top damage event types
#print(head(event_damage, n = 10))

Plots

This data represents severe weather events aggregated by year and month from 1950 to 2011. Here’s a summary of the data:

The table spans from January 1950 to November 2011. The frequency of severe weather events varies across different months and years. Over the years, there are fluctuations in the number of severe weather events, with some months experiencing higher frequencies than others. The highest frequencies of severe weather events are generally observed during spring and summer months. There are occasional peaks in severe weather events, likely corresponding to specific weather patterns or phenomena.

Overall, the data suggests variability in the occurrence of severe weather events over time, influenced by seasonal and possibly climate-related factors.

This second data represents the frequency of severe weather events by state. Here’s a breakdown of the information:

The table contains counts of severe weather events for each state of US, identified by their respective abbreviations. Each row represents a state , while each value in the row represents the count of severe weather events. The abbreviation “XX” may represent unspecified or unclassified events. States with larger populations or greater geographical areas might generally exhibit higher frequencies of severe weather events. Certain states prone to specific types of severe weather, such as hurricanes or tornadoes, may have higher counts compared to others.

##                EVTYPE FATALITIES INJURIES HarmScore
## 684           TORNADO       5633    91346     96979
## 107    EXCESSIVE HEAT       1903     6525      8428
## 705         TSTM WIND        504     6957      7461
## 145             FLOOD        470     6789      7259
## 409         LIGHTNING        816     5230      6046
## 234              HEAT        937     2100      3037
## 129       FLASH FLOOD        978     1777      2755
## 378         ICE STORM         89     1975      2064
## 611 THUNDERSTORM WIND        133     1488      1621
## 814      WINTER STORM        206     1321      1527

This data lists the top 10 severe weather event types based on their “HarmScore,” which is a composite measure calculated by adding the number of fatalities and injuries associated with each event type. Here’s a breakdown:

TORNADO: This event type has the highest HarmScore, with 5633 fatalities and 91346 injuries, totaling 96979.

EXCESSIVE HEAT: This event type ranks second in terms of HarmScore, with 1903 fatalities and 6525 injuries, totaling 8428.

TSTM WIND: Thunderstorm Wind events caused 504 fatalities and 6957 injuries, resulting in a HarmScore of 7461.

FLOOD: Floods resulted in 470 fatalities and 6789 injuries, with a HarmScore of 7259.

LIGHTNING: Lightning caused 816 fatalities and 5230 injuries, totaling 6046 in HarmScore.

HEAT: Heat events led to 937 fatalities and 2100 injuries, with a HarmScore of 3037.

FLASH FLOOD: Flash Floods resulted in 978 fatalities and 1777 injuries, totaling 2755 in HarmScore.

ICE STORM: Ice Storms caused 89 fatalities and 1975 injuries, with a HarmScore of 2064.

THUNDERSTORM WIND: Thunderstorm Wind events led to 133 fatalities and 1488 injuries, resulting in a HarmScore of 1621.

WINTER STORM: Winter Storms caused 206 fatalities and 1321 injuries, with a HarmScore of 1527.

##                 EVTYPE       DMG
## 684            TORNADO 3312276.7
## 129        FLASH FLOOD 1599375.1
## 705          TSTM WIND 1445306.2
## 203               HAIL 1268289.7
## 145              FLOOD 1067976.4
## 611  THUNDERSTORM WIND  943635.6
## 409          LIGHTNING  606932.4
## 637 THUNDERSTORM WINDS  464978.1
## 311          HIGH WIND  342014.8
## 814       WINTER STORM  134699.6

This data presents severe weather event types along with their associated damage (in dollars). Here’s a breakdown:

TORNADO: Tornadoes caused damage amounting to $3,312,276.7.

FLASH FLOOD: Flash Floods resulted in damage totaling $1,599,375.1.

TSTM WIND: Thunderstorm Winds caused damage amounting to $1,445,306.2.

HAIL: Hailstorms resulted in damage totaling $1,268,289.7.

FLOOD: Floods caused damage amounting to $1,067,976.4.

THUNDERSTORM WIND: Thunderstorm Winds led to damage totaling $943,635.6.

LIGHTNING: Lightning caused damage amounting to $606,932.4.

THUNDERSTORM WINDS: Similar to "Thunderstorm Wind," this event type caused damage totaling $464,978.1.

HIGH WIND: High Winds resulted in damage amounting to $342,014.8.

WINTER STORM: Winter Storms caused damage totaling $134,699.6.

This data provides insights into the economic impact of various severe weather events, with tornadoes causing the highest damage followed by flash floods and thunderstorm winds.