Nick Cox wrote:
> Joseph Coveney suggested -encode- after
> -label define- while Michael Blasnik
> pointed to the -subinstr()- function.
>
> Another solution is not needed therefore,
> but there is in -egenmore- on SSC a
> user-written -egen- function, -ston()-
> (think _s_tring to _n_umeric) which offers
> an alternative. Using that we have, say,
>
> foreach v of var party? {
> egen `v'n = ston(`v'), from(c d l n) to(1/4)
> }
>
> -ston()- has a twin -ntos()- to do the inverse.
Thanks for this.
C.
CLIVE NICHOLAS |t: 0(44)191 222 5969
Politics Building |e: [email protected]
School of Geography, |f: 0(44)870 126 2421
Politics & Sociology |
University of |
Newcastle-upon-Tyne |
Newcastle-upon-Tyne |
NE1 7RU |
United Kingdom |http://www.ncl.ac.uk/geps
*
* 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/