[R-sig-ME] Specifying outcome variable in binomial glmm: single responses vs cbind?
beermewi at gmail.com
Sat Jul 2 20:48:06 CEST 2016
I answered my own question, so feel free to disregard this topic.
On Fri, Jul 1, 2016 at 6:37 PM, a y <beermewi at gmail.com> wrote:
> What is the difference between fitting a binomial glmm (without random
> item effects) in the following two ways?
> Data formatted in the following way:
> ID correct condition itemID
> 1 1 A i1
> 1 0 A i2
> 1 1 A i3
> 1 1 A i4
> 2 0 B i1
> 2 1 B i2
> 2 1 B i3
> 2 0 B i4
> Fitting a model without item random effects:
> glmer(correct ~ condition + (1|ID), family = binomial, data = data_long)
> Data formatted this way (summing over the correct responses):
> ID sum_correct condition itemID
> 1 3 A NA
> 2 2 B NA
> Fitting the following model, assuming there were only 4 items (I've seen
> dozens of examples like this):
> glmer(cbind(sum_correct, 4 - sum_correct) ~ condition + (1|ID), family =
> binomial, data = data_short)
> I figured these models should be identical, but in my experience they are
> very much not. What am I missing? When is the second (more) appropriate?
> Thanks for any help,
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models