Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Richard Goldstein <richgold@ix.netcom.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Re: Help for converting string |
Date | Thu, 22 Aug 2013 13:57:51 -0400 |
then use the -label drop- command Rich On 8/22/13 1:50 PM, ayayi@uqtr.ca wrote: > Thank Nick .what I want is just the numeric value when I convert the > string variable not the label > Nick Cox <njcoxstata@gmail.com> a écrit : > -encode- gives you the numeric values with value labels attached. If > you want to see the correspondence, > > . label list countryid > > Nick > njcoxstata@gmail.com > > > On 22 August 2013 18:16, <ayayi@uqtr.ca> wrote: > >> - I have Stata IC 10 >> - I converted string variable in numeric variable by using -encode- >> I did this: >> >> encode country, generate(countryid) >> I got: >> >> countryid >> Ghana >> Togo >> Nigeria >> Benin >> Norway >> France >> etc.. >> >> What I want to have is the numerical value that correspond to the countryid >> i.e. >> countryid >> 1 >> 2 >> 3 >> 4 >> 5 >> 6 >> etc * * 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/