Skip to content
Prev 775 / 20628 Next

random effects specification

On Sat, Apr 5, 2008 at 10:14 PM, Ken Beath <kjbeath at kagi.com> wrote:
I agree with everything up to here.
That approach contradicts your later advice to represent a factor
variable as a factor in R.  If id is a factor (as it should be) you
can't add  a large number to it.

The specification (1|treatment:id) generates unique id's.

To me the convention that different experimental units should be given
the same level of 'id' is just another nonsensical aspect of the
traditional approaches to random-effects models using observed and
expected mean squares, for which it makes sense to index the
observations by group and by unit within group.

If we could manage to unlearn old habits and just give each subject a
unique id at the start it would make life easier.
Yes, that is one way of expressing an interaction between a random
effect for id and a fixed effect for treatment.

It expands to two random effects terms (1|id) + (1|id:treatment).  The
first is the effect for person and the second is the effect of
different individuals having different responses to the levels of
treatment.

A more general model (and consequently more difficult to estimate on
occasion) has possible correlations of the random effects for
different levels of treatment within individual.  The term is written
(treatment|id).