Health and Economic Consequences of Enviromental Events

Synopsis

This analysis looks at NOAA’s storm data base to find out which type of enviromental event has the largest impact on both health and economic outcomes. It finds that tornadoes are responsible for the most damage in both cases.

Data Processing

The following code first downloads and loads the storm data. It then creates catchall variables first for health damage (fatalities+injuries) and second for economic damage (crop + property damage).

library(tidyverse)
## Warning: package 'ggplot2' was built under R version 4.3.3
## Warning: package 'tidyr' was built under R version 4.3.3
## Warning: package 'readr' was built under R version 4.3.3
## Warning: package 'lubridate' was built under R version 4.3.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(downloader)
## Warning: package 'downloader' was built under R version 4.3.3
url<-"https://d396qusza40orc.cloudfront.net/repdata%2Fdata%2FStormData.csv.bz2"
download(url, dest="dataset.zip", mode="wb") 
#unzip ("dataset.zip", exdir = "./")
dat<-read.csv("repdata_data_StormData.csv.bz2")
dat<-dat %>% mutate(health=FATALITIES+INJURIES,
                    econ=PROPDMG+CROPDMG)

Results

Health damage

This code calculates average health impact for each event type. It then creates a chart displaying the impact for the ten most damaging events. We see that the most damaging event is a tornado.

avs<-dat %>% group_by(EVTYPE) %>%
  summarize(medianhealth=median(health,na.rm=TRUE),
            totalhealth=sum(health,na.rm=TRUE),
            totalecon=sum(econ,na.rm=TRUE)) 

avs<-avs %>%
  arrange(desc(totalhealth))

avstotalhealth<-avs[1:10,]

ggplot(avstotalhealth,aes(x=EVTYPE, y=totalhealth))+
  geom_col()+
  coord_flip()+
  labs(y="Total Fatalities + Injuries", x= "Event Type", title = "Health Impact for Top 10 Events Types")

Economic Damage

This code calculates average economic impact for each event type. It then creates a chart displaying the impact for the ten most damaging events.We see that the most damaging event is a tornado.

avs<-avs %>%
  arrange(desc(totalecon))

avstotalecon<-avs[1:10,]

ggplot(avstotalecon,aes(x=EVTYPE, y=totalecon))+
  geom_col()+
  coord_flip()+
  labs(y="Total Economic Impact ($)", x= "Event Type", title = "Economic Impact for Top 10 Events Types")