[R-sig-ME] Help with coding an intervention analysis with lmer()

Douglas Bates bates at stat.wisc.edu
Sun Aug 29 20:48:12 CEST 2010


On Sun, Aug 29, 2010 at 5:26 AM, Andrew Robinson
<mensurationist at gmail.com> wrote:
>
>>>
>>> If we go back to your original model specification, you had
>>>
>>> mod <- lmer(Attack ~ Group*BA + BA/Year + BA/Year:Group +
>>> Group/Subject:BA + (1|Group/Subject), data = dat, family = poisson)
>>>
>>> in my view that is gobbledygook. You have Group as a fixed effect
>>> predictor, but also as a grouping factor, and I don't think that makes
>>> any sense.
>
> Just as a general point, there is a case when fixed effect predictor can also appear as a grouping effect: in split-plot designs. Indeed, this occurs in one of the examples in Pinheiro & Bates (2000).  It is a bit unclear in coding, and it would be cleaner if the coder were to create separate factors for the fixed and the random effects, even if they are the same. The algorithms allow the shortcut, though.

There is such an example but it doesn't apply in this case.  Even
though the whole plot factor was being used as a grouping factor for
the random effects it was used in the form of an interaction with the
blocking factor.  In other words, if F1, F2, etc are fixed-effects
factors and B1, B2, etc. are environmental factors (such as location)
then a formula of

Y ~ F1 + (1|B1/F1)

which expands to

Y ~ F1 + (1|B1) + (1|B1:F1)

is sensible but a term of the form (1|F1) is not.

>
> Cheers
>
> Andrew
>
>
>>>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




More information about the R-sig-mixed-models mailing list