# adapted from ?stepAIC in MASS
require(MASS)
example(birthwt)
birthwt.glm <- glm(low ~ ., family = binomial, data = bwt)
stepwise(birthwt.glm, trace = FALSE)
stepwise(birthwt.glm, direction="forward/backward")
Run the code above in your browser using DataLab