I have a query regarding the StepAIC function. Should we run the StepAIC on the Whole dataset or we should first divide the data into training and test dataset and then run the StepAIC only on the training dataset ?
The latter. I would also go further and say that you should cross-validate the stepwise selection process. Better yet would be to use the lasso or some other regularized procedure.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.