I have a conceptual question about residuals in logistic regression models.
I understand that for linear regression, the residuals represent the differences between the observed and fitted values. A linear regression model can be evaluated in terms of how much the fitted values deviate from the observed values (the deviance), and that there are various statistics use the deviance to evaluate goodness of fit, like AIC one of the many R2 statistics.
I can see how this is the case in logistic regression wherein at at least one variable (either response or explanatory) is continuous.
What is less clear to me, is the role of residuals where all variables are factors.
So say I have a model that tries to predict the choice of outcome A over outcome B, and the explanatory variables are all binary or otherwise have factorial levels "yes, no" or "option 1, option 2, option 3".
In such a case, what is it that the residuals represent? There's not really a lot of "distance" between values right? Seems to a bit more abstract to me.
Most of the resources I've read about logistic regression involve examples with at least one continuous variable, very few deal with cases wherein all variables are factorial.
One source I read suggests that for these situations, statistics like the Nagelkerke psuedo-R2 because the the proportion of total variance is "less conceptually clear".
I would assume that one could make the same case for AIC.
So my overall question then, is that if residuals are the key element in determining goodness of fit statistics for regression models, but i they are not as relevant in logistic regression models, how does one evaluate the goodness of fit in a model with purely factorial variables?