**
This Thread may be Removed Anytime!**

Twitter may remove this content at anytime! Save it as PDF for later use!

- Follow @ThreadReaderApp to mention us!
- From a Twitter thread mention us with a keyword "unroll"

`@threadreaderapp unroll`

Practice here first or read more on our help page!

@QuasLacrimas @VirtuArete I can help you if you'd like. I have multiple processes for performing Benford's chi-squared tests using Python. If your data is available via link, let me know and I can customize a script for you and send it to you.

@QuasLacrimas @VirtuArete To speed things along, look at the following I'm posting. First use this to create the Benford's ratios:

def getBenfords():

expected = [log10(1+1/d) for d in range(1,10)]

return expected

def getBenfords():

expected = [log10(1+1/d) for d in range(1,10)]

return expected

@QuasLacrimas @VirtuArete Next, use this to perform the test

from scipy.stats import chisquare

benfords = get Benfords()

expectedvals = [sum(actualvals)*a for a in benfords]

actualpercent = [a/sum(actualvals) for a in actualvals]

chival,pval = chiTest(actualvals,expectedvals)

from scipy.stats import chisquare

benfords = get Benfords()

expectedvals = [sum(actualvals)*a for a in benfords]

actualpercent = [a/sum(actualvals) for a in actualvals]

chival,pval = chiTest(actualvals,expectedvals)