[R] Unbalanced Mixed Linear Models With Nested Stratum

Ben Bolker bbolker at gmail.com
Mon Feb 7 21:51:02 CET 2011


JaFF <el.romaro <at> gmail.com> writes:

> 
> 
> Hi folks,
> 
> I have a dataset from a trial measuring the subjects' pupils. There are many
> measurements, all of which must be analysed in a similar fashion; so if I
> get the analysis right for one of them, I've got them all. For simplicity,
> let us call any measurement we may be interested as "response". The study
> design is an unbalanced latin square, with 5 periods, 5 treatments and 6
> subjects. Each subject has two measurements: left and right eyes. The model
> is as follows, with ":" denoting interaction...
> 
> Fixed Effects = (Subject + Period + Dose):Eye
> Random Effects = Subject:Period + Subject:Period:Eye
> 

> My main question is how to make this happen in R. I know that "aov" is not
> suitable. If you need any more information, I will do my best to provide it
> to the best of my knowledge.


  Doesn't "treatment" appear in fixed effects somewhere?  Perhaps you mean
(Treatment+Period+Dose):Eye?

  Translating your specification directly (substituting 'treatment'
for 'subject' in the fixed effects) I would say

lmer(response~(Treatment+Period+Dose):Eye + (Eye|Subject:Period), data=...)

  should be OK.
  Do you really want interactions only (:) rather than crossing (*)
for the fixed effects? You will get a model with the same number of
parameters either way, but parcelled out among effects differently.



More information about the R-help mailing list