── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
✖ purrr::lift() masks caret::lift()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)birth_sample<-read.csv("cleanedbirth.csv")BirthStat <-read.csv("dataset/BirthStat.csv")YI <-read.csv("dataset/Yearly income data.csv")birthdata <-read.csv("dataset/cleanedbirth.csv")combirth <- birthdata |>left_join(BirthStat, by =c("Year"="Year"))combirth <- combirth |>left_join(YI, by =c("Year"="Year"))birthweightmodel <-lm(dbwt ~ mager+ meduc+ m_ht_in+ bmi+ pwgt_r+ dwgt_r+ Married+ GDiabetes+ cig_before+ cig_during, data=birth_sample)summary(birthweightmodel)
logistic_model2 has a slightly lower AIC compared to logistic_model1, suggesting a better balance between goodness of fit and model complexity. logistic_model3 has a higher AIC, indicating a less favorable model fit compared to the other two. Firstly, Our regression model(‘motheragemodel’) indicates a significant influence of mathernal age on birth outcomes. For every one-year increase in mathernal age, we observed a decreae in birth weight by about 4.85 grams.
Secondly, our model also highlights the positive impact of mathernal education(‘meduc’). With each additional year of education, there’s an estimated 8.92 grams increase in birth weight, and the p value is less than alpha, which shows the importance of education in maternal and child health.
Lastly, Smoking habits before and during pregnancy (cig_before, cig_during) shows mothers who smoked before pregnancy had babies weighing 67.20 grams more than non-smokers. In addition, for mother who smoking during pregnancy, their babies weighing 259.91 grams less. This result shows extreme negative effects of continued smoking during pregnancy.