Hi,

The pasted-in email below was intended for this mailing list, but I  
accidently only sent it to Douglas Bates (very sorry!). Please see  
below the pasted-in email for some more specifications about my  
question.

>> I'm sorry if the following question is a wee bit stupid, but I  
>> have to ask
>> to get this properly figured out.
>>
>> Continuing with the Machines data from the MEMSS package (see  
>> below) as an
>> example. Suppose the models:
>>
>> (i) lmer(score ~ Machine + (Machine | Worker))
>> (ii) lmer(score ~ Machine + (1 | Worker) + (0 + Machine | Worker))
>
> Model (ii) cannot be estimated (or if it can, it shouldn't be).  The
> model that makes the most sense is
>
> lmer(score ~ Machine + (0+Machine | Worker))
>
> May I suggest that you look at the model matrices for the different
> models to see why?  I am really pushed for time right now and I just
> don't have the time to write long explanations.  Alternatively, if you
> were to copy this discussion to the R-SIG-Mixed-Models@R-project.org
> list I think there are others reading the list who could explain why.
>
>> In (i), score is modeled by the Machine fixed factor and the random
>> interaction between Machine and the Worker factor (which is  
>> considered to be
>> random). (i) uses 9 degrees of freedom. Here the Worker effect is  
>> confounded
>> within the intercept of the (Machine | Worker) term.
>> In (ii), score is modeled by the Machine fixed factor, the random  
>> Worker
>> factor, and the random interaction between Machine and Worker.  
>> (ii) uses 10
>> degrees of freedom. Here we can separate the Worker effect from the
>> Machine-Worker interaction, which costs us one degree of freedom.
>>
>> My question is simply: Have I interpreted this correctly? If not,  
>> any help
>> on how to interpret the difference between model (i) and (ii) is  
>> greatly
>> appreciated!
>>
>> Thank you!
>>
>> Best regards,
>>
>> Martin.

It is indeed possible to estimate model (ii), the output is:

Linear mixed-effects model fit by REML
Formula: score ~ Machine + (1 | Worker) + (0 + Machine | Worker)
    Data: Machines
    AIC   BIC logLik MLdeviance REMLdeviance
  232.3 252.2 -106.2      221.4        212.3
Random effects:
  Groups   Name        Variance Std.Dev. Corr
  Worker   (Intercept) 18.40914 4.29059
  Worker   MachineA    10.77633 3.28273
           MachineB    34.51234 5.87472   0.299
           MachineC     0.10678 0.32678  -0.937 -0.614
  Residual              0.92999 0.96436
number of obs: 54, groups: Worker, 6; Worker, 6

Fixed effects:
             Estimate Std. Error t value
(Intercept)   52.356      2.217  23.614
MachineB       7.967      2.393   3.329
MachineC      13.917      1.501   9.273

Correlation of Fixed Effects:
          (Intr) MachnB
MachineB -0.167
MachineC -0.606  0.238

I'd like to to get the Worker effect estimated as well as the  
interaction effects between Machine and Worker. The output above, in  
my eyes, seems to provide exactly this. I understand that there's  
something that I don't understand, and I'd very much appreciate any  
help on interpreting the different models (i) and (ii) and why model  
(ii) doesn't make sense.

The output from fitting model (i) is:

Linear mixed-effects model fit by REML
Formula: score ~ Machine + (Machine | Worker)
    Data: Machines
    AIC   BIC logLik MLdeviance REMLdeviance
  226.3 244.2 -104.2      216.6        208.3
Random effects:
  Groups   Name        Variance Std.Dev. Corr
  Worker   (Intercept) 16.61570 4.0762
           MachineB    34.47572 5.8716    0.483
           MachineC    13.64510 3.6939   -0.365  0.298
  Residual              0.92485 0.9617
number of obs: 54, groups: Worker, 6

Fixed effects:
             Estimate Std. Error t value
(Intercept)   52.356      1.679  31.174
MachineB       7.967      2.418   3.294
MachineC      13.917      1.542   9.027

Correlation of Fixed Effects:
          (Intr) MachnB
MachineB  0.461
MachineC -0.374  0.303

To me, it here looks as we get the interactions between Machine and  
Worker, but that the Worker effect is confounded in the intercept of  
the interaction effect. If we look at the BLUP:s for the models (i)  
and (ii) we get the following:

 > ranef("model (ii)")
An object of class "ranef.lmer"
[[1]]
   (Intercept)
1   0.8924564
2  -3.8789789
3   4.7753576
4  -1.3654599
5   4.7893765
6  -5.2127517

[[2]]
     MachineA     MachineB    MachineC
1 -0.5889748   1.66535371  0.01455685
2  3.9941506   3.11719442 -0.39242270
3  2.3434019   2.91923878 -0.25246004
4  0.2583581   3.74188503 -0.09753681
5 -5.6182390  -0.07808906  0.46421605
6 -0.3886967 -11.36558288  0.26364665

 > ranef("model (i)")
An object of class "ranef.lmer"
[[1]]
   (Intercept)    MachineB   MachineC
1   0.3119782   2.2411827  0.6184094
2   0.1841904  -0.9876673 -4.4665295
3   6.9691957   0.8101625 -2.4958603
4  -1.0237402   3.3520102 -0.3907095
5  -0.8499415   5.5760567  6.1734022
6  -5.5916826 -10.9917448  0.5612878

I interpret this as that ranef("model (ii)")[[1]] is the BLUP for the  
Worker factor and ranef("model (ii)")[[2]] the BLUP for the  
interactions. as.matrix(ranef("model (ii)")[[1]]) + as.matrix(ranef 
("model (ii)")[[2]][1]) produces pretty much as.matrix(ranef("model  
(i)")[[1]][1]), which is why I thought that the Worker effect in  
model (i) is confounded in the intercept of the interaction effects.

Further, considering the model

(iii)	lmer(score ~ Machine + (0 + Machine | Worker)

we get the following output:

Linear mixed-effects model fit by REML
Formula: score ~ Machine + (0 + Machine | Worker)
    Data: Machines
    AIC   BIC logLik MLdeviance REMLdeviance
  226.3 244.2 -104.2      216.6        208.3
Random effects:
  Groups   Name     Variance Std.Dev. Corr
  Worker   MachineA 16.64234 4.07950
           MachineB 74.37306 8.62398  0.803
           MachineC 19.26441 4.38912  0.623 0.771
  Residual           0.92464 0.96158
number of obs: 54, groups: Worker, 6

Fixed effects:
             Estimate Std. Error t value
(Intercept)   52.356      1.681  31.149
MachineB       7.967      2.420   3.292
MachineC      13.917      1.540   9.037

Correlation of Fixed Effects:
          (Intr) MachnB
MachineB  0.463
MachineC -0.374  0.301

I (probably incorrectly) interpret this as that we don't get an  
estimate of the Worker effect, but only the interaction between the  
Worker and the Machine.

If anyone can tell me where I go wrong in my reasoning about the  
models (i), (ii), and (ii), I'd be very happy and thankful.

Thank you very much!

Best regards,

Martin.

========================================
Martin Eklund
PhD Student
Department of Pharmaceutical Biosciences
Uppsala University, Sweden
Ph: +46-18-4714281
========================================





	[[alternative HTML version deleted]]


