The lab specifications can be found [here]
Use the table1 package to create a table with
appropriate descriptive information about the data set. Use the examples
provided in the following vignette to help you build a table.
| No (N=1564) |
Yes (N=124) |
|
|---|---|---|
| Birth Weight (g) | ||
| Mean (SD) | 3250 (601) | 3070 (597) |
| Median [Min, Max] | 3290 [369, 5880] | 3090 [630, 4220] |
| Risk Factors Reported | ||
| No | 1088 (69.6%) | 84 (67.7%) |
| Yes | 476 (30.4%) | 40 (32.3%) |
| Mother Age | ||
| Mean (SD) | 29.0 (5.79) | 27.8 (5.79) |
| Median [Min, Max] | 29.0 [15.0, 49.0] | 28.0 [17.0, 42.0] |
| Mother Race/Hispanic Origin | ||
| NH White | 844 (54.0%) | 94 (75.8%) |
| NH Black | 266 (17.0%) | 14 (11.3%) |
| NH Other | 125 (8.0%) | 10 (8.1%) |
| Hispanic | 329 (21.0%) | 6 (4.8%) |
| Marital Status | ||
| Married | 1017 (65.0%) | 40 (32.3%) |
| Unmarried | 547 (35.0%) | 84 (67.7%) |
| Mother Education | ||
| lower | 177 (11.3%) | 34 (27.4%) |
| HS | 377 (24.1%) | 45 (36.3%) |
| Some college | 437 (27.9%) | 37 (29.8%) |
| Uni | 573 (36.6%) | 8 (6.5%) |
| PRIORLIVE | ||
| 0 | 601 (38.4%) | 38 (30.6%) |
| 1 | 516 (33.0%) | 41 (33.1%) |
| 2 | 265 (16.9%) | 17 (13.7%) |
| 3 | 93 (5.9%) | 17 (13.7%) |
| 4+ | 89 (5.7%) | 11 (8.9%) |
| PRIORDEAD | ||
| 0 | 1551 (99.2%) | 123 (99.2%) |
| 1+ | 13 (0.8%) | 1 (0.8%) |
| Mother BMI | ||
| Mean (SD) | 26.9 (6.32) | 27.3 (6.42) |
| Median [Min, Max] | 25.6 [15.6, 58.4] | 26.3 [16.5, 50.1] |
Bonus: Provide a brief description, interpretation or reflection about your findings from the table: (e.g., what do you notice? what do you wonder? how does this relate to you or your community?)
Answer: See table as well. We see that less than 7.3% of the mothers smoked. The mean birth weight is a bit lower than the median birth weight for both smokers and non-smokers, suggesting a few babies at least with a low birth weight (left skewed). Mothers who smoked were more often of Non-Hispanic White descent and much more often unmarried. Additionally, smoking mothers had a lower educational status. Finally, there were small differences in age and BMI with smoking mothers being younger and heavier.
Use the ggpairs function to explore the association
between the different variables. Try to replicate the figure below, or
create your own variation.
Bonus: Provide a brief description, interpretation or reflection about your findings from the table.
Answer: See plot as well. The plotted data aligns with the tabulated data. Smoking mothers are slightly younger, more often unmarried and babies from smoking mothers have a lower birth weight. There are correlations between mothers age and BMI and mothers age and the baby birth weight. The latter is depending on the smoking status of the mother. The bar charts are bit hard to interpret in the plots because they are very dense and the % of smoking mothers is relatively small (7.3%). The histograms and diagonal density plots are easier to interpret.
Fit four linear models, each nested within the other: the null model,
the unadjusted model, the full model and the optimal model. Use the
step function find the optimal model using the stepwise
method. Then use anova to compare the four models. What is
your conclusion? Now compare your models using modelsummary
function. What does the number in the (brackets) mean? How can you
identify the optimal model just by looking at the \(R^2\) and the AIC?
Answer: The number in brackets represents the Standard Error. We can identify the optimal model by looking at the highest R^2 and the lowest AIC. We can compare based on adjusted R^2 because the models are nested within each other. The optimal model performs better than the null and unadjusted. The optimal model does perform slightly better than the full model if we look at the adjusted R^2 metric.
Center and scale all the continuous variables, and create a forest plot for the optimal model.
Answer: Here forest plot is displayed of predictors together with their coefficients. Blue lines represent a positive contribution to birth weight, the opposite for the red lines meaning a negative contribution to birth weight. Examples for interpreation: Smoking during pregnancy seems to be associated with a decrease in birth weight; Unmarried women seem to deliver babies with a lower weight.
How do the effect estimate of smoking, the standard error of its estimate, its 95% confidence interval, and its statistical significance change between the un-adjusted, optimal and full models? Please use the centered and scaled models to answer this question.
Answer: The effect estimates for smoking decreases from unadjusted model to full model indicating a potentially diminishing effect as more variables are included in the model. Standard errors are quite similar between the models, indicating relatively consistent estimates. The 95% confidence interval decreases as the model adjusts for more variables, which is expected as the precision improves. p-values are below 0.05 for all models, suggesting statistical significance in each model.
Does the association between cigarette smoking during pregnancy and
birth weight depend on mother’s education? Modify the FULL model
appropriately to be able to answer this question. Use anova
to test whether the model with the interaction is significantly better
than the one without it. Regardless of statistical significance, create
a dumbell
plot illustrating the smoking effect at each level of mother’s
education and estimate the cigarette smoking effect at each level of
mother’s education. Hint: When creating the dataset for plotting,
include the value zero for each predictor not included in the
interaction (the reference level for all categorical variables). Picking
the value zero in a centered predictor is like choosing the mean of that
variable, which is a reasonable choice.
Answer: Based on the plot it seems that smoking changes the birth weight of the babies depending on the education of the mother, but the model including the three-way interaction is not significantly better than the one without it.
More extensively: We’ve recreated the Hispanic graph and compared the association between cigarette smoking during pregnancy and birth weight and whether this depend on mother’s education. We can observe that there is no difference between birth weight and mother education for the non-smokers but there is a widespread variation for the smokers in birth weight based on their education level. we can see an increase in birth weight for University educational levels and High school, a neutral association for High school and a decrease in birth weight for ‘some college’ educational levels.
Does the association between mother’s BMI and birth-weight differ
between mothers of different race/ethnicity? Modify the OPTIMAL model
appropriately to be able to answer this question, using the dataset with
the centered variables. Use anova to test whether the model
with the interaction is significantly better than the one without it.
Regardless of statistical significance, estimate the BMI effect at each
level of mother’s race/ethnicity and plot the BMI effect at each level
of mother’s race/ethnicity using a dumbell plot.
Answer: The model including the interaction is not significantly better than the one without it.
Bonus: Provide a brief description, interpretation or reflection about what you see in the plot (e.g., what do you notice? what do you wonder?): In the plot, we see that BMI influences birth weight differently for different races/ethnicities of the mother. While Hispanic, black, and white moms show a similar slope, mothers with other races/ethnicities show a steeper one. Therefore it seems that for these races/ethnicities (NH Other) the effect of BMI on birth weight is significantly larger as compared to other races/ethnicities. Furthermore, we clearly see that black mothers have a lower birth weight overall as compared to all other races/ethnicities. It would be interesting to see what the “NH Other” group consists of specifically, to further elucidate which race/ethnicity might influence this difference the most. Or if perhaps all races/ethnicities in this group show a bigger effect of BMI on birth weight.
Does the association between mother’s BMI and birth-weight depend on
mother’s age? Modify the FULL model appropriately to be able to answer
this question, using the dataset with the centered variables. Use
anova to test whether the model with the interaction is
significantly better than the one without it. Regardless of statistical
significance, estimate the BMI effect for mothers age 20, 30, and 40
years and make a plot illustrating the BMI effect at each of these
ages.
Bonus: Provide a brief description, interpretation or reflection about what you see in the plot (e.g., what do you notice? what do you wonder?): In this plot, we can see that the effect of BMI on birth weight is more or less similar between different ages (20, 30 and 40), as depicted by the similar slopes. However, it seems that younger mothers usually have a larger birth weight on average. This depends on the BMI of said mother since we can see that a mother aged 30 with an increased BMI (mean + sd) is associated with a larger birth weight than a mother aged 20 without an increased BMI (mean). This holds true for the differences in mothers aged 30 and 40 as well, although to a lesser extent. We wonder what the effect might be across all ages, rather than stratified into set groups. At what ages would the difference in birth weight be the most? Where does this effect kick in and at around what age does it settle down?