2
$\begingroup$

I have a longitudinal dataset with a normally distributed outcome variable, a normally distributed predictor variable, and a binary grouping variable. I am trying to construct a GLMM with differing random effect variance structures for group 1 and group 0. The code that I am using is

library(lme4)
dat$group1 = ifelse(dat$group==0, 1, 0)
dat$group0 = ifelse(dat$group==1, 1, 0)
mod<-lmer(response~predictor + (0+group1|id) + (0+group0|id), data= dat)
summary(mod)

The output that I get is:

 Groups             Name     Variance Std.Dev.
 visit_individual   group0    466.81   21.606  
 visit_individual.1 group1    676.92   26.018  
 Residual                     352.60   18.778  

Does this look right? What mathematical model does this correspond to? My interpretation of the output is that variance for group0 describes, on average, how much the outcome bounces around from group 0 participant to group 0 participant and the variance for group1 describes, on average, how much the outcome bounces around from group 1 participant to group 1 participant. What does the residual variance describe here?

$\endgroup$
1
  • 1
    $\begingroup$ Yes, I think that looks right, though this is an LMM not a GLMM. The mathematical model for a lijear mixed model is $Y = X\beta + Zu + \epsilon$ where $X$ and $Z$ are model matrixes for the fixed and random effects respectively, $\beta$ is the fixed effects vecetor and $u$ is the random effects vector. $\endgroup$ Commented Feb 23, 2021 at 19:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.