Skip to content
Back to formatted view

Raw Message

Message-ID: <BF74FADD4B44554CA7E53D0B5242CD6A034FF0EB@evd-s7014.bk.evdad.admin.ch>
Date: 2005-10-27T05:24:08Z
From: Lorenz.Gygax@fat.admin.ch
Subject: syntax for interactions in lme

> Host (fixed)
> Sire (random)
> Dam nested within Sire (random)
> Host * Sire (random)
> Host * Dam within Sire (random)
> 
> So without the interactions I have:
> 
> hogmodel = lme(gain ~ host, random = ~1|sire/dam)
> 
> If I understand correctly, that "sire/dam" term gives me both 
> Sire and Dam within Sire as random factors.  OK, so now I want
> to add the two interactions (listed above)...

Correct, for the interactions write:

random = ~ host | sire/dam

an interaction between a fixed and a random term can be interpreted as a
variability in the fixed term for the different levels in the random term.
Thus the 1 (which stands for the intercept) is exchanged with the fixed
effect(s) with which interactions are of interest.

This is easy if all the hierarchical levels of a nested random effects go
into an interaction it is a bit more complicated if not. Say you only want
the interaction of host and dam but not sire:

random = list (~ 1 | sire, ~ host | dam)

Hope this helps (it can all be found in Pinheiro and Bates and on the help
pages).

Lorenz