Xin__ Li <msf09xl <at> mail.wbs.ac.uk> writes: > > Hi All: > the package "MuMIn" can be used to select the model based on AIC or AICc. > The code is as follows: > > data(Cement) > lm1 <- lm(y ~ ., data = Cement) > > dd <- dredge(lm1,rank="AIC") > print(dd) > > If I want to select the model by BIC, what code do I need to use?
I was going to be grumpy at you for not using common sense, but it's not quite as obvious as I thought. library(stats4) dd <- dredge(lm1, rank="BIC") And when > to select the best model based on AIC, what the differences between the > function "dredge" in package"MuMIn" and the function "stepAIC" in package > "MASS" > stepAIC uses a stepwise procedure, dredge evaluates all (sensible) model subsets. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.