infantmortality.qmd

Author

Bohlale Mosotho

Introduction

Infant mortality is the death of an infant before reaching one year of age. The infant mortality rate is an important measure of information about a society’s population, socioeconomic staus and healthcare and access to healthcare. It further explains the health of mothers, community engagement and child care and safety. It is often used as part of the HDI (Human Development Index). Moreover, it guides policy making regarding healthcare. In this assignment, the infant mortality in the United States from 2007 to 2016 is examined. I selected this topic because I am interested in finding out what underlying issues affect infant mortality rates and how those issues can be overcame. I find it important to solve a major public issue that affects many people in society despite the medical advancements made so far.

#DATA SOURCE

The dataset was found through the class course, in particular, it is from the CDC (Centers for Disease Control and Prevention by the NCHS (National Center for Health Statistics) via the NVSS (National Vital Statistics System.

#VARIABLE DEFINITIONS

The dataset includes 6 primary variables:

  1. Year :

    observation years (2007 - 2016)

  2. Infant mortality rate:

    number of infant deaths per 1000 births

  3. infant Deaths:

    total number of infant deaths recorded

  4. Maternal Race/Ethnicity:

    self reported racial/ethical background

  5. Live Births:

    total number of recorded births

  6. Neonatal deaths vs Post-neonatal deaths

    total number of deaths before 0-28 days and 28- 365 days of life.

    ##RESEARCH QUESTIONS

    1. Racial / Ethical disparity

      What are the racial or ethical implications in infant deaths?

    2. Neonatal vs Postneonatal

      What are the rates and possible issues casuasing high neonatal or postneonatal deaths?

    3. Underlying issues

      What is causing the high infant deaths over the years, sociaeconomic and background issues?

#|message: false
#|warning: false
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.2.1     ✔ readr     2.2.0
✔ forcats   1.0.1     ✔ stringr   1.6.0
✔ ggplot2   4.0.3     ✔ tibble    3.3.1
✔ lubridate 1.9.5     ✔ tidyr     1.3.2
✔ purrr     1.2.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(readr)
library(plotly)

Attaching package: 'plotly'

The following object is masked from 'package:ggplot2':

    last_plot

The following object is masked from 'package:stats':

    filter

The following object is masked from 'package:graphics':

    layout
raw_data<- read.csv("infantmortality.csv")

glimpse(raw_data)
Rows: 60
Columns: 9
$ Year                        <int> 2016, 2016, 2016, 2016, 2016, 2016, 2015, …
$ Maternal.Race.or.Ethnicity  <chr> "Puerto Rican", "Asian and Pacific Islande…
$ Infant.Mortality.Rate       <dbl> 3.4, 2.9, NA, 8.0, 2.6, 3.8, 6.1, 2.7, NA,…
$ Neonatal.Mortality.Rate     <dbl> 2.4, 2.0, NA, 4.9, 1.6, 2.4, 4.5, 1.8, NA,…
$ Postneonatal.Mortality.Rate <dbl> NA, 0.9, NA, 3.2, 1.0, 1.4, 1.6, 0.9, NA, …
$ Infant.Deaths               <int> 24, 62, NA, 180, 105, 102, 46, 110, NA, 18…
$ Neonatal.Infant.Deaths      <int> 17, 43, NA, 109, 65, 65, 34, 75, NA, 112, …
$ Postneonatal.Infant.Deaths  <int> 7, 19, NA, 71, 40, 37, 12, 35, NA, 74, 21,…
$ Number.of.Live.Births       <int> 7159, 21566, 1534, 22465, 40633, 26915, 75…

Installed the packages and the dataset and got a view of the data.

clean_data<- raw_data
names(clean_data)<- c(
  "Year",
  "Maternal_Race_Ethnicity",
  "Infant_Mortality_Rate",
  "Neonatal_Mortality_Rate",
  "Postneonatal_Mortality_Rate",
  "Infant_Deaths",
  "Neonatal_Deaths",
  "Postneonatal_Deaths",
  "Live_Births"
)
colSums(is.na(clean_data))
                       Year     Maternal_Race_Ethnicity 
                          0                           0 
      Infant_Mortality_Rate     Neonatal_Mortality_Rate 
                         10                          10 
Postneonatal_Mortality_Rate               Infant_Deaths 
                         12                          10 
            Neonatal_Deaths         Postneonatal_Deaths 
                         10                          10 
                Live_Births 
                          0 

Cleaned data by getting the missing data out of the way #Handling the data

data_step1<-clean_data %>%
  mutate(
    Infant_Mortality_Rate=replace_na(Infant_Mortality_Rate, 
             mean(Infant_Mortality_Rate, na.rm = TRUE)                        )
  )
filtered_data<- data_step1 %>%
  filter(Year>2007 & Year<=2016)%>%
  select(
    Year,
    Maternal_Race_Ethnicity,
    Infant_Mortality_Rate,
    Infant_Deaths,
    Live_Births,
    Neonatal_Mortality_Rate

  )
head(filtered_data)
  Year    Maternal_Race_Ethnicity Infant_Mortality_Rate Infant_Deaths
1 2016               Puerto Rican                 3.400            24
2 2016 Asian and Pacific Islander                 2.900            62
3 2016          Other/Two or More                 5.024            NA
4 2016         Non-Hispanic Black                 8.000           180
5 2016         Non-Hispanic White                 2.600           105
6 2016             Other Hispanic                 3.800           102
  Live_Births Neonatal_Mortality_Rate
1        7159                     2.4
2       21566                     2.0
3        1534                      NA
4       22465                     4.9
5       40633                     1.6
6       26915                     2.4

Filtered the data by year and the core 6 #Sorting the data by the highest average

sorted_summary<- filtered_data %>%
  group_by(Maternal_Race_Ethnicity) %>%
  summarize(
    Average_Mortality_Rate= mean(Infant_Mortality_Rate, na.rm = TRUE), 
    Total_Deaths= sum(Infant_Deaths, na.rm = TRUE),
    Total_Live_Births = sum(Live_Births, na.rm = TRUE)) %>%
      arrange(desc(Average_Mortality_Rate))
    sorted_summary
# A tibble: 8 × 4
  Maternal_Race_Ethnicity  Average_Mortality_Rate Total_Deaths Total_Live_Births
  <chr>                                     <dbl>        <int>             <int>
1 Black Non-Hispanic                         8.67         1572            180328
2 Non-Hispanic Black                         8             366             45581
3 Puerto Rican                               6.07          478             78128
4 Other/Two or More                          5.02            0             16981
5 Other Hispanic                             4.39         1130            257016
6 White Non-Hispanic                         2.99          806            272302
7 Asian and Pacific Islan…                   2.98          529            177142
8 Non-Hispanic White                         2.65          215             81240

The summary of data simplified the data and focus in order to compare the averages. #Linear regression

reg_model<- lm(Infant_Mortality_Rate ~ Year, data=filtered_data)
summary(reg_model)

Call:
lm(formula = Infant_Mortality_Rate ~ Year, data = filtered_data)

Residuals:
    Min      1Q  Median      3Q     Max 
-2.5384 -1.8521 -0.3792  1.1710  4.7427 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) 244.1862   216.3930   1.128    0.264
Year         -0.1189     0.1076  -1.105    0.274

Residual standard error: 2.041 on 52 degrees of freedom
Multiple R-squared:  0.02296,   Adjusted R-squared:  0.00417 
F-statistic: 1.222 on 1 and 52 DF,  p-value: 0.2741

The infant mortality rates make a linear regression from 2007-2016 #Viewing the line regression to see if it is significant

par(mfrow=c(1,2))
plot(reg_model, which = c(1,2))

The line regression is significant and infant mortality rates significantly lower. #Final visualization 1

ggplot(filtered_data, aes(x=Year, y=Infant_Mortality_Rate, color=Maternal_Race_Ethnicity))+
  geom_line(linewidth=1)+
  geom_point(size=2)+
  theme_minimal()+
  labs(
    title= "Infant Mortality Trends by Race/Ethnicity(2007-2016",
    x= "Year",
    y= "Infant Deaths per 1000 Live Births",
    color= "Race/Ethnicity"
  )

A line chart to show trends over years of infant mortality by race/ethnicity. #Final Visualization 2: using plotly

boxplot<-ggplot(filtered_data, aes(x= Maternal_Race_Ethnicity, y= Infant_Mortality_Rate, fill= Maternal_Race_Ethnicity))+
  geom_boxplot()+
  theme_classic()+
  labs(
    title= "Spread of Infant Mortality by Race",
    x="Maternal Race/Ethnicity",
    y="Mortality Rate per 1000 live births",
    fill="Race/Ethnicity"
  )+
  theme(axis.text.x = element_text(angle=15,hjust=1))
ggplotly(boxplot)

The boxplot show the disparities faced racially for infant mortalities. The visualizations both show the gaps between infant mortality by race. According to the line chart, race is a huge determining factor of infant mortality paired with neonatal mortality rate the highest.While, the boxplot shows non hispanic black suffered the most infant deaths. In conclusion, infant mortality is still far too high despite all advancements in womens’ and children’s vast medical research. Over the years, it has been stagnant, when it should lower. In this set of data, I would like to add gender of the child, age of the mother and socio-economic standing as I believe those play a huge role in postneonatal infant deaths. I would also like to know if neonatal deaths which are higher than postneonatal deaths; have anything to do with the mother’s environment and genetics.
References: Ely DM, Driscoll AK, Mathews TJ. Infant mortality by age at death in the United States, 2016. NCHS Data Brief, no 326. Hyattsville, MD: National Center for Health Statistics. 2018.https://www.cdc.gov/nchs/products/databriefs/db326.htm Mathews TJ, Driscoll AK. Trends in infant mortality in the United States, 2005–2014. NCHS data brief, no 279. Hyattsville, MD: National Center for Health Statistics. 2017. https://www.cdc.gov/nchs/products/databriefs/db279.htm