Announcement

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

  • How to declare weekly data as time series data in Stata 15

    Dear All
    I want to use time series data on a weekly basis. When I try, I get the error "repeated time values in sample"

    I have used the following commands

    replace Date = wofd(Date)
    (522 real changes made)

    . format %tw Date

    . tset Date
    repeated time values in sample
    r(451);


    Please someone help on how to resolve this . I want to panel data /time series analysis for VAR or ARCH Models
    Attached Files

  • #2
    To get helpful answers, it's important to carefully read the instructions on how to post questions on statalist. It's better to generate a sample of the data set and post it with your question using dataex. I have seen you have uploaded an Excel file but not everyone on this forum uses excel which will make you miss out on their help.

    Cheers
    MJ

    Comment


    • #3
      Conversion to weeks is problematic but not even needed here. With daily dates that are 7 days apart, just use the delta(7) option of tsset or xtset.

      As Joseph explains, and the FAQ expands on in detail, spreadsheet attachments are deprecated here. https://www.statalist.org/forums/help#stata is essential reading to understand why and what to do instead. All members are enjoined to read the FAQ Advice before posting.

      You may well have the problem that you need to specify a panel identifier too.

      See the concurrent thread https://www.statalist.org/forums/for...-week-variable and its references to understand more about weeks.
      Last edited by Nick Cox; 01 Feb 2019, 02:45.

      Comment

      Working...
      X