Skip to content
Prev 14364 / 20628 Next

lme4 observation level effects with indicator

Hi Tiffany,

The standard formula for a random slope is (slope | group). When slope is
numeric, the formula translate to b_i0 + b_i1*slope. b_i0 is the random
intercept for group i, b_i1 is its random slope.

(0 + slope | group) removes the intercept. In case of numeric slope this
sets all b_i0 = 0. Hence reducing the random effect to b_i1*slope.

In case of dummy coding slope is either 0 or 1. So (0 + PrePeriod|group) is
equivalent to b_i1 * 1 = b_i1 when Period == "Pre" and b_i1 * 0 = 0 when
Period != "Pre". Hence (0 + PrePeriod|group) is equivalent to a random
intercept for group when Period == "Pre".

When group is the finest level of grouping with only differences in period,
then (0 + PrePeriod|group) is an observation level random effect (OLRE) for
the observation with period == "Pre".

So (0 + PrePeriod|group)  + (0 + PostPeriod|group) gives two OLRE
conditional on period. Both random effects are independent and can have a
different variance.

(0 + period | group) will also estimate the covariance between the two
periodes. But that is probably to complex given the data.

Best regards,



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-04-05 16:02 GMT+02:00 Tiffany Vidal <tiffany.vidal at gmail.com>: