Announcement

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

  • Panel data: Stata sets delta as 1 day, although monthly data

    Hi,

    I do have monthly data from CRSP. For my analysis I want to xtset the data:

    xtset permno date

    That is what Stata reveals:

    panel variable: permno (unbalanced)
    time variable: date, 29jan1988 to 31dec2014, but with gaps
    delta: 1 day

    Since I use monthly data delta should be 1 month, shouldn't it? (The format of my date variable is long%d)

    How do I get a delta of 1 month? Can anyone help me?

  • #2
    Dates and times are not really difficult so long as you are prepared to read the documentation.
    Code:
      help dates and times
    In your case it seems that you need to extract a monthly date from a daily date:
    Code:
      gen mdate = mofd(date)
      format mdate %tm
      xtset permno mdate

    Comment

    Working...
    X