{"id":1699,"date":"2011-10-16T23:57:41","date_gmt":"2011-10-17T04:57:41","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=1699"},"modified":"2011-10-16T23:59:25","modified_gmt":"2011-10-17T04:59:25","slug":"does-your-candidate-have-a-prayer-in-hell-of-getting-elected","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/does-your-candidate-have-a-prayer-in-hell-of-getting-elected\/","title":{"rendered":"Does your candidate have a prayer in hell of getting elected?"},"content":{"rendered":"<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/sleepingdog.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/sleepingdog-300x228.png\" alt=\"Sleeping Dogo Argentino (big white dog)\" title=\"sleepingdog\" width=\"300\" height=\"228\" class=\"alignright size-medium wp-image-1724\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/sleepingdog-300x228.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/sleepingdog.png 434w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<strong> <\/strong>The other day I wrote about how I<a href=\"http:\/\/www.thejuliagroup.com\/blog\/?p=1677\"> had never had the need to do a binomial test for a proportion with SAS<\/a>. In my business, at least, the question of whether the proportion in the population equals X just doesn&#8217;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.<\/p>\n<p>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&#8230;<\/p>\n<p>Let&#8217;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?<\/p>\n<p>The question you want answered is whether or not 50.1% is within the realm of probability (the 95% confidence interval) .<\/p>\n<p>As a reminder, the SAS code is<\/p>\n<p><code>proc freq data = dsname ;<br \/>\ntables candvote \/ binomial (exact\u00a0 equiv p = .501) alpha = .05 ;<\/code><\/p>\n<p>SAS will test for the proportion for the FIRST level in the frequency   table, but I&#8217;m assuming they are in alphabetical order and Bill comes   first.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/billw.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-1722\" title=\"billw\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/billw-300x197.png\" alt=\"Table shows 50.1% is not in 95% CI but &gt; 50% is\" width=\"300\" height=\"197\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/billw-300x197.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/10\/billw.png 516w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>Still, if I was you, I would be looking for a different job. Maybe as campaign manager for his opponent.<\/p>\n<p>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&#8217;t finish.<br \/>\nTomorrow we will look at one possible use of the McNemar test &#8211; 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,<\/p>\n<p><em> &#8220;Hey, I thought I was straight, but on second thought, now I want to have sex with Bob!&#8221; <\/em><\/p>\n<p>is total bullshit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t come up very often. Actually, given that I had taught not one, but two&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1699","post","type-post","status-publish","format-standard","hentry","category-statistics"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":6,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"predecessor-version":[{"id":1727,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1699\/revisions\/1727"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}