Skip to content

Instantly share code, notes, and snippets.

@cimentadaj
Created November 6, 2016 00:19
Show Gist options
  • Save cimentadaj/4c23c70e80f37e6cb77936d846618a9b to your computer and use it in GitHub Desktop.
Save cimentadaj/4c23c70e80f37e6cb77936d846618a9b to your computer and use it in GitHub Desktop.
# (b) Extend the model in (a) to include child-level predictors
# (that is, group-level predictors) for treatment and age at baseline.
# Fit using lmer() and interpret the coefficients on time, treatment,
# and age at baseline.
mod2 <- lmer(CD4PCT ~ VDATE + treatmnt + baseage + (1 | newpid), data = cd4)
display(mod2)
# coef.est coef.se
# (Intercept) 67.28 9.82
# VDATE -0.01 0.00
# treatmnt 1.26 1.54
# baseage -1.00 0.34
#
# Error terms:
# Groups Name Std.Dev.
# newpid (Intercept) 11.45
# Residual 7.32
# ---
# number of obs: 1072, groups: newpid, 250
# AIC = 7906.3, DIC = 7878.8
# deviance = 7886.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment