How does the stepwise regression method work for both
direction in R with the step()
function.
I would think that one variable will be placed into the model and then another that will improve the measuring criteria and the significance of the older variable gets assessed. If the older variable's coefficient is not significant the variable will be removed and a next variable will be placed into the model and so forth.
I am not a 100% sure if this is how the step function with both
do it, but can someone please inform me if this is correct, if not how does the both
direction criteria implement the stepwise regression in R with step()
.
?step
explains it uses AIC (by default), not significance. $\endgroup$step
. As it says in the help, it usesadd1
anddrop1
each time through ... but unlike that mention in the help it actually does them by callingdrop1
(the backward part) and thenadd1
(the forward part). $\endgroup$