'Returns the residuals centered within each group.'

@cache_readonly
def resid_centered(self):

    cresid = self.resid.copy()
    for v in self.model.group_labels:
        ii = self.model.group_indices[v]
        cresid[ii] -= cresid[ii].mean()
    return cresid
