If you read the help file on the step() function ?step you will see a reference to BIC under the description of the k= argument.
This suggests that you could try: BIC.fitted = step(glm.fit, k=log(dim(dat)[1])) Jean Andra Isan wrote on 09/07/2011 06:12:19 PM: > > Hi All, > After fitting a model with glm function, I would like to do the > model selection and select some of the features and I am using the > "step function" as follows: > glm.fit <- glm (Y ~ . , data = dat, family = binomial > (link=logit)) AIC_fitted = step(glm.fit, direction = "both") > I was wondering is there any way to select the features based on BIC > rather than AIC? is there any other function that I should use? > Thanks a lot,Andra > [[alternative HTML version deleted]] ______________________________________________ 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.