Breakdown of the Data - Dive:
Set-up:
# Load the typical libs
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.2.3
##
## 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
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.2.1 ✔ stringr 1.4.0
## ✔ tidyr 1.2.0 ✔ forcats 0.5.1
## ✔ readr 2.1.2
## Warning: package 'tibble' was built under R version 4.2.3
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(ggplot2)
Init the link to the dataset:
# Re-instance the COVID data set:
COVID = read_delim("../data/COVID_country.csv",delim = ",")
## New names:
## Rows: 6208 Columns: 11
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (5): country, iso3, sex, age_group, type dbl (5): year, pop, expected.mean,
## acm.mean, excess.mean* lgl (1): ...11
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...11`
# Alias the COVID data set name :D
data <- COVID
summary(data)
## country iso3 year sex
## Length:6208 Length:6208 Min. :2020 Length:6208
## Class :character Class :character 1st Qu.:2020 Class :character
## Mode :character Mode :character Median :2020 Mode :character
## Mean :2020
## 3rd Qu.:2021
## Max. :2021
## age_group pop type expected.mean
## Length:6208 Min. : 0 Length:6208 Min. : 0.0
## Class :character 1st Qu.: 35177 Class :character 1st Qu.: 370.8
## Mode :character Median : 267600 Mode :character Median : 2438.0
## Mean : 2520267 Mean : 17998.0
## 3rd Qu.: 1194828 3rd Qu.: 9056.5
## Max. :324033981 Max. :1578937.0
## acm.mean excess.mean* ...11
## Min. : 0 Min. :-100092.0 Mode:logical
## 1st Qu.: 411 1st Qu.: 0.0 NA's:6208
## Median : 2720 Median : 84.0
## Mean : 20403 Mean : 2394.2
## 3rd Qu.: 10440 3rd Qu.: 799.2
## Max. :1733563 Max. : 588931.0
I’ll be concentrating on the country, sex,
and type attributes (columns). Before a user can comprehend
these three columns, they must first read the documentation. Although
the encoding options were made to maintain data consistency, failure to
consult the documentation may result in misconceptions and errors in
data analysis and interpretation. As a result, it is critical to for the
user/reader to read the documentation in order to completely appreciate
and understand these attributes.
Column: country
Aspect is unclear. It is not immediately evident how nation names
or codes are encoded in the ‘country’ column. As well, there is a
iso3 property that displays the country code.
Given that this data was obtained from the World Health Organization [WHO], it is likely that the authors utilized this encoding to support various international standards for country identification. It might be a mix of country names and ISO country codes to preserve compatibility with multiple data sources.
If users (such as myself - who is reviewing this data set) do not
follow the documentation, they risk misinterpreting the encoding as
simply country names or codes (iso3), which might lead to
erroneous analysis or comparisons. This is essential because when I map
the COVID data, my primary analysis will be based on the nation and
population.
Column: sex
The aspect is ambiguous. The gender encoding in the
sex column (i.e., “M” for male and “F” for female) may be
confusing.
Consumers would not understand why the encoding was chosen without the documentation, even if it was done for ease and consistency in data storage. Male and female are designated by the letters “M” and “F” in statistics, however, those who frequently read studies or yearly reports may not be familiar with this notation, making it unclear.
Users risk misinterpreting the gender encoding given in the preceding statement if they do not read the documentation. This can lead to erroneous gender judgments or interpretations.
Column: type
The feature is ambiguous. It’s unclear what the type
column does or implies without the documentation.
This column was probably added because it offers a range of information about the observations, although the particular categories or meanings are not obvious from the column name alone.
Users who have not read the documentation may struggle to grasp
the significance of the type column, which may lead to
misunderstandings or the loss of crucial information.
The “Niue” element, which I identified in the week 3 data dive, is the part of the data that is still unclear even after reading the documentation.
What is unclear about “Niue” in the data even after reading the documentation?
The precise reasons “Niue” is classified as an abnormality are yet not entirely understood.
The data set documentation is silent on the methods used to determine or get the “Niue” population. Understanding the procedures and sources utilized to collect statistics for this country may help understand its uniqueness.
The documentation makes no mention of any conceivable outside causes or events that may have impacted “Niue” to have these characteristics. Due to the lack of context, determining “Niue’s” place in the data set is challenging.
Is there anything about the data that your documentation does not explain?
True, the documentation for “Niue” does not provide enough information on the data sources and collection process. Furthermore, no information regarding external factors or background data that could have influenced the data patterns seen for “Niue” is provided in the documentation.
Conclusion:
Although “Niue” is identified as an anomaly in the dataset during the week 3 data dive due to its small population and lack of excess mortality, the official documentation does not fully explain why “Niue” is unique or provide insights into the underlying factors influencing its distinct status in the data. More study and context will be required to fully appreciate the features of “Niue” in the COVID dataset.
Visualization of The “Niue” Element and the “Population” Attribute:
Because “Niue” has such a tiny population in comparison to the other nations, the population column would be one of the columns impacted by the “Niue” problem. It is important to note that this graphic just compares Niue to other countries; it does not include the entire dataset. It’s also important to understand that “Niue” is designed to stand out as an anomaly or outlier in this image.
Visual:
# Do random seed for country samples.
set.seed(123)
# Grab "Niue" as one of the countries
sample_countries <- data.frame(
country = c("Niue", sample(data$country, 11)),
population = c(3884, sample(data$pop, 11))
)
# Display the sample countries.
sample_countries
## country population
## 1 Niue 3884
## 2 Hungary 2475
## 3 India 2377
## 4 Greece 3999948
## 5 Bulgaria 3477102
## 6 Oman 288877
## 7 Saint Kitts and Nevis 567716
## 8 Finland 454658
## 9 Democratic Republic of the Congo 5384158
## 10 Latvia 5735433
## 11 Syrian Arab Republic 3179265
## 12 Syrian Arab Republic 4179387
# ggplot has already been loaded. So, make the visual.
ggplot(sample_countries, aes(x = country, y = population, fill = country))+
geom_bar(stat="identity")+
labs(title="Population Comparison Between Niue and 11 Random Countries",
x = "Country",
y = "Population")+
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
geom_text(aes(label = ifelse(country == "Niue", "Unclear", ""), vjust = -0.5))
Unclear Aspects:
Although “Niue” is identified as an anomaly in the dataset despite having a small population and is labeled as “unclear” on the bar chart, the explanation for this is unknown. The documentation does not go into great detail on what makes this circumstance unique.
Furthermore, the explanation does not explain why “Niue” has a smaller population than the other countries in the dataset.
Significant Risks:
The fundamental worry is that, if properly considered, “Niue” may skew the data analysis technique or models. As a result, as I mentioned in my week 3 data dive, its singularity may introduce bias or irregularities into statistical analyses. As a result, the approach I may employ to reduce this risk is as follows:
Conduct a thorough examination of the “Niue”-specific data sources and data quality.
Consider whether “Niue” should be treated differently in data processing, maybe by employing statistical techniques to deal with outliers or irregularities.
Look for more publications or studies that examine the COVID dataset and “Niue” in depth. This might assist us in understanding Niue’s unique situation and any potential data issues.
Overall, this visualization highlights the issue with “Niue” in the collection of my data, particularly its population outlier status, and underscores the need for more research and careful handling of this unique occurrence in data analysis.