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]
Re: st: re. strings and non-string: the month case
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
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
[email protected]
On 21 November 2013 15:53, PAPANIKOLAOU P. <[email protected]> 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/