Announcement

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

  • Time fixed effects model when using xtvar2

    Hi there,

    Looking for some help around using time fixed effects in a panel var, using the xtvar2 module. Below is my code:

    clear
    import dataset
    xtset Tag NewYear
    gen lngdp=ln(NYGDPPCAPCD)
    gen ORxAA=AA*NYGDPPETRRTZS
    gen ORxBA=BA*NYGDPPETRRTZS
    gen laglngdp=L.lngdp
    gen lagORxAA=L.ORxAA
    gen lagORxBA=L.ORxBA
    gen lagrents=L.NYGDPPETRRTZS
    gen laggdp=L.NYGDPPCAPCD
    collapse(mean) CCEST laggdp lagrents laglngdp lagORxAA lagORxBA NYGDPPCAPCD NYGDPPETRRTZS ORxAA ORxBA, by(NewYear Tag)
    gen biyear = floor(NewYear/2)*2
    tab biyear,gen(fqe)

    I am then attempting to generate the model using the following command:
    xtvar2 CCEST NYGDPPCAPCD ORxAA ORxBA fqe1 fqe2 fqe3 fqe4 fqe5 fqe6 fqe7 fqe8 fqe9 fqe10, lags(1)

    I receive a conformability error, but diagnostics do not show any missing data, etc.. So not sure what I can do about this?

    Any help would be much appreciated!

  • #2
    sorry but i have an hard time to understand some of the passages here...

    you generate all the lagged variables, and then you lag them again when trying the VAR... can you just use xtvar2 with lags(2)?

    and if you use collapse, are you sure to have enough years to actually run the VAR?

    Comment


    • #3
      Hi Martino,

      you can disregard the manually lagged variables as they are part of a xtreg model (that is working just fine!). Collapsing is fine, the issue is not related to an inability to run the model. It is an inability to run the model with fixed effects which is the issue.

      Comment

      Working...
      X