Hi to all,

I am trying to analyze with lmer some data I collected in a fully factorial
2x2 experiment, with only within-subject factors and a categorical response
variable (binomial).

The structure of my dataset is the following:

> str(ck1bis)
'data.frame':    1200 obs. of  8 variables:
 $ subject : Factor w/ 15 levels "s_01","s_02",..: 1 1 1 1 1 1 1 1 2 2 ...
 $ age     : int  57 57 57 57 57 57 57 57 53 53 ...
 $ ori     : Factor w/ 2 levels "l","r": 1 1 1 1 2 2 2 2 1 1 ...
 $ phase   : Factor w/ 2 levels "different CP",..: 1 1 2 2 1 1 2 2 1 1 ...
 $ contrast: Factor w/ 2 levels "alto","basso": 1 2 1 2 1 2 1 2 1 2 ...
 $ variable: Factor w/ 10 levels "rep1","rep2",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ value   : Factor w/ 2 levels "left","right": 2 2 1 1 2 1 2 2 2 2 ...
 $ scelta  : Factor w/ 2 levels "antizolner","zolner": 2 2 1 1 1 2 1 1 2 2
...

The response variable is $scelta and the factors are $phase and $contrast.
For each condition there are 10 repetitions, which become 20 given that I
don't care about the factor %ori. I (think I have) succeeded in analyzing
the data with glmer, using the following code:

model <- lmer(scelta =="antizolner" ~ phase * contrast  + (1 +
phase*contrast| subject), data=ck1bis, family="binomial")

The output reveals two significant main effects and no interaction (I have
used treatment coding for the 2 factors). I have tried to simplify the
random effect structure, fitting a model with only a random intercept
[model2 <- lmer(scelta =="antizolner" ~ phase * contrast  + (1 t|
subject)...], and then comparing the models with anova(model, model1) but it
looks like all the random terms are necessary because the likelihood ratio
test is significant.

At this point I would like to be able to plot a barchart of the
probabilities for the 4 conditions with error bar representing 95% CI, just
I would do with the marginal means after an ANOVA, but I don't know how to
do it. Can anyone help me with that? Thank you in advance.

Stefano Guidi
Post-doctoral fellow
Communication Science Department
University of Siena

	[[alternative HTML version deleted]]


