What is the relationship between earthquake magnitude and reported deaths? This project explores whether earthquakes with higher magnitudes tend to have more reported deaths. This is an important question because earthquakes can cause different levels of damage and loss of life. Looking at the data can help us understand whether there is a pattern between earthquake magnitude and the number of deaths reported.
The dataset used for this project is called Earthquakes. I obtained it from the OpenIntro Data Sets website. The dataset documentation lists World Almanac and Book of Facts: 2011 as the original source. This project uses two columns: richter, which records earthquake magnitude, and deaths, which records the reported number of deaths. These variables are needed to compare earthquake magnitude with reported deaths.
To answer the research question, I first checked the size and structure of the dataset and looked for missing values in the two variables. I then created a smaller dataset containing only earthquake magnitude and reported deaths and removed rows with missing values in either column. After cleaning the data, I grouped earthquakes by rounded magnitude and created a summary table. The table shows the number of earthquakes in each group, the average number of reported deaths, and the highest reported death count. This helps compare the death counts across different magnitude groups.
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
eq <- read.csv("earthquakes.csv")
head(eq)
## year month day richter area region deaths
## 1 1902 April 19 7.5 Quezaltenango and San Marco Guatemala 2000
## 2 1902 December 16 6.4 Uzbekistan Russia 4700
## 3 1903 April 28 7.0 Malazgirt Turkey 3500
## 4 1903 May 28 5.8 Gole Turkey 1000
## 5 1905 April 4 7.5 Kangra India 19000
## 6 1906 January 31 8.8 Esmeraldas (off coast) Ecuador 1000
tail(eq)
## year month day richter area region deaths
## 118 1998 February 4 5.9 Hindu Kush Afghanistan 2323
## 119 1998 May 30 6.6 Border Afghanistan-Tajikistan 4000
## 120 1998 July 17 7.0 Papua New Guinea 2183
## 121 1999 January 25 6.1 Armenia Colombia 1185
## 122 1999 August 17 7.6 Izmit Turkey 17118
## 123 1999 September 20 7.6 Taichung Taiwan 2400
colnames(eq)
## [1] "year" "month" "day" "richter" "area" "region" "deaths"
str(eq)
## 'data.frame': 123 obs. of 7 variables:
## $ year : int 1902 1902 1903 1903 1905 1906 1906 1906 1906 1907 ...
## $ month : chr "April" "December" "April" "May" ...
## $ day : int 19 16 28 28 4 31 16 18 17 21 ...
## $ richter: num 7.5 6.4 7 5.8 7.5 8.8 6.8 7.7 8.6 8.1 ...
## $ area : chr "Quezaltenango and San Marco" "Uzbekistan" "Malazgirt" "Gole" ...
## $ region : chr "Guatemala" "Russia" "Turkey" "Turkey" ...
## $ deaths : int 2000 4700 3500 1000 19000 1000 1250 3000 3882 12000 ...
#check the size of the dataset
dim(eq)
## [1] 123 7
#check missing values
sum(is.na(eq$richter))
## [1] 0
sum(is.na(eq$deaths))
## [1] 2
#creating a new dataset with only needed columns & removing missing values
eq1 <- eq |> select(richter, deaths) |> filter(!is.na(richter), !is.na(deaths))
#checking for missing values in the cleaned dataset
sum(is.na(eq1$richter))
## [1] 0
sum(is.na(eq1$deaths))
## [1] 0
#creating a summary table for each rounded magnitude group
eq_table <- eq1 |> mutate(magnitude = round(richter, 0)) |>
group_by(magnitude) |>
summarise(
total_earthquakes = n(),
avg_deaths = round(mean(deaths)),
max_deaths = max(deaths))
eq_table
## # A tibble: 5 × 4
## magnitude total_earthquakes avg_deaths max_deaths
## <dbl> <int> <dbl> <int>
## 1 6 22 2964 12000
## 2 7 60 7393 110000
## 3 8 34 47726 700000
## 4 9 4 1635 3882
## 5 10 1 1655 1655
The summary table shows differences in reported deaths across earthquake magnitude groups. The group with a rounded magnitude of 8 had the highest average number of reported deaths, at 47,726, and the highest maximum, at 700,000. The magnitude 7 group had the largest number of earthquakes, with 60, and an average of 7,393 reported deaths. The magnitude 6 group had 22 earthquakes and an average of 2,964 reported deaths.
However, the results do not show that higher magnitudes always have higher death counts. The magnitude 9 group had four earthquakes, with an average of 1,635 deaths, while the magnitude 10 group had only one earthquake, with 1,655 deaths. These small groups make it difficult to draw general conclusions about those magnitudes. Overall, the table suggests that some higher-magnitude earthquakes had higher reported death counts, but the number of deaths also varies greatly between earthquakes.
This project explored the relationship between earthquake magnitude and reported deaths. The summary table showed that the rounded magnitude 8 group had the highest average and maximum reported death counts. However, the magnitude 9 and 10 groups had lower averages, and these groups contained very few earthquakes. This means that the results do not show a simple pattern in which every increase in magnitude is linked to more deaths. The research question was explored, but the table alone cannot explain why some earthquakes had many more reported deaths than others.
Future research could include more earthquake data and information about other factors, such as population size, building safety, and the location of each earthquake. These factors may help explain why the number of reported deaths differs between earthquakes. It would also be useful to study a larger dataset to see whether similar patterns appear across more earthquakes.
OpenIntro. (n.d.). Data Sets. https://www.openintro.org/data/
World Almanac and Book of Facts: 2011. (2011). Original source listed for the Earthquakes dataset.