How to assess the fit of a binomial GLMM fitted with lme4 (> 1.0)? I have a GLMM with a binomial distribution and a logit link function and I have the feeling that an important aspect of the data is not well represented in the model.
To test this, I would like to know whether or not the data is well described by a linear function on the logit scale. Hence, I would like to know whether the residuals are well-behaved. However, I can not find out at which residuals plot to plot and how to interpret the plot.
Note that I am using the new version of lme4 (the development version from GitHub):
packageVersion("lme4")
## [1] ‘1.1.0’

My question is: How do I inspect and interpret the residuals of a binomial generalized linear mixed models with a logit link function?
The following data represents only 17% of my real data, but fitting already takes around 30 seconds on my machine, so I leave it like this:
require(lme4)
options(contrasts=c('contr.sum', 'contr.poly'))

dat <- read.table("http://pastebin.com/raw.php?i=vRy66Bif")
dat$V1 <- factor(dat$V1)

m1 <- glmer(true ~ distance*(consequent+direction+dist)^2 + (direction+dist|V1), dat, family = binomial)

The simplest plot (?plot.merMod) produces the following:
plot(m1)


Does this already tell me something?
 A: This is very common theme on biostatistics/epidemiology courses, and there are not very good solutions for it, basically due to the nature of the model. Often the solution has been to avoid detailed diagnostics using the residuals.
Ben already wrote that diagnostics often require either binning or smoothing. Binning of residuals is (or was) available in the R package arm, see e.g., this thread. In addition, there are some work done that uses predicted probabilities; one possibility is the separation plot that has been discussed earlier in this thread. Those might or might not directly help in your case, but could possible help the interpretation.
A: You can plot the residuals against the predictors using simulation techniques in DHARMa package, it also offers a range of diagnostics such as overdispersion, and outliers, I think its a practical and simple assessment tool for GLMM.
Check it out: https://cran.r-project.org/web/packages/DHARMa/vignettes/DHARMa.html
A: Short answer since I don't have time for better: this is a challenging problem; binary data almost always requires some kind of binning or smoothing to assess goodness of fit. It was somewhat helpful to use fortify.lmerMod (from lme4, experimental) in conjunction with ggplot2 and particularly geom_smooth() to draw essentially the same residual-vs-fitted plot you have above, but with confidence intervals (I also narrowed the y limits a bit to zoom in on the (-5,5) region).  That suggested some systematic variation that could be improved by tweaking the link function.  (I also tried plotting residuals against the other predictors, but it wasn't too useful.)
I tried fitting the model with all 3-way interactions, but it wasn't much of an improvement either in deviance or in the shape of the smoothed residual curve.
Then I used this bit of brute force to try inverse-link functions of the form $(\mbox{logistic}(x))^\lambda$, for $\lambda$ ranging from 0.5 to 2.0: 
## uses (fragile) internal C calls for speed; could use plogis(),
##  qlogis() for readability and stability instead
logitpower <- function(lambda) {
    L <- list(linkfun=function(mu)
              .Call(stats:::C_logit_link,mu^(1/lambda),PACKAGE="stats"),
              linkinv=function(eta)
              .Call(stats:::C_logit_linkinv,eta,PACKAGE="stats")^lambda,
              mu.eta=function(eta) {
                  mu <-  .Call(stats:::C_logit_linkinv,eta,PACKAGE="stats")
                  mu.eta <-  .Call(stats:::C_logit_mu_eta,eta,PACKAGE="stats")
                  lambda*mu^(lambda-1)*mu.eta
              },
              valideta = function(eta) TRUE ,
              name=paste0("logit-power(",lambda,")"))
    class(L) <- "link-glm"
    L
}

I found that a $\lambda$ of 0.75 was slightly better than the original model, although not significantly so -- I may have been overinterpreting the data.
See also: http://freakonometrics.hypotheses.org/8210
A: Fitted vs residuals plot should not show any (clear) pattern. The plot shows that the model does not work well with the data. See http://www.r-bloggers.com/model-validation-interpreting-residual-plots/
A: You could use AIC instead of residual plots to check fit of model.
Command in R: AIC(model1)
it will give you a number...so then you need to compare this with another model (with more predictors, for example) -- AIC(model2), which will yield another number. Compare the two outputs, and you'll want the model with the lower AIC value.
By the way, things like AIC and log likelihood ratio are already listed when you get the summary of your glmer model, and both will give you useful info on fit of model. You want a large negative number for log likelihood ratio to reject the null hypothesis.
