Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: re. strings and non-string: the month case |
Date | Thu, 21 Nov 2013 16:04:56 +0000 |
This is essentially the same question as asked by Ramesh G. yesterday. See http://www.stata.com/statalist/archive/2013-11/msg00824.html Define value labels before an -encode-: label define mylabels 1 "January" <etc.) encode MONTH, gen(month) label(mylabels) Clearly your value labels must allow one-to-one conversion, as "J" alone could be January, June, July, and so on and so forth. Nick njcoxstata@gmail.com On 21 November 2013 15:53, PAPANIKOLAOU P. <P.Papanikolaou@swansea.ac.uk> wrote: > 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. * * 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/