Dear Statalist,
I would like to automatise a backward elimination procedure to build a multivariate model. I am building a predictive model and I would like to compare the final selected model with different approaches, using either p-value AIC or R-sq from LOOCV validation as a criterion to retain variables. I want to compare the various models and see which one has the highest predictive power.
I have some knowledge of programming Stata, but this is getting quite advanced for me. I would be grateful if somebody could point me in the right direction by naming a few commands or a structure I could use for this. I am especially not sure how to tell Stata that I want sometime done on a vector of variables, and then that same thing done on that same vector minus one variable, with that variable changing at each iteration... (I know how to use foreach/forvalues and while, it's the vector part I am stuck with)
Many thanks for any input!
Sandra
I would like to automatise a backward elimination procedure to build a multivariate model. I am building a predictive model and I would like to compare the final selected model with different approaches, using either p-value AIC or R-sq from LOOCV validation as a criterion to retain variables. I want to compare the various models and see which one has the highest predictive power.
I have some knowledge of programming Stata, but this is getting quite advanced for me. I would be grateful if somebody could point me in the right direction by naming a few commands or a structure I could use for this. I am especially not sure how to tell Stata that I want sometime done on a vector of variables, and then that same thing done on that same vector minus one variable, with that variable changing at each iteration... (I know how to use foreach/forvalues and while, it's the vector part I am stuck with)
Many thanks for any input!
Sandra
Comment