Is there an efficient way or an existing procedure within SAS to test whether the average residuals from an OLS model are the same between two subgroups of the estimation sample? Note that for a variaty of reasons, including indicators for subgroups in the model is not an option.
I have found an user generated macro, which however uses PROC IML, and I do not have that as part of my SAS installation. If I have to code the test from cratch, is there an alternative to PROC IML to get the matrix cross products (for the s.e. estimate of the difference in the residuals)?
Any thoughts or suggestions would be appreciated.
You are not clear about what it is that you want to compare - residual mean values or the variance of the residuals. You state that you want to test whether the "average residuals" are the same for subgroups of the sample. That sounds like a comparison of residual mean values.
Of course, residual mean value differences across subgroups is just differences in mean values across subgroups. And a test for mean differences is obtained when you include the group variable in a CLASS statement as well as on the right hand side of a model statement. But it sounds like you don't want to do that. Why?
Or am I misinterpreting your question? Do you want to examine differences in residual variance across groups?
I want to compare the residual means, not variances. The reason I do not want to include the group variable in the CLASS statement and also in the model is because the means in residuals comparison needs to be made for many smaller sub-sets of the data and the model is too complex to be estimated over these smaller sub-sets.