IEOR156/256-无代写
时间:2024-04-12
IEOR 156/256: Healthcare Analytics
Homework 8
March 11th, Thursday, 11:59pm PST
For this homework, we will be using R and RStudio to perform linear and logistic regression. Download
R and RStudio at https://posit.co/download/rstudio-desktop/. Download lme4 package with the command
install.packages("lme4"). Update Matrix package using the command install.packages("Matrix")
if necessary.
Problem 1 Generalized Linear Mixed-Effects Model [20 points]
For this problem, we use the data of birthweights of first-born to last-born infants from mothers (each of
whom had five children) from vital statistics in Georgia. The csv file can be found in the bCourses Files1.
1. Perform generalized linear mixed-effects model using glmer command. Use initage, timeesnc (the
number of years since first baby), birthord (order of baby born) as fixed effects, and momid as random
effect variable. The commands are given below:
> library(lme4)
> data <- read.csv("your-directory-to-csvfile/gababies.csv")
> model <- glmer(lowbrth ~ initage + timesnc + birthord + (1 | momid),
+ data = data, family = binomial(link = "logit"))
> summary(model)
Paste the output as your answer to this part. You may ignore warning messages. (4 points)
2. Consider a newborn baby who is a 5th child born to a mother who has a initial birth age of 15 and
timesnc of 10. This baby had a birthweight that was considered to be low (i.e. lowbrth == 1).
Compute the effect of this mother to give birth to a child with low birthweight. (8 points)
3. The random effect (momid) has a variance of 2.311. Calculate the intraclass correlation coefficient
(ICC) for the model, which represents the proportion of the total variance in the odds of giving birth
to a child with low birthweight that is attributable to differences between mothers. Use π
2
3 for σ
2
within.
(8 points)
1Vittinghoff E, Glidden D, Shiboski S, McCulloch C. Regression Methods in Biostatistics. New York: Springer Sci-
ence+Business Media; 2012.
essay、essay代写