library(datasets)
data(esoph)
fit <- glm(cbind(ncases, ncontrols) ~ agegp + tobgp + alcgp, family=binomial(), data=esoph)
smof2 <- smof(fit, esoph, c("agegp", "alcgp"),
scoring=list(type="spline", in.knots=c(2,1)), original=TRUE)
set.seed(1)
smof2a <- smof_refit(smof2, searches=4, opt.control=list(maxit=50))
# smof2b <- smof_refit(smof2a) # further improvement can be attempted
Run the code above in your browser using DataLab