I have a regression model with a significant interaction term between group a and b. In one single graph, I would like to plot the regression line of the whole group as well as the residuals of group b in different colors (4 colors) depending on the distance to the line.

Does anyone know how I can do this, and whether there is a specific package that would work best for this?

Similar questions and discussions