In R, I'm attempting to perform a forward variable selection, but I don't believe I'm obtaining the intended outcomes. To be more precise, the function should begin with 0 variables and gradually add variables while obtaining their AIC values. I just receive an AIC value for each variable when I execute this, though. Where am I making a mistake? this is my code:
lm(distance, data = FAA unique without speed air), model.full
Distance 1, data = FAA unique without speed air, model.null-lm
model.full,direction='forward,' scope=model.full, k = 2, modAIC - MASS::stepAIC
Result -
AIC=9161.49 to begin
aircraft, duration, no pasg, ground speed, height, and distance
pitch