Announcement

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

  • reshape wide with j = dates prior to 1960

    Hello, I have not been able to figure out a solution and was hoping that someone on this forum could help.

    I have long data where j is a %td variable that starts prior to 1960. Specifically, my j variable is called mcaldt and it includes 31dec1925, 30jan1926, ... 31dec2013.

    When I try:
    reshape wide tmtotout tmpubout, i(kytreasno) j(dm)

    I get a message:
    (note: j = -12419 -12389 -12361 -12329 .... 19662 19691 19723)
    tmtotout-12419 invalid variable name

    Is this because in SIF format, dates before 1960 are negative values, and variable names cannot contain a "-" ?

    Please advise how to get around this problem.

  • #2
    These look like monthly data rather than daily data (perhaps the working day in each month). However you work, recasting them to months will help.

    That said, my answer is that you shouldn't need to do this at all. Why do you think you need to reshape wide? It makes most things more difficult. If you really do need to do that, then for naming the variables, you do need to shift the time origin to get zero or positive times, because as you say negative signs are not allowed in variable names.

    Comment


    • #3
      Thank you. I was hoping that there would be a more elegant solution than shifting the time origin, but if there isn't, I will probably try to work with the data without reshaping.

      Comment

      Working...
      X