Announcement

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

  • Coding date having month and year only

    Hello All!
    I have date variable with month and year only for e.g. August, 2011. The problem is how to code this variable in Stata.

  • #2
    Welcome to the Stata Forum / Statalist.

    Please read the FAQ, particularly the topic about sharing data/command/ output.

    That being said, provided it is acknowledged by Stata as a date variable, you may get the year as well as the month by using the functions year() and month(), respectively.

    In the Stata Manual, I recommend you look for the term "Extracting components of dates and times".

    Hopefully that helps.
    Best regards,

    Marcos

    Comment

    Working...
    X