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: Help for converting string
From 
 
Nick Cox <[email protected]> 
To 
 
"[email protected]" <[email protected]> 
Subject 
 
Re: st: Re: Help for converting string 
Date 
 
Thu, 22 Aug 2013 18:58:04 +0100 
What good would that be?
Consider this. I have a three-category categorical variable. Its
states are 1,2,3. What does that mean?
But you can detach the labels.
Nick
[email protected]
On 22 August 2013 18:50,  <[email protected]> wrote:
> Thank Nick .what I want is just the numeric value when I convert the string
> variable not the label
>
> --
> Ayi Gavriel Ayayi; Ph.D.
> Professor of Financial Economics
> Editors of AEFR, AFJ, EFR and IJEMS
> Département des Sciences de la Gestion
> Université du Québec
> 3351 Boulevard des Forges C.P 500
> Trois Rivières, Québec, G9A 5H7 Canada
> E-mail: [email protected]
> Some of my recent papers at: http://ssrn.com/author=301328
> Tel: (1) 819 376-5011 ext 3137
>
>
>
>
> Nick Cox <[email protected]> a écrit :
>
>
>> -encode- gives you the numeric values with value labels attached. If
>> you want to see the correspondence,
>>
>> . label list countryid
>>
>> Nick
>> [email protected]
>>
>>
>> On 22 August 2013 18:16,  <[email protected]> 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/
>>
>
>
>
> -------------------------------------------------
> Courriel expédié via https://courriel.uqtr.ca
>
>
>
> *
> *   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/