Announcement

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

  • Number of days since 1/1/1960.

    Ciao, Say I have data on the month (january, february) and year (1951, 1952) that individuals have been born and want to create a SAS formatted date that equals to the number of days since 1/1/1960. How can this be done?

  • #2
    Originally posted by Leon Edelman View Post
    Ciao, Say I have data on the month (january, february) and year (1951, 1952) that individuals have been born and want to create a SAS formatted date that equals to the number of days since 1/1/1960. How can this be done?
    I accidentally made this post after resolving answer. Excuse me.

    Comment


    • #3
      But the question could still be someone else's question and so the answer remains of interest. If you have numeric months 1 to 12 and years like 1952 then

      Code:
      gen daily_date = mdy(month, 1, year) 
      is a Stata daily date, also with origin 1 January 1960, as is

      Code:
      gen daily_date = dofm(ym(year, month)) 
      In each case, follow with something like

      Code:
      format daily_date %td

      Comment

      Working...
      X