subReg | R Documentation |
Model selection by exhaustive search. All subset regression are evaluated to help choosing the best minimalist model. R in action p 211.
subReg(formula, data, nbest)
formula |
The models fit by, e.g., the lm and glm functions specified in a compact symbolic form. |
data |
data.frame |
nbest |
number of subsets of each size to record |
graphic for best model selection based on Adjusted R-squre
JuG
form = as.formula("Fertility ~ .")
if(!require('MASS')){install.packages('MASS')}
library('MASS')
fit1 <- lm(form, data = swiss)
stepAIC(fit1,direction = "both")
subReg(form, data=swiss, nbest = 3)
relweights(fit1, col="lightgrey",las=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.