# CPUReg3 Example # Use SAS proc rsquare to compute r-squared and adjusted r-squared for all subsets of independent variables; library(leaps) cat("cpu dataset:\n") cpu <- read.table("cpu.txt", header=T) print(cpu) depvar <- as.vector(cpu$CpuTime) predictors <- as.matrix(cpu[,-1]) out = leaps(x=predictors, y=depvar, wt=rep(1, NROW(predictors)), int=TRUE, method=c("adjr2"), nbest=10, names=c("CardsIn", "LinesOut", "Steps", "MountedDevices")) print(cbind(out$which, out$adjr2))