R - lmer vs glmer Having trouble finding straightforward information this topic.
Basically, I'm trying to use the lme4 package to analyze my data, and the model looks something like (A ~ BCD) + (random effects term 1) + (random effects term 2).
'A' is a yes/no response, which, based on what I've read, indicates that I should use glmer(). However, my experiment uses repeated measures - each subject undergoes many trials. It's a psychophysical experiment, so there are many subjects who essentially make yes/no judgements about many, many images. I've read that when there are many trials within a subject, you should use lmer().
Sorry if the info given is too sparse; if anyone thinks they can help me out with this, I'll provide as much info as necessary.
Question: When exactly should one use lmer() vs glmer(), especially in the context of psychophysical experiments where one subject will undergo many trials with binomial outcomes?
More info/part 2 of question: I initially analyzed my data using ANOVAs in SPSS. The SPSS indicated a highly significant interaction, one that is logical and predicted. When running the same data to modeled in glmer(), that interaction in highly insignificant. When running through lmer, it is significant again.
If anyone can help shed some light on whether this makes sense or why it would be so, I'd appreciate it very much.
 A: lmer is used to fit linear mixed-effect models, so it assumes that the residual error has a Gaussian distribution. If your dependent variable A is a binary outcome (e.g. a yes/no response), then the error distribution is binomial and not Gaussian. 
In this case you have to use glmer, which allow to fit a generalized linear mixed-effects model: these models include a link function that allows to predict response variables with non-Gaussian distributions. One example of link function that could work in your case is the logistic function, which takes an input with any value from negative to positive infinity and return an output that always takes values between zero and one, which is interpretable as the probability of the binary outcome (e.g. the probability of the subject responding 'yes'). 
About the repeated measurement design, both lmer and glmer can handle it equally well, you just have to set 'subject' as a grouping factor (in the random-effect part of the model) for the within-subject predictors. In this way you allow these predictors to have a fixed-effect (common to all subjects) and a subject-specific random effect, so that you can test statistically the effect common to all subjects, and treat the subject-specific variations as a nuisance term.
For more details on how to proceed I would recommend this excellent book by Knoblauch and Maloney that dedicates a large section on the application of mixed-effects models (using R and the lme4 library) to the modelling of psychophysical data.
