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

st: Assigning prime numbers


From   [email protected]
To   <[email protected]>
Subject   st: Assigning prime numbers
Date   Thu, 12 May 2005 17:27:56 +0100

Hi,

I have a string variable which can take about 500 different values.  I
would like to assign a different prime number to each value of this
string so that I get:

String   Prime
A01		2
A02		3
A03		5
B01		7
C01		11
D02		13
F03		17
Etc

Any suggestions would be most welcome!

Thanks.

Steve

 

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