Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: encode(x) when x is numeric

From   "Nick Cox" <>
To   <>
Subject   st: RE: encode(x) when x is numeric
Date   Sun, 8 Dec 2002 17:25:15 -0000

george m hoffman
> i have a dataset with an x which is a numeric variable.  
> there are only 27
> unique values of this variable. i want to create variable y 
> which takes on
> values 1-27, according to values of x. encode only works 
> with strings. there
> must be an easy way to do this..... any help appreciated.

I am not clear what if any constraints may apply here, 
but consider -egen, group()-. 

*   For searches and help try:

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