I want to regress my dependent variable on my independent variables in R. First for the level of the variables: lm(y~x+z+u)
. Now since my variables are non-stationary I have to take the first difference of each variable. My question is, is it right to do the following: lm(diff(y)~diff(x)+diff(z)+diff(u))
?
My question arises because I read the question and the corresponding answer from this thread: How do I interpret my regression with first differenced variables? What baffled me was the answer from Charlie. Is taking the difference from each variable the same as subtracting $y_{t-1}$ from each side of the model in levels? I.e. is subtracting $y_{t-1}$ from lm(y~x+z+u)
equal to lm(diff(y)~diff(x)+diff(z)+diff(u))
?
I already posted this question on Stack Overflow, but since it has nothing to do with programming/coding I deleted it an reposted it on this forum.