Announcement

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

  • Advice on backtesting when an interaction is significant

    Hi all,

    Currently in the works of writing my thesis where one of the regressions is the following:

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	37.7 KB
ID:	1714348

    rhp = Real House Prices
    shock = Start of unconventional monetary policy
    hsr = housing supply
    hhdi = household income
    mr = mortgage rate
    unem = unemployment
    hhd = household debt

    Basically I am testing whether UMP had an effect on house prices in EZ when accounting for the housing supply (which seems to be the case). However, for the period Q1 2010 - Q1 2021 (shock = Q1 2015) I want to research in which quarter the variable became significant sort of in a backtesting manner. I used the following code, but it drops all variables due to collinearity (I assume the collinearity between quarters):

    gen significance = .

    forval i = 1/44 {
    local quarter = 200 + `i'

    xtreg rhp hsr shock hsrxshock hhdi mr unem hhd if quarter == `quarter', fe

    // Check the significance of the interaction term
    local t_statistic_of_interaction = _b[hsrxshock]
    if abs(`t_statistic_of_interaction') > 1.96 {
    replace significance = `i' if missing(significance)
    }
    }

    Anyone has any ideas on how to determine how I can test in which quarter the interaction variable became significant?

    Many thanks!

    Matthias

  • #2
    Matthias:
    your very same question was replied at:https://www.statalist.org/forums/for...ction-variable.
    That said, I guess yiu bumped it (something tha FAQ do not recommend) because you added more details.
    The firs issue here is that you're using the wrong estimator, as you're dealing with a T>N panel dataset, that calls for -xtregar,fe-
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      Thank you very much for your help.

      After using -xtserial- to assess my dependent variable, real house prices, I have more reason to go with AR(1) disturbance.

      However, I also came across -xtgls- regression where it is possible to also capture heteroskedacity and serial correlation across panels. Since I am dealing with T>N indeed, I might consider this to enhance my regression. But I am unsure if I should stick with -xtregar- (which I believe only accounts for fixed-effects and AR(1)) or that I should go with xtserial and include panels(correlated) and i.countrycode to capture the country fixed effects?


      xttest2 yielded:
      Breusch-Pagan LM test of independence: chi2(45) = 578.984, Pr = 0.0000
      Based on 45 complete observations over panel units

      xttest3 yielded:
      Modified Wald test for groupwise heteroskedasticity
      in fixed effect regression model

      H0: sigma(i)^2 = sigma^2 for all i

      chi2 (10) = 4535.33
      Prob>chi2 = 0.0000


      In conclusion, I am mainly doubting to go with either:

      xtgls rhp hsr shock c.hsr#shock hhdi mr unem hhd i.countrycode, i(countrycode) panels(correlated) corr(ar1)

      or

      xtregar rhp hsr shock c.hsr#shock hhdi mr unem hhd, fe


      Many thanks!

      Comment


      • #4
        I have also tried to do it via xtpcse, which gives me a surprisingly high R-squared. Is the xtpcse perhaps the most efficient in my case? Many thanks!



        . xtpcse rhp hsr shock c.hsr#shock hhdi mr unem hhd i.countrycode, corr(ar1) hetonly

        note: estimates of rho outside [-1,1] bounded to be in the range [-1,1].




        Prais–Winsten regression, heteroskedastic panels corrected standard errors




        Group variable: countrycode Number of obs = 450

        Time variable: quarter Number of groups = 10

        Panels: heteroskedastic (balanced) Obs per group:

        Autocorrelation: common AR(1) min = 45

        avg = 45

        max = 45

        Estimated covariances = 10 R-squared = 0.8905

        Estimated autocorrelations = 1 Wald chi2(16) = 239.89

        Estimated coefficients = 17 Prob > chi2 = 0.0000




        ------------------------------------------------------------------------------

        | Het-corrected

        rhp | Coefficient std. err. z P>|z| [95% conf. interval]

        -------------+----------------------------------------------------------------

        hsr | 118.5515 35.54186 3.34 0.001 48.89079 188.2123

        shock | -14.43245 5.328462 -2.71 0.007 -24.87604 -3.988858

        |

        shock#c.hsr |

        1 | 16.04432 6.02137 2.66 0.008 4.242651 27.84599

        |

        hhdi | .2344595 .0679011 3.45 0.001 .1013758 .3675432

        mr | -3.709244 .8208297 -4.52 0.000 -5.318041 -2.100447

        unem | -1.783133 .2311637 -7.71 0.000 -2.236205 -1.33006

        hhd | .0494675 .0458189 1.08 0.280 -.0403358 .1392708

        |

        countrycode |

        BEL | -14.29905 6.410459 -2.23 0.026 -26.86332 -1.734782

        DEU | -13.5108 6.634439 -2.04 0.042 -26.51406 -.5075333

        ESP | 47.48524 6.767227 7.02 0.000 34.22172 60.74876

        FIN | -13.098 5.112806 -2.56 0.010 -23.11891 -3.077084

        FRA | 6.986866 4.008315 1.74 0.081 -.8692878 14.84302

        IRL | .7288924 6.790749 0.11 0.915 -12.58073 14.03852

        ITA | 22.6014 5.302756 4.26 0.000 12.20819 32.99461

        NLD | -15.44513 12.41251 -1.24 0.213 -39.77321 8.882948

        PRT | 33.90276 6.698068 5.06 0.000 20.77479 47.03073

        |

        _cons | -.8445181 31.93581 -0.03 0.979 -63.43756 61.74852

        -------------+----------------------------------------------------------------

        rho | .9012488

        ------------------------------------------------------------------------------

        Comment


        • #5
          Matthias:
          as "xtpcse assumes that the disturbances are, by default, heteroskedastic and contemporaneously correlated across panels" it is possibly the way to go with your dataset.
          Please note that a high Rsq is not the right yardstick for deciding over the correctness of a regression model.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X