Announcement

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

  • How to list by order of the months?

    I have a month variable which includes the names of the months in a year from January to December. When I use the List function with the option by(month) to see the values of my variables, although the command works and I see all the values, they are not in the order from January to December. I even sorted the data by month before I list them, but the result is the same. How can I have the variables listed by the order of the months in a year, i.e., from January to December? Thank you.

  • #2
    You need a numeric version of month. See if this works:

    Code:
    gen monthnum=month(date(monthstring,"M"))
    Hopefuly you don't have any spelling errors.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://academicweb.nd.edu/~rwilliam/

    Comment

    Working...
    X