stepwise(x, y, wt=<<see below>>, intercept=T, tolerance=1.e-07, method="efroymson", size.max=ncol(x), nbest=3, f.crit=2, xinclude, plot=T, time=0.02)
if plot=TRUE, a plot of residual sum of squares versus model size is created on the current graphics device.
Efroymson's stepwise method is like forward selection, except that when each new variable is added to the subset, partial correlations are considered to see if any of the variables in the subset should now be dropped.
The exhaustive search considers all possible subsets of a given size, and chooses the one with the smallest residual sum of squares.
An observation is considered missing if there is a nonfinite value in the response variable, any explanatory variable or the weight (if present) for that observation. Such observations are dropped from the computations.
This function is based on Fortran code written by Alan Miller, CSIRO Division of Mathematics and Statistics, and his monograph provides details of the methods used, and advice on how to use these procedures.
Draper, N. R. and Smith, H. (1981). Applied Regression Analysis, (second edition). New York: Wiley.
Gentleman, W. M. (1974). Basic procedures for large sparse or weighted least-squares. Applied Statistics 23, 448-454.
Miller, A. J. (1990). Subset Selection in Regression. Monographs on Statistics and Applied Probability 40, London: Chapman and Hall.
Miller, A. J. (1984). Selection of subsets of regression variables (with discussion). Journal Royal Statistical Society, Series A 147, 389-425.
Osborne, M. R. (1976). On the computation of stepwise regressions. Australia Computer Journal 8, 61-68.
z1 <- stepwise(evap.x, evap.y) # use Efroymson's method z2 <- stepwise(evap.x, evap.y, method="ex") # exhaustive search