===================================================================================================================
===================================================================================================================
The dataset I am importing is titled, “child_mortality_by_income_level_of_country.” The overall dataset includes 4 variables, a total of 13,980 observations and 212 countries between the years of 1931 to 2024. The variables provided are Entity, which represents the country/region and income-group. The second variable is Code, it is the identity code for each entity. Third is Year, in which the child morality rate was collected. Fourth and lastly is Child Morality Rate which represents each entity and year documented in the dataset.
There are 13,980 observations, each row signifies one observation for a individual entity during a specific year. For instance, in the dataset we see Afghanistan includes multiple observations because its child morality rate is documented between several years (specifically, 1957 to 2024). The variables relevant to my analysis are Year and Child Morality Rate. I will be using Year to compare each time frame and Child Morality Rate to evaluate if there is difference.
The dataset I am referencing for my data analysis can be found on the ourworldindata.org website, https://ourworldindata.org/child-mortality#all-charts (direct link).
To clean the dataset and conduct exploratory data analysis (EDA) to better understand the data, the two functions I will be using are ‘str’ and ‘length’. They’re 13,980 observations in the data set I retrieved, using the ‘str’ function allowed me to see which variables were categorical or quantitative and delivered the distribution of the dataset clearly which helped me be sure that I am reviewing the correct information needed for my data analysis/question. The next function I decided to use was ‘length’ because they’re many rows/observations within the dataset, it was hard to see how many countries were recorded alone. Using the ‘length’ function, it outputted that there were 212 entities/countries within the data set, the exact information I needed to continue my analysis.
str(mortality_rate)
## 'data.frame': 13980 obs. of 4 variables:
## $ Entity : chr "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ...
## $ Code : chr "AFG" "AFG" "AFG" "AFG" ...
## $ Year : int 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 ...
## $ Child.mortality.rate: num 36.8 36.2 35.6 35.1 34.5 ...
length(unique(mortality_rate$Entity))
## [1] 212
The three dplyr functions I chose to manipulate the dataset and prepare it for analysis were ‘filter’, ‘select’ and ‘mutate’. I chose ‘filter’ to help gather the ranges I needed for my analysis, ‘select’ to import the significant columns and ‘mutate’ to create two time periods needed to compare.
mortality_rate <- mortality_rate %>%
filter(Year >= 1990 & Year <= 2024) %>%
select(Entity, Year, Child.mortality.rate) %>%
mutate(Period = ifelse(Year <= 2007, "1990-2007", "2008-2024"))
entity_averages <- mortality_rate %>%
group_by(Entity, Period) %>%
summarise(Mean = mean(Child.mortality.rate, na.rm = TRUE))
TimePeriod1 <- entity_averages %>%
filter(Period == "1990-2007") %>%
arrange(Entity)
TimePeriod2 <- entity_averages %>%
filter(Period == "2008-2024") %>%
arrange(Entity)
The types of plots I will generate are a box plot and a bar chart. I chose these two plots because they show different information of the data. The box plot shows the arrangements and outliers that is within the data, the outliers show that some countries/regions had a higher Child Mortality rates between the time periods compared to others. The bar chart represents the averages between the two periods and differentiate the means of Child Mortality rates.
entity_averages <- mortality_rate %>%
group_by(Entity, Period) %>%
summarise(Mean = mean(Child.mortality.rate, na.rm = TRUE))
ggplot(entity_averages, aes(x = Period, y = Mean)) +
geom_boxplot() +
labs(title = "Child Mortality Rates (Time Period)",
x = "Time Period", y = "Average Child Mortality Rate %")
period_average <- entity_averages %>%
group_by(Period) %>%
summarise(Mean = mean(Mean))
ggplot(period_average, aes(x = Period, y = Mean)) +
geom_col() +
geom_text(aes(label = paste0(round(Mean, 1), "%")),
vjust = -0.5) +
labs(title = "Average Child Mortality Rates (Time Period)",
x = "Time Period", y = "Average Child Mortality Rate %")
DEFINITIONS:
μ1 = Mean Child Mortality Rate between 1990-2007.
μ2 = Mean Child Mortality Rate between 2008-2024.
α = 0.05
HYPOTHESES:
The Average mortality rate is…
Null hypothesis (H₀): μ1 = μ2 (The same between two time periods).
Alternative (Ha): μ1 ≠ μ2 (Different between two time periods).
The test best paired with my analysis was the t-test.
t.test(TimePeriod1$Mean, TimePeriod2$Mean, paired = TRUE)
##
## Paired t-test
##
## data: TimePeriod1$Mean and TimePeriod2$Mean
## t = 13.371, df = 211, p-value < 2.2e-16
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 2.259598 3.041067
## sample estimates:
## mean difference
## 2.650332
mean(TimePeriod1$Mean)
## [1] 5.711935
mean(TimePeriod2$Mean)
## [1] 3.061602
mean(TimePeriod1$Mean) - mean(TimePeriod2$Mean)
## [1] 2.650332
PAIRED T-TEST RESULTS:
During 1990-2007 the average Child Mortality rate was at 5.71%, then it
decreased to 3.06% between the years of 2008-2024. The average Child
Mortality rate has decreased 2.65% between the two time periods. The
t-test provided that t = 13.371, which shows strong evidence that the
mean difference was large, resulting in the p-value being less than
0.001. Since the p-value is p-value < 2.2e-16, it is less than 0.001
and it is smaller than alpha (0.5). Accordingly, the null hypothesis was
rejected and statistically supports that there was a difference in the
average Child Mortality rate across Countries/Regions between the two
time periods of 1990-2007 and 2008-2024.
The overall finding of this analysis reveals that the Child Mortality rates were much higher through the years of 1990-2007(5.71%) than through the years of 2008-2024(3.06%) with a difference of 2.65%. The t-test and the p-value being less than 0.001 further supports the significant difference between the two time periods.
This analysis implicates that the Child Mortality rate has decreased during the years. Therefore, answering my question by presenting the differences of the two Child Mortality rates and indicating that it has declined between the years of 2008-2024. Based on the results, it shows child well-beings have progressed across the countries/regions provided in the dataset.
Future research or further analysis can suggest what has contributed to the decrease of Child Mortality rates. Does it have to do with what they have access to in terms of food, water, healthcare and their overall environment. What has changed economically, socially or environmentally between each countries/regions that were documented?
REFERENCE(S)
Dattani, S., Spooner, F., Ritchie, H., & Roser, M. (2023). Child and infant mortality. Our World in Data. https://ourworldindata.org/child-mortality