Hello, I posted the query below on r-help and Marc Schwartz graciously pointed me to this list.... he said I would likely have to use glmer(), but that I should check with the people on this list. I would be really grateful if you could help me !! Thanks much, Suresh =================================================================================================== Hello, I have a hierarchical dataset of this form and am trying to analyze it in R. 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. I looked through Agresti and Pinheiro/Bates and couldn't find an example covering this situation. I would be really grateful if you could suggest a way to go about this analysis in R, or a place where I could read about this. I considered: Pool data from all the sessions for a given condition and test together, thus getting 2000 repetitions of Test1 and Test 2 in each condition. Now I have a 2x2x2 setup, which maps on to something in Agresti, but then I am ignoring within-session correlation information. I could simply get a difference between Test1 and Test2 percentages for each session, and then compare the distribution of these differences in conditions A and B (with something like a t-test), but then I only have 10 points (one for each session) and so I guess I am throwing away a lot of information. Very best, Suresh
2 x 2 x 10 x 2 binomial setup
3 messages · Suresh Krishna, Daniel Ezra Johnson
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? dan p.s. make sure you label your sessions correctly to avoid "implicit nesting"...
On Tue, 14 Jul 2009 17:02:45 +0200, Daniel Ezra Johnson
<danielezrajohnson at gmail.com> wrote:
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?
Dan, Thank you very much !! Just to finish the picture, how would the call to glmer look if I had 2 subjects instead of one, and wanted to pool everything together, taking into account the subject factor (instead of doing separate tests for each subject) ? Very best, Suresh