This document provides a brief analysis of data provided by the U.S National Oceanic and Atmospheric Administrations (NOAA) storm database.
We will analyze which types of events cause the most fatalities, the most injuries and the most physical/crop damage in the United States.
Results and conclusions are provided at the bottom of the document.
The data was recieved in a raw csv file, using read.csv we read the data into R so that we can work with it. To start off, we form a vector called ‘health’, which contains EVTYPE, INJURIES and FATALITIES.
We will use this vector to subset our data in R to focus on the issues of interest.
storm<-read.csv("repdata_data_StormData.csv",header=TRUE) #Read in data
health<-c("EVTYPE","INJURIES","FATALITIES")
storm.health<-storm[ ,health]
a<-aggregate(FATALITIES~EVTYPE,storm.health,sum)
a.sub<-a$FATALITIES>20
new.a<-a[a.sub, ]
#Some have zero fatalities at all, should remove those.
#droplevels(new.a$EVTYPE)
H=new.a$FATALITIES
L=new.a$EVTYPE
barplot(H,names.arg=L,space=1.5,las=2,main="Fatalities for event types with more than 20 deaths total",ylab="Fatalities",cex.names=0.6,col='red')
injuries<-aggregate(INJURIES~EVTYPE,storm.health,sum)
injuries.sub<-injuries$INJURIES>50
new.injuries<-injuries[injuries.sub,]
#droplevels(new.injuries$EVTYPE)
H2=new.injuries$INJURIES
L2=new.injuries$EVTYPE
barplot(H2,names.arg=L2,las=2,main="Injuries for event types with more than 50 total injuries",cex.names=0.5,col='blue',space=1.5)
#Now we are interested in PROPDMG and CROPDMG
damage<-c("EVTYPE","PROPDMG","CROPDMG")
storm.damage<-storm[,damage]
property.damage<-aggregate(PROPDMG~EVTYPE,storm.damage,sum)
prop<-property.damage$PROPDMG >50000
property.damage<-property.damage[prop, ]
#droplevels(property.damage$EVTYPE)
crop.damage<-aggregate(CROPDMG~EVTYPE,storm.damage,sum)
crop<-crop.damage$CROPDMG >2000
crop.damage<-crop.damage[crop,]
#barplot(property.damage$PROPDMG,names.arg=property.damage$EVTYPE,las=2,size=1.5,cex.names=0.8,col="purple",main="Property Damage by event type for damage greater than 50000")
property.damage
## EVTYPE PROPDMG
## 153 FLASH FLOOD 1420124.59
## 170 FLOOD 899938.48
## 244 HAIL 688693.38
## 290 HEAVY RAIN 50842.14
## 310 HEAVY SNOW 122251.99
## 359 HIGH WIND 324731.56
## 376 HIGH WINDS 55625.00
## 427 ICE STORM 66000.67
## 464 LIGHTNING 603351.78
## 676 STRONG WIND 62993.81
## 760 THUNDERSTORM WIND 876844.17
## 786 THUNDERSTORM WINDS 446293.18
## 834 TORNADO 3212258.16
## 856 TSTM WIND 1335965.61
## 957 WILDFIRE 84459.34
## 972 WINTER STORM 132720.59
#
options(scipen = 999)
barplot(crop.damage$CROPDMG,names.arg=crop.damage$EVTYPE,las=2,size=1.5,cex.names=0.8,col="green",main="Crop Damage by event type for damage greater than 2000",ylim=c(2000,600000))
We include three total barplots and one chart. The barplots can be used to visualize which event types are the most serious for a given topic, and the chart can be read in a similar way.
For population health we considered fatalities and Injuries. For fatalities, we can clearly see that Tornados cause the most number of deaths. Excessive heat also cause many fatalities, as well as flash floods and heat.
For injuries, again Tornados are the most devestating by far. Excessive heat, floods, lighting and TSTM wind also cause injuries at higher rates than other event types.
For property damage we include a chart comparing the amount of damage for certian extreme event types. Toranados cause the most major property damage, followed by Flash floods.
Hail causes major crop damage, as well as flash floods and floods. TSTM Wind, storms and tropical storms also cause major crop damage.