Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • first difference regression

    hello stata community,

    Is it possible to run first difference regression if I have time series data?

    Code:
    reg d.y d.x1 d.x2

  • #2
    Yeah, but what do you intend to achieve in doing that? In the context of panel data, differencing eliminates the time-invariant individual effect. In a time-series, you only observe a single unit. So you are more concerned about spurious correlation between the outcome and one or more regressors leading to a spurious regression. The way to detect this is to check if the variables are stationary - then if not, difference them to make them stationary just in case they are not cointegrated. So look at the literature on stationary time-series and cointegration.
    Last edited by Andrew Musau; 12 Mar 2023, 10:28.

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      Yeah, but what do you intend to achieve in doing that? In the context of panel data, differencing eliminates the time-invariant individual effect. In a time-series, you only observe a single unit. So you are more concerned about spurious correlation between the outcome and one or more regressors leading to a spurious regression. The way to detect this is to check if the variables are stationary - then if not, difference them to make them stationary just in case they are not cointegrated. So look at the literature on stationary time-series and cointegration.
      Thanks for this valuable addition @4687-andrew-musau

      Regarding my case, I have some variables are not stationary at level.

      I have a query regarding the equation, should the equation be written without the constant variable?

      This way: dy= dx1+ dx2 +u

      Comment


      • #4
        There is an intercept. All you are doing is first stationarizing the variables by differencing and then running OLS.

        \(Y(t) - Y(t-1) = a + b_{1}(X1(t) - X1(t-1)) + b_{2}(X2(t) - X2(t-1))\)

        which could also be parametrized as

        \(Y(t) = Y(t-1) + a + b_{1}X1(t) - b_{1}X1(t-1)+ b_{2}X2(t) - b_2X2(t-1)\)

        to include the lagged outcome on the right-hand side.
        Last edited by Andrew Musau; 13 Mar 2023, 14:55.

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          There is an intercept. All you are doing is first stationarizing the variables by differencing and then running OLS.

          \(Y(t) - Y(t-1) = a + b_{1}(X1(t) - X1(t-1)) + b_{2}(X2(t) - X2(t-1))\)

          which could also be parametrized as

          \(Y(t) = Y(t-1) + a + b_{1}X1(t) - b_{1}X1(t-1)+ b_{2}X2(t) - b_2X2(t-1)\)

          to include the lagged outcome on the right-hand side.
          Thanks for this explanation Mr. Andrew Musau

          Comment

          Working...
          X