If your "entry" is a real number not begining with "." or "-" you can do
gen k = real(substr(string(x),1,1)
Al Feiveson
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Michael Levitan
Sent: Wednesday, November 30, 2005 8:08 AM
To: Statalist
Subject: st: Benford's Law
Hi,
Does anyone have an easy way to identify the leading digit for each
entry in a diverse data set other than a series of inequality filters?
Thanks,
Michael
*
* 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/
*
* 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/