# Does your candidate have a prayer in hell of getting elected?

The other day I wrote about how I had never had the need to do a binomial test for a proportion with SAS. In my business, at least, the question of whether the proportion in the population equals X just doesn’t come up very often. Actually, given that I had taught not one, but two courses on non-parametric statistics in the past and then forgotten about them, it is possible that I did actually do such a test in the past and forgot about it.

I was trying to think about a real-life useful application for this test and it being election season and all, this occurred to me…

Let’s say your candidate, Bill W, is running for dogcatcher. A poll of nearly 2,500 people shows him to have 48% of the vote. Does he have a chance in hell of winning this election?

The question you want answered is whether or not 50.1% is within the realm of probability (the 95% confidence interval) .

As a reminder, the SAS code is

```proc freq data = dsname ; tables candvote / binomial (exactÂ  equiv p = .501) alpha = .05 ;```

SAS will test for the proportion for the FIRST level in the frequency table, but I’m assuming they are in alphabetical order and Bill comes first.

You can see two things from these results. First, your buddy Bill W does not have a chance of getting 50.1% of the vote. However, it is within the 95% confidence interval that he could get 50.02% of the vote.

Still, if I was you, I would be looking for a different job. Maybe as campaign manager for his opponent.

I had a lot more I had to say about categorical data analysis but I did not have time to put it all in one post and I already have seven draft posts that I started and didn’t finish.
Tomorrow we will look at one possible use of the McNemar test – to assess the plausibility of my personal opinion that the claim that teaching about the contributions of famous gay people to science and literature, or anti-bullying classes makes children decide that,

“Hey, I thought I was straight, but on second thought, now I want to have sex with Bob!”

is total bullshit.