# NOT RUN {
if (interactive()) {
# based on the second example of function MASS:stepAIC()
require(MASS)
cpus1 <- cpus
for(v in names(cpus)[2:7])
cpus1[[v]] <- cut(cpus[[v]], unique(quantile(cpus[[v]])),
include.lowest = TRUE)
cpus0 <- cpus1[, 2:8] # excludes names, authors' predictions
cpus.samp <- sample(1:209, 100)
cpus.form <- list(formula(log10(perf) ~ syct + mmin + mmax + cach + chmin +
chmax + perf),
formula(log10(perf) ~ syct + mmin + cach + chmin + chmax),
formula(log10(perf) ~ mmax + cach + chmin + chmax + perf))
data <- cpus1[cpus.samp,2:8]
cpus.ms <- buildModelSeries(cpus.form, data, vif = TRUE, aic = TRUE)
cpus.des <- data.frame(a = c(0, 1, 0), b = c(1, 0, 1), c = c(1, 1, 0))
stats <- statsModelSeries(cpus.ms, design.info = cpus.des, arrange.by = "aic")
}
# }
Run the code above in your browser using DataLab