Comments on Analysis in R indicates "Moderately Strong Support" for fraud in Iranian electionTypePad2009-06-18T23:17:57ZBlog Administratorhttps://blog.revolutionanalytics.com/tag:typepad.com,2003:https://blog.revolutionanalytics.com/2009/06/analysis-in-r-indicates-fraud-in-iranian-election/comments/atom.xml/Felix Andrews commented on 'Analysis in R indicates "Moderately Strong Support" for fraud in Iranian election'tag:typepad.com,2003:6a010534b1db25970b011571798fa6970b2009-06-28T07:39:53Z2009-06-28T07:39:53ZFelix Andrewshttp://neurofractal.org/felix/A more readable implementation might be second_digit <- as.numeric(substring(x,2,2))<p>A more readable implementation might be<br />
second_digit <- as.numeric(substring(x,2,2))</p>David Smith commented on 'Analysis in R indicates "Moderately Strong Support" for fraud in Iranian election'tag:typepad.com,2003:6a010534b1db25970b011571409c0c970b2009-06-22T17:53:25Z2009-06-22T17:53:25ZDavid Smithhttp://www.revolution-computing.comThanks, Corey. Now, for comparison, how would one do that in Excel or SAS? :) Incidentally, I was wondering why...<p>Thanks, Corey. Now, for comparison, how would one do that in Excel or SAS? :)</p>
<p>Incidentally, I was wondering why Mebane analyzed the second digit for the Benford's Law analysis (rather than the first as Roukema did -- see also <a href="http://www.stat.columbia.edu/~cook/movabletype/archives/2009/06/unconvincing_to.html" rel="nofollow">Gelman's comments</a> on this paper). I found the <a href="http://www.fivethirtyeight.com/2009/06/karroubis-unlucky-7s.html" rel="nofollow">answer</a> (see comment by "tomi"):</p>
<p>"Another important issue concerns whether Benford's Law should be expected to apply to all the digits in reported vote counts. In particular, for precinct-level data there are good reasons to doubt that the first digits of vote counts will satisfy Benford's Law. Brady (2005) develops a version of this argument. The basic point is that often precincts are designed to include roughly the same number of voters. If a candidate has roughly the same level of support in all the precincts, which means the candidate's share of the votes is roughly the same in all the precincts, then the vote counts will have the same first digit in all of the precincts. Imagine a situation where all precincts contain about 1,000 voters each, and a candidate has the support of roughly fifty percent of the voters in every precinct. Then most of the precinct vote totals for the candidate will begin with the digits `4' or '5.' This result will hold no matter how mixed the processes may be that get the candidate to roughly fifty percent support in each precinct. For Benford's Law to be satisfied for the first digits of vote counts clearly depends on the occurrence of a fortuitous distribution of precinct sizes and in the alignment of precinct sizes with each candidate's support. It is difficult to see how there might be some connection to generally occurring political processes. So we may turn to the second significant digits of the vote counts, for which at least there is no similar knock down contrary argument." (From a 1996 <a href="http://www.umich.edu/~wmebane/pm06.pdf" rel="nofollow">paper</a> by Mebane.)</p>Corey commented on 'Analysis in R indicates "Moderately Strong Support" for fraud in Iranian election'tag:typepad.com,2003:6a010534b1db25970b0115703775a7970c2009-06-19T04:36:08Z2009-06-19T04:36:08ZCoreysecond_digit <- floor(x * 10^-ceiling(log(x,10)-2) - 10*floor(x * 10^-ceiling(log(x,10)-1)))<p>second_digit <- floor(x * 10^-ceiling(log(x,10)-2) - 10*floor(x * 10^-ceiling(log(x,10)-1))) </p>Jon Baron commented on 'Analysis in R indicates "Moderately Strong Support" for fraud in Iranian election'tag:typepad.com,2003:6a010534b1db25970b0115712b5dd9970b2009-06-19T00:43:13Z2009-06-19T00:43:13ZJon Baronhttp://www.sas.upenn.edu/~baron/Another analysis, somewhat different, supports the fraud hypothesis: here.<p>Another analysis, somewhat different, supports the fraud hypothesis: <a href="http://www.sas.upenn.edu/~baron" rel="nofollow">here</a>.<br />
</p>