Announcement

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

  • Syntax to include time trend in panel data analysis

    Hi everyone,

    I have a rather simple question but just want to be clear about it:

    I want to run a panel data analysis and I will try several commands to do it as I have time-invariant variables (xthtaylor, xtabond2 and I will try xtdpdml, which is not yet official though, as far as I know).

    In these various models, I want to estimate the effect of the time trend, which means I would like to include a continuous variable for time (t), and a quadratic one as well (t²).

    Can I include such time variables in these models, and if it is the case, should I use xtset like this:

    xtset id t

    or like this:

    xtset id

    Thank you very much

  • #2
    If you have a variable called year, just add in year as an explanatory variable and/or it's square or whatever polynomial. And, if you work with quarterly data, you'd want to do "egen tid=group(year quarter)" and then do the same thing but instead with tid.

    Comment

    Working...
    X