[R-sig-ME] 2 x 2 x 10 x 2 binomial setup

Daniel Ezra Johnson danielezrajohnson at gmail.com
Tue Jul 14 17:02:45 CEST 2009

> 1 subject
> Tested under 2 conditions: A and B
> 10 sesssions in each condition
> In each session, 2 kinds of tests: Test 1 and Test 2
> 200 independent repetitions of each test-type, with 200 Yes/No answers
> So I think this is a 2 x 2 x 10 x 2 setup
> What I want to know is whether the difference in percentage of yes answers
> between Test1 and Test2 is different for the 2 conditions A and B. I guess I
> could also state this as looking for an effect at the highest stratum, after
> correctly pooling over all the lower strata... i.e. Is there an
> "interaction" between the Effect of Condition and the Effect of Test.

yes, that sounds exactly right, you're testing for the interaction, so

mod1 <- glmer(Response ~ Test*Condition + (1|Session),binomial,data)
mod0 <- glmer(Response ~ Test+Condition + (1|Session),binomial,data)

as far as getting a p-value, that's a debate but you can use
anova(mod0,mod1) as a first approximation?


p.s. make sure you label your sessions correctly to avoid "implicit nesting"...

More information about the R-sig-mixed-models mailing list