Announcement

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

  • panel data and time variable format

    Hello,

    I have a dataset and i need to define quarterly time variable and declare data to be a panel data. "datadate" variable - contains the calendar date of the fiscal year end of a firm. So what i did is generated a quarter variable and then declare data to be a panel data. I am not sure if my code is correct.

    g quarter = qofd(datadate)
    format quarter %tq
    xtset permno quarter

    But is it possible to use a shorter code? Will this code have the same result?

    g quarter = qofd(datadate)
    xtset permno quarter, format(%tq)

    THank you in advance

  • #2
    Both of the approaches you show look correct and they will produce the same results.

    Comment

    Working...
    X