title: Stepwise AIC using forward selection in R
body: <p>I am trying to do a forward variable selection using stepwise AIC in R but I don't think that I am getting the desired results. Specifically, the function should start with no variables and keep adding variables and get their AIC values. However, when I run this I only get an AIC value for all variables. Where am I going wrong?
  here is my code-</p>
  <pre><code>
  model.full &lt;- lm(distance ~ ., data = FAA_unique_without_speed_air)
  model.null&lt;-lm(distance ~ 1,  data = FAA_unique_without_speed_air)
  modAIC &lt;- MASS::stepAIC(model.full,direction='forward', scope=model.full, k = 2)
  </code></pre>
  <p>output -</p>
  <pre><code>Start:  AIC=9161.49
  distance ~ aircraft + duration + no_pasg + speed_ground + height + 
      pitch
  </code></pre>