R/model.select.R

Defines functions model.select

Documented in model.select

model.select <-
function(object,which="BIC") {
	summary.glmpath<-summary(object)
	if (c("BIC","AIC")[charmatch(which,c("BIC","AIC"))]=="BIC") {
		min<-which.min(summary.glmpath[,which])
		}
	if (c("BIC","AIC")[charmatch(which,c("BIC","AIC"))]=="AIC") {
		min<-which.min(summary.glmpath[,which])
		}
	best<-as.numeric(gsub("Step ","",rownames(summary.glmpath)[min]))
   best
}

Try the glmpathcr package in your browser

Any scripts or data that you put into this service are public.

glmpathcr documentation built on July 9, 2023, 6:57 p.m.