Announcement

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

  • Panel regression: difference

    Hi,
    I'm working with panel dataset-quarterly data with housing prices by my country's regions. I used LLC unit root test for each variable.
    Preferred transformation for stationarity purposes is year over year difference (Q1 2015 - Q1 2014). All independent variables (except few, which I transformed using growth rates) are transformed using differences mentioned. Problem is with one of my dependent variable. Stationarity is not achieved using either option (difference, growth rate, logarithm). But the question, and the reason I am writing here, is just the difference.

    I made the mentioned difference simply with the following command:
    Code:
    bysort region: gen dif_pprice = pprice[_n] - pprice[_n-4]
    According to the LLC test, the differenced variable is still non-stationary. However, if I perform differencing using the command:

    Code:
    bysort region: gen dif2_pprice = d4.pprice
    , the resulting variable reaches different values than the 1st variant of the transformation and the variable is stationary.
    If I manually calculate the YOY difference to check, the first option comes out correct.

    If I just do a first difference (to test) with both variants (pprice[_n] - pprice[_n-1] and d1.pprice), the results are identical.

    What is the difference between these two options? Respectively, what do I achieve by using the second option (d4.pprice)? Thank you very much for your answers.
    Last edited by Ondrej Zavacky; 26 Aug 2023, 01:05.

  • #2
    Ondrey:
    welcome to this forum.
    As per -help tsvarlist- the -D.-operator performs a difference of difference:
    Code:
    D2.       difference of difference (x_t - 2x_t-1 + x_t-2)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X