https://www.cdc.gov/nchs/data_access/VitalStatsOnline.htm#Period_Linked
https://ftp.cdc.gov/pub/Health_Statistics/NCHS/Dataset_Documentation/DVS/natality/UserGuide2020.pdf
### An R-Markdown file that:
###Explains the research question
How do prenatal maternal behaviors and health characteristics, such as age of mother at the time of the child’s birth, the number of cigarettes in the first semester, the mother’s education level, and the mother’s bmi at the time of birth, will these factors contribute to the infant survival rate?
The purpose of this research is to better understand how different variables impact infant survival rate to help design prenatal interventions to improve infant health.
The outcome variable is the infant’s with infant survival rate.
Mother’s education Mother’s age Cigarette use during the first trimester BMI
###Describes the data set
This data collection provides counts and rates for deaths of infants under 1 year of age, occurring within the United States to U.S. residents
###When was it collected?
2020
###How was it collected?
Centers for Disease Control and Prevention, National Center for Health Statistics
###How many observations and variables are there?
Number of observations and variables in the data set is 23,484 observations and 225 variables
When was it collected? Data from the year 2020
How was it collected? The data came from birth certificate records from
the CDC.
How many observations and variables are there? 23484 observations of 225
variables.
How were the outcome and predictors measured? (data types, categories,
values)
- Mother’s Age:
- Mager9
- categorical
- (1) Under 15 years - (2) 15-19 years - (3) 20-24 years - (4) 25-29
years - (5) 30-34 years - (6) 35-39 years - (7) 40-44 years - (8) 45-49
years - (9) 50-54 years
- Cigarettes 1st trimester:
- CIG_1
- Continuous
- 00-97 cigarettes daily
- 98: 98 or more cigarettes daily
- 99: unknown or not states
- Mother’s education level
- MEDUC
- Categorical
- 1: 8th grade or less
- 2: 9th through 12th with no diploma
- 3: High school graduate or GED completed
- 4 Some college credit, but not a degree
- 5: Associates degree (AA,AS)
- 6 : Bachelor’s degree (BA.AB, BS)
- 7: Master’s degree (MA, MS, MEng, MEd, MSW, MBA)
- 8: Doctorate or Professional degree
- 9: Unknown
-BMI:
BMI - 13.0-69.9 - Body Mass Index - 99.9 Unknown or not stated
-Infant Living at Time of Report Ilive - Y- Yes - N- No - U- Unknown or not stated
library(package = "tidyverse")
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.3 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.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(package = "haven")
library(package = "labelled")
library(package = "table1")
##
## Attaching package: 'table1'
##
## The following objects are masked from 'package:base':
##
## units, units<-
library(gmodels)
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
##
## The following object is masked from 'package:dplyr':
##
## recode
##
## The following object is masked from 'package:purrr':
##
## some
#import infant survival data
infantData <- read.csv ("~/Desktop/Wash U Classes /Biostatistics/End of Semester Project/nat2020ps.csv")
# change all the character variables and the infant mortality variable
# Create a data frame for the predictor variables
infantData.clean <- infantData %>%
select (ilive, cig_1, meduc, bmi, mager9) %>%
mutate(mager9 = as.factor(mager9),
cig_1 = as.numeric(cig_1),
cig_1 = na_if(cig_1, 99),
meduc = as.factor(meduc),
bmi = as.numeric(bmi),
bmi = na_if(bmi, 99.9),
ilive = as.factor(ilive)) %>%
mutate(meduc = recode_factor(meduc,
`1` = "8th grade or less",
`2` = "9th-12th grade no diploma",
`3` = "HS Graduate or GED",
`4` = "Some college",
`5` = "Associates degree",
`6` = "Bachelors Degree",
`7` = "Masters degree",
`8` = "Doctorate or Professional degree",
`9` = NA_character_)) %>%
mutate(mager9 = recode_factor(mager9,
`1` = "Under 15 years",
`2` = "15-19 years",
`3` = "20-24 years",
`4` = "25-29 years",
`5` = "30-34 years",
`6` = "35-39 years",
`7` = "40-44 years",
`8` = "45-49 years",
`9` = "50-54 years")) %>%
mutate(ilive = recode_factor(ilive,
'Y' = "Yes",
'N' = "No",
'U' = NA_character_)) %>%
rename(momEducation = meduc,
cigarettes = cig_1,
mothersAge = mager9,
BMI = bmi,
alive = ilive) %>%
drop_na(alive)
summary(infantData.clean)
## alive cigarettes momEducation BMI
## Yes:23021 Min. : 0.0000 HS Graduate or GED :6084 Min. :13.30
## No : 102 1st Qu.: 0.0000 Bachelors Degree :4905 1st Qu.:22.10
## Median : 0.0000 Some college :3969 Median :25.90
## Mean : 0.0468 Associates degree :3275 Mean :27.14
## 3rd Qu.: 0.0000 9th-12th grade no diploma:2075 3rd Qu.:30.90
## Max. :40.0000 (Other) :2108 Max. :69.00
## NA's :1260 NA's : 707 NA's :1045
## mothersAge
## 20-24 years:6840
## 25-29 years:6807
## 30-34 years:4603
## 35-39 years:2490
## 15-19 years:1741
## 40-44 years: 593
## (Other) : 49
# Display the data frames
## Table of Descriptive Statistics
table1(~ alive + momEducation + BMI + cigarettes + mothersAge,
data = infantData.clean)
| Overall (N=23123) |
|
|---|---|
| alive | |
| Yes | 23021 (99.6%) |
| No | 102 (0.4%) |
| momEducation | |
| 8th grade or less | 353 (1.5%) |
| 9th-12th grade no diploma | 2075 (9.0%) |
| HS Graduate or GED | 6084 (26.3%) |
| Some college | 3969 (17.2%) |
| Associates degree | 3275 (14.2%) |
| Bachelors Degree | 4905 (21.2%) |
| Masters degree | 1281 (5.5%) |
| Doctorate or Professional degree | 474 (2.1%) |
| Missing | 707 (3.1%) |
| BMI | |
| Mean (SD) | 27.1 (6.74) |
| Median [Min, Max] | 25.9 [13.3, 69.0] |
| Missing | 1045 (4.5%) |
| cigarettes | |
| Mean (SD) | 0.0468 (0.805) |
| Median [Min, Max] | 0 [0, 40.0] |
| Missing | 1260 (5.4%) |
| mothersAge | |
| Under 15 years | 13 (0.1%) |
| 15-19 years | 1741 (7.5%) |
| 20-24 years | 6840 (29.6%) |
| 25-29 years | 6807 (29.4%) |
| 30-34 years | 4603 (19.9%) |
| 35-39 years | 2490 (10.8%) |
| 40-44 years | 593 (2.6%) |
| 45-49 years | 31 (0.1%) |
| 50-54 years | 5 (0.0%) |
At first glance the prepared variables provide little indication of whether infant survival has any relation to the indicators. The median age of mother in particular seems to indicate very little relationship for infant survival.
# check normality of continuous variables.
# Histogram for BMI
bmi.dist <- infantData.clean %>%
ggplot(aes(x = BMI)) +
geom_histogram(fill = "#DD571C", alpha = .6, bins = 30) + # Adjust the number of bins as needed
theme_minimal() +
labs(x = "BMI",
y = "Number of Participants",
title = "Distribution of BMI")
# Histogram for Cigarettes
cigarettes.dist <- infantData.clean %>%
ggplot(aes(x = cigarettes)) +
geom_histogram(fill = "#9C51B6", alpha = .6, bins = 30) + # Adjust the number of bins as needed
theme_minimal() +
labs(x = "Cigarettes per Day",
y = "Number of Participants",
title = "Distribution of Cigarettes Consumption")
# Arrange the plots side by side
gridExtra::grid.arrange(bmi.dist, cigarettes.dist, ncol = 2)
## Warning: Removed 1045 rows containing non-finite values (`stat_bin()`).
## Warning: Removed 1260 rows containing non-finite values (`stat_bin()`).
The BMI distribution is skewed right between number of participants and BMI. It is not normally distributed.
Cigarette usage displays the frequency of various levels of cigarette consumption among mothers, which is skewed right. The histogram is not normally distributed.
### Discriptive Statistics Interpretation Participants that stated their
infant survived according to the bar chart heavily outweigh those who
said their infant did not. While educational attaintment is not normally
distribuated and is skewed somewhat toward the right. In addition the
age range of mother’s age seems not normally distributed.
H0: There is no correlation between the infant rate of survival and the age of the mother.
HA: There is a correlation between the infant rate of survival and the age of the mother.
CrossTable(y = infantData.clean$alive,
x = infantData.clean$mothersAge,
chisq = TRUE,
expected = TRUE,
sresid = TRUE,
prop.c = FALSE,
prop.t = FALSE,
prop.chisq = FALSE)
## Warning in chisq.test(t, correct = FALSE, ...): Chi-squared approximation may
## be incorrect
##
##
## Cell Contents
## |-------------------------|
## | N |
## | Expected N |
## | N / Row Total |
## |-------------------------|
##
##
## Total Observations in Table: 23123
##
##
## | infantData.clean$alive
## infantData.clean$mothersAge | Yes | No | Row Total |
## ----------------------------|-----------|-----------|-----------|
## Under 15 years | 13 | 0 | 13 |
## | 12.943 | 0.057 | |
## | 1.000 | 0.000 | 0.001 |
## ----------------------------|-----------|-----------|-----------|
## 15-19 years | 1736 | 5 | 1741 |
## | 1733.320 | 7.680 | |
## | 0.997 | 0.003 | 0.075 |
## ----------------------------|-----------|-----------|-----------|
## 20-24 years | 6801 | 39 | 6840 |
## | 6809.827 | 30.173 | |
## | 0.994 | 0.006 | 0.296 |
## ----------------------------|-----------|-----------|-----------|
## 25-29 years | 6788 | 19 | 6807 |
## | 6776.973 | 30.027 | |
## | 0.997 | 0.003 | 0.294 |
## ----------------------------|-----------|-----------|-----------|
## 30-34 years | 4577 | 26 | 4603 |
## | 4582.695 | 20.305 | |
## | 0.994 | 0.006 | 0.199 |
## ----------------------------|-----------|-----------|-----------|
## 35-39 years | 2481 | 9 | 2490 |
## | 2479.016 | 10.984 | |
## | 0.996 | 0.004 | 0.108 |
## ----------------------------|-----------|-----------|-----------|
## 40-44 years | 589 | 4 | 593 |
## | 590.384 | 2.616 | |
## | 0.993 | 0.007 | 0.026 |
## ----------------------------|-----------|-----------|-----------|
## 45-49 years | 31 | 0 | 31 |
## | 30.863 | 0.137 | |
## | 1.000 | 0.000 | 0.001 |
## ----------------------------|-----------|-----------|-----------|
## 50-54 years | 5 | 0 | 5 |
## | 4.978 | 0.022 | |
## | 1.000 | 0.000 | 0.000 |
## ----------------------------|-----------|-----------|-----------|
## Column Total | 23021 | 102 | 23123 |
## ----------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 10.51802 d.f. = 8 p = 0.230532
##
##
##
There is not a statistically significant relationship between survival status and mother’s age [χ²(2) = 10.51; p > .05]. The analysis indicated no notable variation in survival based on mother’s age. Specifically, a higher than expected number of deaths in age group 30-34 (n = 4577) (sresid = 1.26).
H0: There is no correlation between the number of cigarettes consumed in their first trimester and infant survival.
HA: There is a correlation between the number of cigarettes consumed in their first trimester and infant survival.
infantData.clean %>%
ggplot(aes(x = alive, y = cigarettes, fill = alive)) +
geom_violin(trim = FALSE) +
theme_minimal() +
labs(x = "Infant Survival Status",
y = "Cigarettes per Day",
title = "Cigarette Consumption and Infant Survival") +
scale_fill_brewer(palette = "Set2")
## Warning: Removed 1260 rows containing non-finite values (`stat_ydensity()`).
There appears to be a slight relationship between birth weight and the number of cigarettes consumed by the mother in their first trimester.
leveneTest(cigarettes ~ alive, data = infantData.clean)
## Levene's Test for Homogeneity of Variance (center = median)
## Df F value Pr(>F)
## group 1 0.0021 0.9633
## 21861
Given the high p-value (0.9633), you would not reject the null hypothesis of equal variances across the groups. This suggests that, statistically, the variances are similar across the groups compared.
alive_yes <- infantData.clean %>%
filter(alive == "Yes") %>%
pull(cigarettes)
alive_no <- infantData.clean %>%
filter(alive == "No") %>%
pull(cigarettes)
ks.test(x = alive_no, y = alive_yes)
## Warning in ks.test.default(x = alive_no, y = alive_yes): p-value will be
## approximate in the presence of ties
##
## Asymptotic two-sample Kolmogorov-Smirnov test
##
## data: alive_no and alive_yes
## D = 0.0067009, p-value = 1
## alternative hypothesis: two-sided
The high p-value (1) and results indicates that there’s no statistical evidence to suggest that the distributions of the two samples are different. In other words, it suggests that the two groups you are comparing likely come from the same distribution.
H0: Infant survival is equal across mother's education level.
HA: Infant survival is not equal across mother's education level.
infantData.clean <- infantData.clean %>%
mutate(momEducation = as.factor(momEducation),
alive = as.factor(alive))
education_table <- table(infantData.clean$momEducation, infantData.clean$alive)
chi_squared_test <- chisq.test(education_table)
## Warning in chisq.test(education_table): Chi-squared approximation may be
## incorrect
print(chi_squared_test)
##
## Pearson's Chi-squared test
##
## data: education_table
## X-squared = 2.0988, df = 7, p-value = 0.9542
It seems that the test did not find a significance in the relationship between the educaiton attainment and infant survival. This means that differences observed in the data are likely be due to chance.
H0: There is no correlation between BMI and infant survival.
HA: There is a correlation between BMI and infant survival.
- Continuous variable and independent groups. Met
- Independent observations. Met
- Normal distribution within groups. Not Met
- Equal variances within groups. Not Met
infantData.clean %>%
ggplot(aes(x = BMI, fill = alive)) +
geom_density(alpha = 0.7) +
facet_wrap(~ alive) +
scale_fill_brewer(palette = "Dark2", guide = "none") +
scale_color_brewer(palette = "Dark2", guide = "none") +
theme_minimal() +
labs(title = "Distribution of BMI Across Happiness Levels and Alive Status",
x = "BMI",
y = "Density",
fill = "Alive Status")
## Warning: Removed 1045 rows containing non-finite values (`stat_density()`).
The distribution of participants that stated their infant survived and
those who did not survive show very little difference in relation to
their BMI. It seems that further test must be done to indicate this is
true.
car::leveneTest(y = BMI ~ alive, data = infantData.clean)
## Levene's Test for Homogeneity of Variance (center = median)
## Df F value Pr(>F)
## group 1 1.8216 0.1771
## 22076
In this case, with a p-value of 0.1771, we would not reject the null hypothesis of equal variances across the groups. This suggests that the assumption of homogeneity of variances is not violated. The statistical evidence does not suggest a significant difference in the variances among the groups compared.
# ANOVA test
aov_results <- aov(BMI ~ alive, data = infantData.clean)
summary(aov_results)
## Df Sum Sq Mean Sq F value Pr(>F)
## alive 1 150 150.29 3.31 0.0689 .
## Residuals 22076 1002481 45.41
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 1045 observations deleted due to missingness
The p-value of 0.0689 suggests that there is a marginal difference in the means across the groups defined by the ‘alive’ variable. Since the p-value is greater than 0.05, we would not reject the null hypothesis. The data does not provide strong evidence for a significant difference in means between the two groups in the ‘alive’ variable.
Based on the 2020 birth data from the CDC, significant variables such as mother’s educational attainment, BMI, cigarette consumption during the first trimester, and mother’s age serve as crucial predictors for the survival status of infants at the time of reporting. The direct correlations between these predictor variables and the infant survival from graphical representations do support the statistical analyses does not support significant relationships.
Studies exploring factors influencing infant survival and health outcomes provide insight into similar variables. For instance, maternal lifestyle factors, including smoking habits and BMI, are widely recognized for their impact on infant health outcomes. Smoking during pregnancy, in particular, has been linked to increased risks for adverse outcomes, underscoring the importance of maternal health behaviors on infant survival [@cdc_tobacco_pregnancy_2021]
Educational attainment is another factor that has been extensively studied for its role in maternal and infant health. Higher levels of maternal education are often associated with better health choices during pregnancy, which can positively impact infant survival rates. Accoriding to a study from the University of Texas in Austin [@sierra2016paa], where mothers whose mothers have lower educational attainment levels experience an increased risk of mortality, ranging from 40% to 140%, compared to those born to mothers with college-level education or higher.
The bmi of the mother seems to play a moderate role in the first year of survival for infants. Studies have shown moderate risks associated with different BMIs accoriding to a 2014 study in the National Library of Health study [@ncbi_article_2014]. Maternal overweight and obesity may be an important preventable risk factor for infant mortality.
Studying these variables is crucial as they are not only predictors of immediate outcomes like infant survival but may also influence long-term health. Research indicates that factors affecting infant health at birth can have lasting effects, potentially influencing the likelihood of developing certain diseases later in life.
In conclusion, while the current study focuses on infant survival at the time of reporting, it aligns with broader research emphasizing the importance of maternal health, lifestyle, education, and age in determining infant health outcomes. This understanding is pivotal for designing effective public health strategies and interventions aimed at improving maternal and infant health.
###References
@misc{sierra2016paa, author = {Sierra, Firstname M.}, title = {Title of the Document}, year = {2016}, howpublished = {Population Association of America Annual Meeting}, url = {https://paa.confex.com/paa/2016/mediafile/ExtendedAbstract/Paper1845/SierraPAA2016_Final.pdf},
@article{ncbi_article_2014, title = {Maternal overweight and obesity in early pregnancy and risk of infant mortality: a population based cohort study in Sweden}, journal = {Nationa Health Library}, year = {2014}, url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4252825/},
@misc{cdc_tobacco_pregnancy_2021, title = {Health Effects of Smoking and Tobacco Use During Pregnancy}, author = {{Centers for Disease Control and Prevention}}, year = {2021}, url = {https://www.cdc.gov/tobacco/basic_information/health_effects/pregnancy/index.htm},}