Announcement

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

  • Stata returns missing values when distringing dates

    Using stata version 15

    baseline_date format is 7/29/17

    I used the commands:
    ​​​​​​gen baseline_date_rc =date(baseline_date,"MDY")
    format baseline_date_rc %d

    Stata generates a new variable -- baseline_date_rc but rows are only populated by missing. I would appreciated help with this one.

    Jake

  • #2
    For two-digit years, use date function with the mask “MD20Y
    Code:
    gen baseline_date_rc =date(baseline_date,"MD20Y")
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Thanks very much!

      Comment

      Working...
      X