I understand that for continuous data, martingale residuals can be used to assess the linearity of the variable, but if it's a categorical variable (2 levels) is there any interpretation that comes from the boxplot of the martingale residuals for that variable?
-
1$\begingroup$ Not my thing, despite the name. For those who know more about this, perhaps you should expand on how you are presenting the categorical variable, e..g. as a factor variable (namely, one or more indicator variables)/ $\endgroup$– Nick CoxCommented Jun 12, 2022 at 10:28
1 Answer
I don't know that separate martingale residual plots for individual levels of an unordered categorical predictor are of much help. There isn't any linearity or functional form to evaluate among the levels of such a predictor, as each level has its own fixed effect difference from the reference level.* The residuals might help identify particular cases that are poorly modeled, as in the use of whole-model martingale residuals.
If the categorical predictor is ordinal, you could treat it as continuous and examine martingale residuals to evaluate the underlying functional form for the levels of the predictor.
*I'm assuming that standard "treatment" or "dummy" coding was used for modeling the categorical predictor.