backward_select.Rd
P-value based backward selection on Generalized Linear Models (GLMs).
backward_select( object, data = NULL, backward.test = "LRT", backward.alpha = 0.05, family = gaussian(link = "identity") )
object | An object of class |
---|---|
data | Data needed for creation of models. Default is |
backward.test | Test to obtain P-values of predictors during the backward elimination process. Valid values are |
backward.alpha | The maximum alpha value that predictors with P-values greater than that will be sequentially removed. Default value is 0.05. |
family | The family of the response variable. Default is |
If the object is from class autoGAM_frame
, the $`best forms`
& $`final predictors`
parts of the object will be updated and a list of sequential results of backward elimination process will be added to the autoGAM_frame
list. If the object is a formula, the mentioned sequential list of backward process will be returned.
Shahin Roshani
if (FALSE) { my_mtcars <- mtcars %>% mutate_at('vs',as.factor) carsGAM <- autoGAM_frame(mpg~disp+drat+vs,data=my_mtcars) backward_select(carsGAM) #Or for example: backward_select(mpg~poly(disp,2)+I(drat^3)+vs,data=my_mtcars) my_iris <- iris %>% filter(Species!='setosa') backward_select(Species~ns(Sepal.Length,3)+cut(Petal.Width,2),data=my_iris,family=binomial(link='logit')) }