Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question (HLM: the Random Intercept Model) A small data set is shown below. This

ID: 3804234 • Letter: Q

Question

Question (HLM: the Random Intercept Model) A small data set is shown below. This is a study of process of losing weight. There are five participants (ID), whose weights are measured during month 0,1,2,4 (time), and the corresponding BMIs are calculated BMI Their first BMIs in month 0 are baseline BMI (baseline). ID time baseline BMI 20 20 2 20 21 3 20 22 20 24 5 25 25 6 25 28 7 25 27 8 25 28 9 26 26 10 3 26 24 26 25 12 3 4 26 28 13 4 0 21 21 14 4 1 21 26 15 4 2 21 24 16 4 4 21 25 17 5 23 23 18 5 1 23 28 19 5 2 23 27 20 5 4 23 28 For ith measurement of individual j, variable Yu is the BMI, variable rij is the time. For individual j, variable 2, is the l BMI, say, the BMI of individual j at time 0. For example, for the first row in the data set, i 1 and j 1, 11 20, z11 0, 21 20. (1) First, run three models below (Model 1,2,3), report estimates for random intercept model (by following the format of tables which we introduced in class on March 7 2017), including fixed effect (coefficients and SEs), random effect (variance components and SEs), and calculate the residual ICCs (intraclass correlation coefficients) Model 1 noo 2012, Voi N(0,02), U N(0, TO)

Explanation / Answer

#please be specific with the question , i dont understand why you have mentioned the R code of different problem in this question. below i have provided the code the above BMI problem models

library(psych)
library(lme4)

id = c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5)
time = c(0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4)
baseline = c(20,20,20,20,25,25,25,25,26,26,26,26,21,21,21,21,23,23,23,23)
bmi = c(20,21,22,24,25,28,27,28,26,24,25,28,21,26,24,25,23,28,27,28)
people = data.frame(id,time,baseline,bmi)

#print(people)
model1 <- lmer(id ~ 1 +(1|time),data= people,REML=FALSE)
summary(model1)
model2 <- lmer(id ~1 +(1|time),data= people, REML=TRUE)
summary(model2)
model3 <- lmer(id ~1 +baseline+(1|time),data= people, REML=TRUE)
summary(model3)
m <-mean(bmi)
s<- sd(bmi)
pnorm(bmi, m, s, lower.tail=FALSE)