When I was working on my R project the other day and tried to optimize my linear model based on the AIC (using backward selection), I was stopped by an error message like this:
Error in stepAIC(lm(x ~ y + z), direction = "back") :
number of rows in use has changed: remove missing values?
Do you have any idea what may be the problem here?