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-
model.full <- lm(distance ~ ., data = FAA_unique_without_speed_air)
model.null<-lm(distance ~ 1, data = FAA_unique_without_speed_air)
modAIC <- MASS::stepAIC(model.full,direction='forward', scope=model.full, k = 2)
output -
Start: AIC=9161.49
distance ~ aircraft + duration + no_pasg + speed_ground + height +
pitch