Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: re. strings and non-string: the month case


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: re. strings and non-string: the month case
Date   Thu, 21 Nov 2013 16:04:36 +0000

Panos,

In conjunction with -encode-, as suggested by Richard Goldstein, you might want to use the following statement to convert month names to month numbers:

. gen month_num=month(date(MONTH,"M"))

Regards,
Joe Canner
Johns Hopkins University School of Medicine

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of PAPANIKOLAOU P.
Sent: Thursday, November 21, 2013 10:53 AM
To: [email protected]
Subject: st: re. strings and non-string: the month case

Dear All,
I have got a string variable: MONTH, where records the months of the year (e.g., January, February and so forth) on micro-data basis.
Would you please assist me how best I would attach a set of label values where 1 refers to January, 2 is for February and so forth.
I would appreciate your response.
Thanks very much
Panos



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index