# Binned residuals in logistic regression

I noticed that it's very hard to find something on binned residuals explained in a easy way except for this.

This is my first time approaching to binned residuals. I understood that is not useful dealing with residuals as we know (observed minus estimated), when we have a logit regression.

The logic behind is to bin the observation based on the fitted values. So, If I'm not wrong (maybe I am!) we sort the observation by their fitted values and we build bins with the same number of observations. For each bin we calculate the mean of the fitted values and the mean of their residuals then we draw a plot.

I have a dataset and I build a logit model and then the binned plot is:

I know that the interpretation is quite the same: if we find some strange patterns we need to be worried. I don't find any strange patter here, but my eye maybe is not still used to this kind of interpretation.

What I'm finding hard to understand is the IC.

What does that mean? That if it's outside my residual is stastically not equal to 0?

But, most of all, why is not a smooth line?

The IC in this case is calculated with: $2\sqrt{p(1-p)/n}$ If we take all the $p \in (0,1)$ cause it's a probability the theoretical form would be:

Maybe we don't consider the all all possible p. Maybe we consider p as the mean of the observed value for each bin?

And in general how do I interpret this IC interval? Has this sort of zig-zag pattern a meaning? What if I have a more strong (emphatic) zig-zag line?

[EDIT]

What I'm trying to say talking about the different IC maybe for a better view this image is helpful:

• not really an answer to your question, but you may want to have a look at cran.r-project.org/web/packages/DHARMa/vignettes/DHARMa.html as an alternative to binning Nov 16, 2017 at 12:43
• Not sure why, but it seems your link must have been changed at some point because now it sends the user to what looks like a spam site. Sep 12, 2022 at 2:53