Announcement

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

  • date information from HRF-to-SIF

    Dear All, I'd like to have my date information below to be converted from HRF-to-SIF.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str6 tradingmonth
    "Feb-06"
    "Feb-06"
    "Feb-06"
    "Feb-06"
    "Mar-06"
    "Mar-06"
    "Mar-06"
    "Mar-06"
    "Apr-06"
    "Apr-06"
    "Apr-06"
    "Apr-06"
    "May-06"
    "May-06"
    end
    Following the suggestion in this thread https://www.statalist.org/forums/for...ase-management, I did the following
    Code:
    gen mdate = mofd(daily(tradingmonth, "MY", 2050))
    format mdate %tm
    I got the right result, but wonder if this code is OK? Thanks for your suggestions.
    Ho-Chuan (River) Huang
    Stata 15.1, MP(4)

  • #2
    I would have gone directly from the HRF to a monthly date without first passing through a daily date.
    Code:
    gen mdate = monthly(tradingmonth, "MY", 2050)

    Comment


    • #3
      Thanks for the suggestion, William.

      Ho-Chuan (River) Huang
      Stata 15.1, MP(4)

      Comment

      Working...
      X