Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you for the constructive feedback. I gather another user (not you) deemed my answer unhelpful for some reason. So, my answer score was moved downward to -1. Then, you came in and gave me a + 1. So, it returned my rating to zero. Many users are rather officious in their ratings of colleagues. And, unless one does provide a paragraph of R codes in their answer, one is vulnerable to down-votes regardless if R coding is truly relevant to answering the question. That is just silly group dynamic stuff. The main things are that I helped you out, and that you recognized that I did.
It is not impossible to do so. It is probably not optimal. You may try it following Richard Border's suggestion. And, observing how readily interpretable each model structure is (comparing linear regression vs. logit regression and ANOVA as respectively structured). Given that you deem my answer helpful, I am puzzled of why I get a -1.
Well exogenous variables do not typically resolve serial correlations. Lagged Y variables most often do. But, as you experience sometimes you have to add more than one lag. And, as mentioned such models become increasingly meaningless. I think when you add lags of Y, they have a mean reverting impact on the residuals. And, therefore it attenuates the serial correlation.