Learn R Programming

ALSM (version 0.1.9)

BestSub: Automatic Search Procedures for Model Selection; Best Subsets Algorithms

Description

best subsets according to a specified criterion are identified without requiring the fitting of all of the possible subset regression models.

Usage

BestSub(x,y,method=c('r2','r2adj','sse','cp','press','aic','sbc'),num=2)

Arguments

x
matrix of predictors

y
response vector

method
best subsets according to this specified criterion. R2,R2adj,sse,cp,press,aic and sbc.

num
number of best subset model per number of predictor variable.

References

Michael H. Kutner; Christopher J. Nachtsheim; John Neter; William Li. Applied Linear Statistical Models Fifth Edition.chapter 9

Examples

Run this code
## page 363
library("leaps")
BestSub(SurgicalUnit[,1:8],SurgicalUnit[,10],method='r2',num=2)

Run the code above in your browser using DataLab