Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: convert labels into values


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: convert labels into values
Date   Mon, 10 Jul 2006 21:33:29 +0100

You need to apply -decode- to the two numeric
variables with labels and compare the resulting
strings. 

. search label 

would have pointed you to -decode- (via the 
help for -encode-). 

That said, I do not understand your data set-up. 
It is not clear what an observation is. 

Nick 
[email protected] 

Alexis Furuichi
 
> Does anyone know how to turn labels into values?  I have a 
> dataset with two variables that refer to countries that I 
> want to match, but they are coded differently. So, the data 
> set has two numeric variables:
> 
> id   country    nation
> 1    20           15
> 2    23           11
> 3    14           20
> 
> where the labels are defined differently for the values in 
> "country" and "nation" - 
> 
> id   country     nation
> 1   Israel         Iran
> 2   Iran           Israel
> 3   Turkey       Turkey
> 
> if the labels can be fixed into the variables I can compare 
> them, but as they are, I can not, because the same countries 
> have different values.  The codes do not seem to be in any 
> particular order either.  

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index