I am trying to run this code
r2<-lm(diff(Y)~.,data=credit.train)
Now, I get the error:
Error in model.frame.default(formula = diff(Y) ~ ., data = credit.train, : variable lengths differ (found for 't')
I understand that on differencing, number of rows of Y is decreasing by 1 which is not happening for the X variables. Any idea how to tackle this?