Example call and output of the macro with the NCAA data. Slope vs. Alpha Index plot.
R program for NAMS based on leaps package. Example call and output with the NCAA data. Slope vs. Alpha Index plot.
It turns out that determining local maxima in the NAMS code is a bit tricky. Basically, that is why B=4000 is suggested for routine application. In the SAS macro above, we automatically raise B up by a factor of 5 if a local maximum is found, in order to avoid spurious local maxima. However, B=4000 or more is often too costly for use in Monte Carlo studies. So here we provide a second R program for NAMS that uses a much simpler method for choosing alpha from the slope plot. This second one may be used with B=500 or even smaller for Monte Carlo studies. Moreover, it can be used in situations where the number of explanatory variables exceeds the sample size. In such cases, you must guess what R^2 will be, and the program uses that to determine the scaling factor tau used in adding noise. There are also options to limit printing (print=F) or to print with more digits. The downside of this second program is that it cannot choose full models and it cannot find local maxima. For routine data analysis, these are not problems since you should always inspect the Slope vs. Index plot. Here is a further run for the NCAA data showing how the second program misses a local max. The Slope vs. Alpha Index plot illustrates the local max at index=20 (slope=46.97705 is just below the last slope, 46.97743). Limited simulations suggest that the second program does well and ignoring local maxima is not too costly in terms of model error. The use of B=500 instead of B=4000 in simulations is very appealing.