leaps.out <- try(require(leaps, quietly=TRUE))
leaps.out.log <- is.logical(leaps.out)
if ((leaps.out.log==TRUE)&(leaps.out==TRUE))
bestset.noise(20,6) # `best' 3-variable regression for 20 simulated observations
# on 7 unrelated variables (including the response)
Run the code above in your browser using DataLab