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

st: RE: Benford's Law


From   "FEIVESON, ALAN H. (AL) (JSC-SK311) (NASA)" <alan.h.feiveson@nasa.gov>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Benford's Law
Date   Wed, 30 Nov 2005 08:20:57 -0600

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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] 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/



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