Skip to content
Prev 17702 / 20628 Next

Mixed model interpretation with interaction

Ps:

I also agree with Daniel to take care of repeated measurements of the same
bears coming to the sites in both years.
However, the main problem I guess, will be that not every bear comes back
in the second year. This means, having random slopes for bears that were
observed only once, will bias the effect estimate (i.e. the random slopes
for year will not be separable from the fixed effect of year).
A solution to this, however would be, to use an extra variable (lets call
it 'repeat') that codes, whether a bear has there in both years (=1) or not
(=0; numeric coding - not factored). Then you the following should work:

model<-(y~site*year+(0+repeat*year| bearID))
Which will estimate random slopes for year for all bears that were there at
least twice, but not for others, where the term before the | becomes 0 (and
nothing happens)).

Best, Ren?

Pps: You can tell your colleagues that:
the Model-intercept is the only direct mean that the model estimates
directly (i.e. the reference cell) and all other deviations (including
other means) are linear combinations from that intercept (for any factor)
...  And ... of course, the parameters still can be interpreted this way
(as illustrated above) ... but you need to know some details how to do so
:)) (you can impress them now...)

The easiest way to let a function reconstruct the model outputs is using
emmeans()
e.g.
emmeans(model1, ~Site) should give the marginal estimates of the - site
main effect - (site 1 and site 2 means) on the log scale
and
emmeans(model1, ~Site, type = "response") will give the estimates on the
actual response (probability) scale. I find this often very helpful (also
for plotting).



Am So., 9. Juni 2019 um 16:57 Uhr schrieb Ren? <bimonosom at gmail.com>: