Announcement

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

  • Identifying closest date to another date variable

    Hi, i have a table with announcement date (anndat) and statistical period which is counts as a forecast period(statper) and i need to keep only statper that is closest to announcement date (anndat). How can I do this? I am a bit confused about the code i need to use.

    Thank you in advance.

    Olga
    id anndat statper
    1 14Feb2014 17apr2014
    1 7May2014 19Sep2014
    1 06Aug2014 17Nov2014
    2 30Jan2015 17Sep2015
    2 28Oct2015 18Oct2015

  • #2
    This thread has been wisely reposted at https://www.statalist.org/forums/for...-date-variable.
    Kind regards,
    Carlo
    (Stata 16.0 SE)

    Comment

    Working...
    X