Announcement

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

  • How to shift 1 month to date variable

    HELLO
    i have a date variable like
    1981m1
    2001m12
    ..

    i would like to add 1 month[not 30 days] to each obs, so the date variable will be
    1981m2
    2002m1

    i am new to STATA, and hope there is easy function like
    intnx('month', Date ,1) in SAS can solve my problem.

    Thx alot




  • #2
    some idea hits me:
    i use
    gen edate1 = date(edate, "YMD")
    gen dm = mofd(edate1)+1
    format dm %tm


    it works perfect for me now . thanks alot

    Comment

    Working...
    X