All, I am working on some additions to the regression package and have run into a bit of difficulty.
The statistical R Squared is equal to 1.0 - SumOfSquaredError/SumOfSquaresTotal. Say that I run my regression two different ways. The first manner I tell the regression technique to include a constant, so the SumOfSquaresTotal = Summation of ( Y - Mean(Y) ) ^2. In the next run, I tell the regression technique not to include a constant, but I do include one in the data I supply ( one rhs variable is always set to one). The models are identical, but the R Squared may not be consistent, since in the second run I will assume Mean(Y) = 0.0. The question to the list is what is the proper course of action? Ignore it and leave the obvious inconsistency? Force a mean? (That's not exactly a good solution). Empirically test the data as it comes in? If an independent variable exhibits zero variance, then it must be the constant. I then set the flag for it, and get the correct result? Thoughts? -Greg