This question is for a course that I am taking, I hope is not repeated. I have a dataset of 4500 observations with 17 variables. My response variable is binomial and I want to do a logistic regression to build a prediction model.
I normally use a stepwise approach to select my final model and the variables included in it; but in this case, I would like to internally validate the model by cross-validation. I have installed the "caret" package in R and have produced a model but all the variables in the dataset are included - I would like to reduce the number of variables included. My question is, should I do this before or after cross-validation, meaning:
Should I do a logistic regression and selection to see the most important variables and then include them to build my model with cross-validation?
Should I use the final model from cross-validation and try to reduce it? (If so, how?)
Thanks in advance