Statalist The Stata Listserver


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

RE: st: "Wrong" result with encode / merge ?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: "Wrong" result with encode / merge ?
Date   Fri, 24 Nov 2006 15:26:27 -0000

-encode- maps string variables to numeric
variables 1 to #distinct values, in alphanumeric
order. 

Thus 

	euphemism 
	barbecue
	aardvark 
	aardvark 
	concertina 
	deluge 

will get mapped 

	aardvark      ->         1
	barbecue      ->         2
	concertina    ->         3
	deluge        ->         4 
      euphemism     ->         5 

and the strings on the left become 
value labels for values on the right. 

That's it, more or less; evidently less
than you expected. 

Nick 
[email protected] 

Thomas Erdmann
 
> I think I overestimated what -encode- is actually doing, the 
> explanation
> under help -encode- is a bit short I find.

*
*   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