Suppose we have a mixed model for repeated measures with response being $y$ and a covariate being $x$(say, age). There are two classification factors $a$ and $b$. Say, 5 psychological patients($a$) in 8 conditions($b$) are measured.
I want to know how I get the estimates of intercepts and slopes (and their standard errors) of the random effects model when:
- $a$ fixed, $b$ random
- $b$ fixed, $a$ random
- Both random
How should the appropriate code look like?
Besides, can you tell me something about the meaning of the following error message?
nlminb problem, convergence error code = 1
message = iteration limit reached without convergence (10)
random=~1|id
corresponds to a random intercept for each statistical unitid
whilerandom=~grp|id
would yield random intercept and slopes (forid
within each level ofgrp
). For crossed random effects, things are a little bit more complicated and you'll need to use one of thepdBlocked
together withpdIdent
(block diagonal VC matrix with diagonal blocks given by multiples of the identity matrix) orpdSymm
(id. with PD matrices). I would be happy to try to give more details with a small working example. $\endgroup$