Announcement

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

  • Filling gaps in financial time series by excluding weekends

    Hi everybody,

    I am using Stata 13 and have several time series that focus on equity returns etc. Using tsset results in setting the time series but with gaps (due to the weekends).

    If I use tsfill, I fill the gaps with "." since no value exists for the weekend.
    Is there a way to fill the gaps but to "delete" the weekends. For instance, using L.variable should show me on Monday the value of Friday and not the non-existing one for Sunday.

    One way was for example: gen t=_n
    This alligns each row of the Panel to the continous Stata dates. However, I believe there is a more elegant way.

    Many thanks in advance!

  • #2
    Not my field, but this is what business calendars are for. help bcal

    Comment


    • #3
      Many thanks Nick Cox! Worked perfectly!
      I appreciate the fast reply.

      Comment

      Working...
      X