title: Incorporating cross validation in stepwise regression in R
body: <p>I have a dataset of 162 observations with a 151 different variables and I would like to perform stepwise regression on it, but to also do 10 fold cross validation on it. I have used the package DAAG before in order to perform 10 fold cross validation with multiple linear regression and was able to use one of its formulas:-</p>
  
  <pre><code>CVlm(df = data, seed=1500, m = 10, form.lm = formula(RT..seconds.~.,), printit=TRUE)
  </code></pre>
  
  <p>I was wondering whether the package supported the same thing but with stepwise regression? I've had a look through it's pdf but was unable to find anything.</p>
  
  <p>I know that I can perform stepwise regression using the MASS package by doing </p>
  
  <pre><code>step &lt;- stepAIC(fit, direction="both")
  </code></pre>
  
  <p>but can't see how I can incorporate 10-fold CV into the equation. </p>
  
  <p>Thanks</p>