Residual-based test