
Chi-square goodness-of-fit, Benford’s law, and the Iranian election - mariorz
http://incanter.wordpress.com/2009/06/21/chi-square-goodness-of-fit/
======
magoghm
Walter Mebane uses Benford's Law on the second digit as a more reliable system
to detect electoral fraud: <http://www.umich.edu/~wmebane/pm06.pdf>
Furthermore, it is interesting to note that he pointed out in 2006 that the
results of the Mexican presidential election seemed fraudulent and he
recommended a recount. But at that time the mainstream media seemed quite
happy with the official winner, so they didn't talk about it, even when over
two million Mexicans protested in Mexico City over the election results. The
mainstream media decided to ignore all the statistical evidence of fraud, and
just label the other candidate a a "sore loser".

------
bint
Commentators are “explaining” the Iran elections based on their own illusions,
delusions, emotions, and vested interests. Whether or not the poll results
predicting Ahmadinejad’s win are sound, there is, so far, no evidence beyond
surmise that the election was stolen. However, there are credible reports that
the CIA has been working for two years to destabilize the Iranian government.

On May 23, 2007, Brian Ross and Richard Esposito reported on ABC News: “The
CIA has received secret presidential approval to mount a covert “black”
operation to destabilize the Iranian government, current and former officials
in the intelligence community tell ABC News.”

On May 27, 2007, the London Telegraph independently reported: “Mr. Bush has
signed an official document endorsing CIA plans for a propaganda and
disinformation campaign intended to destabilize, and eventually topple, the
theocratic rule of the mullahs.”

A few days previously, the Telegraph reported on May 16, 2007, that Bush
administration neocon warmonger John Bolton told the Telegraph that a US
military attack on Iran would “be a ‘last option’ after economic sanctions and
attempts to foment a popular revolution had failed.”

On June 29, 2008, Seymour Hersh reported in the New Yorker: “Late last year,
Congress agreed to a request from President Bush to fund a major escalation of
covert operations against Iran, according to current and former military,
intelligence, and congressional sources. These operations, for which the
President sought up to four hundred million dollars, were described in a
Presidential Finding signed by Bush, and are designed to destabilize the
country’s religious leadership.”

\--> <http://www.counterpunch.org/roberts06192009.html>

Yep, a full blown infowar is what we have here.

~~~
Devilboy
That's what I don't understand: Weeks before the election several polls
(including ones by Western newspapers) predicted a 2 to 1 win for Ahmadinejad.
These predictions were all fairly uncontroversial as far as I could tell.

Now suddenly everywhere I look there's stories about young photogenic Iranians
getting shot at while protesting the election results. I keep hearing about
claims that the election was rigged but so far I've not seen anything
concrete.

The only way I can make sense of this is by assuming infowar / agent
provocateur / other covert tactics employed by the USA. Iran has been a thorn
in the side of America's middle-eastern foreign interests for a long time, and
poking holes in it's democratic process is an important step.

I can't even visit Reddit at the moment, every second story is about Americans
getting angry at Ahmadinejad.

~~~
earl
All of the election polls that I'd seen predicting a 2-1 win also had 40-60
percent of the respondents not responding. That they all broke for Ahmadinejad
seems... unlikely.

~~~
bilbo0s
Hello,

I am putting together information on the Iranian elections for a report I am
doing on the political risks of international investment. The information that
I have collected thus far indicated that the highest rate of non respondents
in the indicated polls was 43%. That was the rate for the Washington Post
poll. Would it be possible for you to share the polling data with me for the
polls with non respondent rates higher than 43%. That data would be EXTREMELY
helpful to me.

------
earl
Wow -- incanter looks terrible. All that code to run a chi2 test and a plot?

~~~
liebke
The plots and chi-square tests are a single function each, it's the data
preparation that takes up so much space. Alas, most statistical analyses
involve a lot of preparatory steps, which are rarely shown in the final write-
up.

~~~
earl
Since I recently did something similar in R:

    
    
       d <- read.csv(file='~/stuff/earlh/Iran_2009.csv', header=T, sep=',')
    
       lastDigit <- function(v){
       	v - 10*floor(v/10)
       }
       
       digits <- lastDigit( c(d$Ahmadinejad, d$Karroubi, d$Mousavi, d$Rezaee))
       hist(digits, breaks=10)
       
       #chi2 gof
       tab <- table(digits)
       n <- length(digits)
       
       model <- chisq.test(x=tab, p=rep(0.1, 10))
       model
       
       # hand generated -- check our work above
       ts <- 0
       for(i in 1:length(tab)){
       	ts <- ts + ( tab[[i]] - 0.1*n)^2 / (0.1*n)
       }
       qchisq(p=1-0.076, df=9)
    
    

and to be more specific:

    
    
      (def regions (sel votes :cols "Region"))
      (def ahmadinejad-votes (sel votes :cols "Ahmadinejad"))
      (def mousavi-votes (sel votes :cols "Mousavi"))
      (def rezai-votes (sel votes :cols "Rezai"))
      (def karrubi-votes (sel votes :cols "Karrubi"))
      # -or-
      attach(d)
    
      (def ahmadinejad (map first-digit ahmadinejad-votes))
      (def mousavi (map first-digit mousavi-votes))
      (def rezai (map first-digit rezai-votes))
      (def karrubi (map first-digit karrubi-votes))
      # -or-
       digits <- lastDigit( c(d$Ahmadinejad, d$Karroubi, d$Mousavi, d$Rezaee))  # not even attached -- could drop d$
    

etc. While it's obviously a matter of taste, it looks horridly verbose.

~~~
pygy
It could be done more concisely by using data structures and the (map fn
struct) function, but it was expanded for clarty.

