Why does the number of rows change during AIC in R? How to ensure that this doesn’t happen?
From the Warnings section of ?step: The model fitting must apply the models to the same dataset. This may be a problem if there are missing values and R’s default of na.action = na.omit is used. We suggest you remove the missing values first. So you should do: