2
$\begingroup$

I have a dataset with cluster correlated data; multiple measurement on the same subject (not over time). I am trying to create two different mixed models using lmer in R with two specific variance covariance structures. I am fairly confident I have my first model correct, I want each subject to have its own intercept but share a covariance parameter. The second model I would like to allow for each subject to have its own covariance parameter.

model 1:

y ~ (1|subject)

$$ \Sigma = \sigma^2 \left( \begin{array}{cccc} \Sigma_1 & 0 & \dots & 0 \\ 0 & \Sigma_1 & & 0 \\ \vdots & & \ddots & \vdots \\ 0 & 0 & \dots & \Sigma_1 \end{array} \right) $$

where:

$$ \Sigma_1 = \left( \begin{array}{ccc} 1 & \sigma_1 & \sigma_1 \\ \sigma_1 & 1 & \sigma_1 \\ \sigma_1 & \sigma_1 & 1 \end{array} \right) $$

model 2:

This is where I have trouble. I cant seem to find a way to allow a separate covariance estimate for each group.

$$ \Sigma = \sigma^2 \left( \begin{array}{cccc} \Sigma_1 & 0 & \dots & 0 \\ 0 & \Sigma_2 & & 0 \\ \vdots & & \ddots & \vdots \\ 0 & 0 & \dots & \Sigma_n \end{array} \right) $$

where:

$$ \Sigma_i = \left( \begin{array}{ccc} 1 & \sigma_i & \sigma_i \\ \sigma_i & 1 & \sigma_i \\ \sigma_i & \sigma_i & 1 \end{array} \right) $$

$\endgroup$
  • $\begingroup$ I didnt realize this would be so difficult. I recently read somewhere that lmer cannot do this type of heterogeneity and that I might need to use the nlme package instead. Can anyone confirm this? $\endgroup$ – german129 May 13 '14 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.