tag:blogger.com,1999:blog-49185824303413678952018-03-06T04:14:09.386-08:00Continuationsemmelweisnoreply@blogger.comBlogger14125tag:blogger.com,1999:blog-4918582430341367895.post-45595460778931140892008-01-27T04:09:00.000-08:002008-01-27T04:12:10.270-08:00Obama's South Carolina victory not simply a consequence of high black voter turnoutBrian has done <a href="http://electionstats.wordpress.com/2008/01/26/obamas-sc-win-did-not-need-a-large-black-turnout/">some no-nonsense calculations</a> showing that even with a black voter turnout as low as 18%, Obama would have won South Carolina.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-3238606580293899782008-01-21T00:13:00.000-08:002008-01-21T00:15:49.857-08:00University of Michigan statistician studies the NH primaryThe <a href="http://www-personal.umich.edu/~wmebane/NH2008HMW.pdf">article</a>.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-35872692861272700192008-01-15T15:21:00.000-08:002008-01-15T15:44:07.226-08:00Complete map of Diebold precincts<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_KdZB6oMfoOo/R41AKgbIXVI/AAAAAAAAABs/ks0aicpRdlY/s1600-h/diebold.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_KdZB6oMfoOo/R41AKgbIXVI/AAAAAAAAABs/ks0aicpRdlY/s320/diebold.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5155847697655684434" /></a><br />Here you go. Red is Diebold.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-21200554129479310502008-01-15T14:51:00.001-08:002008-01-15T15:02:32.322-08:00Diebold effect sticks around, need a proper statisticianI have incorporated <a href="http://electionstats.wordpress.com/">Brian's work</a> in my latest analysis. I tried different linear and generalized linear models combining Clinton's score, the total number of votes, the usual demographic data, employment rates, education and latitude and longitude.<br /><br />I took the latest available data sets, got the list of towns using electronic voting from the official site, completed and corrected town names by hand.<br /><br />The significant factors I found are, in order of decreasing signifiance:<br /><ul><li>Percent of people holding bachelor's degrees,</li> <li>Voting method.</li></ul>It is interesting to note that when with the new, improved data, the percent of people holding a bachelor's degree becomes extremely significant (about p = 3e-9 vs. about p = 0.001 for voting method.)<br /><br />I'd like someone who know his statistics well to check the data and tell us if the voting method is indeed significant. The fitted models are linear and for all I know, it could be acting as a non-linear proxy for population size or some other funny explanation...<br /><br />Anyway the <a href="http://otto.ouvaton.org/new-hampshire-pack-v2.tar.gz">new data is available here</a>, feel free to check, improve and re-publish it. Note that you need the maptools R package. You can install it by typing <tt>install.packages(c("maptools", "maps"),dependencies=T))</tt> in R.semmelweisnoreply@blogger.com3tag:blogger.com,1999:blog-4918582430341367895.post-47465382101860361682008-01-14T15:40:00.000-08:002008-01-14T15:46:35.825-08:00Geographical explanation might not be as watertight after all...Reddit user brfox has <a href="http://electionstats.wordpress.com/">started his blog</a> on election statistics and did some analysis taking the geographic distribution of states into account. It seems that there is still a Diebold effect.<br /><br />Meanwhile <a href="http://machinist.salon.com/feature/2008/01/11/new_hampshire_vote/index.html">a column at Salon.com</a> argues geography is the explanation.<br /><br />We need to double- and triple-check check all this data carefully. If, after controlling for various parameters, we still have what looks like a statistical anomaly, we must get some expert opinion.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-38872750375539826502008-01-14T04:45:00.000-08:002008-01-14T04:49:47.556-08:00Request voting precinct geographical dataHello all,<br /><br />After brfox's message, I have been scavenging the net for a database that would allow me to map New Hampshire voting precincts.<br /><br />I found some data at the USGS, however voting precincts do not match ZIP codes exactly. Also I need latitude/longitude data.<br /><br />So I parsed the latlong data from Wikipedia, which lists 223 towns. Here <a href="http://otto.ouvaton.org/nh-towns.dat">it is</a>, feel free to use it or to complete it.<br /><br />We can do a paired study on adjacent voting precints with different methods, or do a regression analysis with latitude/longitude as extra data.semmelweisnoreply@blogger.com1tag:blogger.com,1999:blog-4918582430341367895.post-27284301758245717422008-01-14T01:01:00.000-08:002008-01-14T01:04:04.110-08:00Strong geographical clustering of Diebold precinctsSomeone from Reddit has just forwarded me a map showing that precincts using Diebold machines are geographically aggregated in the south-east of the state. Finally, this could be the explanation!<br /><br />We still need to do a study of geographically and demographically similar pairs with distinct voting methods.semmelweisnoreply@blogger.com1tag:blogger.com,1999:blog-4918582430341367895.post-25486804867134481332008-01-13T14:18:00.000-08:002008-01-13T14:19:48.453-08:00Archive of R files and dataYou can <a href="http://otto.ouvaton.org/new-hampshire-pack-v1.tar.gz">download a .tar.gz file containing the R scripts and the CSV data here</a>.semmelweisnoreply@blogger.com3tag:blogger.com,1999:blog-4918582430341367895.post-12112115165231901262008-01-13T13:41:00.001-08:002008-01-13T14:20:57.431-08:00College education is a significant factor, Diebold effect remainsOn Reddit, <a href="http://politics.reddit.com/info/65dov/comments/c02vzsz">ohno</a> linked to a <a href="http://www.tnr.com/politics/story.html?id=17dabbce-95ad-40c1-805c-5c12d0158ba8%20">study</a> suggesting that Clinton's result might be due to a shift in the opinions of college-educated women along with their under-representation in polls.<br /><br />Accordingly, I included the percent holding bachelor's degrees (which I left out of inattention) in the regression analysis. It appears that college education is a very significant factor in explaining Clinton's result: F value 14.3 at p = 0.0002276.<br /><br />However the Diebold effect remains at F = 16.6 and p = 7.859e-05.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-33243091796982639012008-01-13T12:18:00.000-08:002008-01-13T13:10:32.776-08:00Controlling for employment, age, housing or income data doesn't remove the Diebold effectWhile I was spending a quiet Sunday I didn't notice the large amount of activity here. Thanks for all your comments and your data! I thought this analysis was lost in the blogosphere.<br /><br />Meanwhile other have done their own analyses and it seems that the effect doesn't disappear. They have also published their own data in computer-readable format.<br /><br />The mainstream media has also <a href="http://www.boston.com/news/local/new_hampshire/articles/2008/01/11/experts_skeptical_of_nh_ballot_count_conspiracy_theory/">picked up the buzz</a>. <br /><br />I quote:<br /><blockquote><br />Lenski said it's all of a piece: Education, income and age -- factors that influence voters' candidate choices, also play into where they choose to live.</blockquote><br /><br />So I loaded one of these data sets which includes the following data:<br /><ul><br /> <li>Primary results</li><br /> <li>Vote method</li><br /> <li>Sociodemographic data: age distribution, housing units, unemployment rate, median household income, number of single family homes.</li><br /></ul><br /><br />I have then attempted to explain Clinton's result by various combinations of these variables, using multivariate linear regression in GNU R.<br /><br />In all these attempts, voting method remains the most important variable (besides, of course, results of other candidates) explaining Clinton's score, with a F-value of 15 and p < 0.0002. Next we have unemployment rate (with a F-value of 4 and p < 0.04).<br /><br />Here is the R command:<br /><pre><br />> model <- lm(<br /> nh$Clinton ~ <br /> nh$Obama + <br /> nh$Biden +<br /> nh$Dodd +<br /> nh$Edwards +<br /> nh$Gravel +<br /> nh$Kucinich +<br /> nh$D1H0 + <br /> nh$Votes + <br /> nh$Totalpopulation +<br /> nh$Percapitaincome * nh$Totalemployed * nh$Totalunemployed +<br /> nh$Singlefamilyhomes +<br /> nh$Multifamilyunits +<br /> nh$Medianage +<br /> nh$Percenthighschoolgraduates +<br /> nh$Age5andunder * nh$Age5to19 * nh$Age35to54 * nh$Age55to64 + nh$Age65andup +<br /> nh$Employeesinlargestbusiness +<br /> nh$Municipalwater * nh$Municipalsewer * nh$Totalhousingunits <br /> )<br /></pre><br /><br />And its results:<br /><pre><br />nh$Obama 205.6910 < 2.2e-16 ***<br />nh$Biden 0.3304 0.5663645 <br />nh$Dodd 11.2074 0.0010484 ** <br />nh$Edwards 0.8830 0.3490086 <br />nh$Gravel 3.9644 0.0484338 * <br />nh$Kucinich 21.2929 8.867e-06 ***<br />nh$D1H0 15.5007 0.0001299 ***<br />nh$Votes 3.0066 0.0851407 . <br />nh$Totalpopulation 0.2982 0.5859160 <br />nh$Percapitaincome 0.1636 0.6865105 <br />nh$Totalemployed 0.0337 0.8546765 <br />nh$Totalunemployed 0.8149 0.3682376 <br />nh$Singlefamilyhomes 0.1271 0.7219829 <br />nh$Multifamilyunits 0.7231 0.3965950 <br />nh$Medianage 1.1115 0.2935781 <br />nh$Percenthighschoolgraduates 7.536e-07 0.9993086 <br />nh$Age5andunder 3.3983 0.0673950 . <br />nh$Age5to19 1.3064 0.2550066 <br />nh$Age35to54 0.1011 0.7509720 <br />nh$Age55to64 0.1961 0.6585892 <br />nh$Age65andup 0.6695 0.4146369 <br />nh$Employeesinlargestbusiness 0.5505 0.4593790 <br />nh$Municipalwater 0.1546 0.6947648 <br />nh$Municipalsewer 2.6180 0.1079231 <br />nh$Totalhousingunits 3.4622 0.0648983 . <br />nh$Percapitaincome:nh$Totalemployed 0.1181 0.7316529 <br />nh$Percapitaincome:nh$Totalunemployed 0.0032 0.9548340 <br />nh$Totalemployed:nh$Totalunemployed 4.3509 0.0388181 * <br />nh$Age5andunder:nh$Age5to19 0.0871 0.7682941 <br />nh$Age5andunder:nh$Age35to54 0.3209 0.5719690 <br />nh$Age5to19:nh$Age35to54 0.1458 0.7031766 <br />nh$Age5andunder:nh$Age55to64 1.1076 0.2944332 <br />nh$Age5to19:nh$Age55to64 0.0133 0.9082441 <br />nh$Age35to54:nh$Age55to64 0.1195 0.7300958 <br />nh$Municipalwater:nh$Municipalsewer 0.9774 0.3245594 <br />nh$Municipalwater:nh$Totalhousingunits 0.5824 0.4466709 <br />nh$Municipalsewer:nh$Totalhousingunits 0.0487 0.8256904 <br />nh$Percapitaincome:nh$Totalemployed:nh$Totalunemployed 2.7098 0.1019924 <br />nh$Age5andunder:nh$Age5to19:nh$Age35to54 0.1625 0.6874457 <br />nh$Age5andunder:nh$Age5to19:nh$Age55to64 0.7882 0.3761842 <br />nh$Age5andunder:nh$Age35to54:nh$Age55to64 1.6764 0.1975536 <br />nh$Age5to19:nh$Age35to54:nh$Age55to64 0.0148 0.9033289 <br />nh$Age5andunder:nh$Age5to19:nh$Age35to54:nh$Age55to64 0.4226 0.5167068 <br />Residuals <br />---<br />Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 <br /></pre><br /><br />Now let me repeat that I am not a statistician or a sociologist. I have a Ph.D in theoretical computer science and a slight interest in statistics.<br /><br />The mantra is "correlation is not causation" and, as claimed in the Associated Press article, there could very well be an unaccounted sociological factor that correlated with the presence of Diebold machines.<br /><br />However explanations such as "there is no case for concern since precincts with Diebold machines have, strangely enough, always favored such and such a class of candidates" are not very satisfying since it is the very reliability of<br />these Diebold machines that is under question.<br /><br />Hence, under the light of the general surprise of the press at Clinton's victory in New Hampshire, the large discrepancies between some polls and the results and Diebold's history.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-63261747617970055182008-01-12T02:49:00.000-08:002008-01-12T02:57:41.152-08:00Recounts requested!<a href="http://thecaucus.blogs.nytimes.com/2008/01/11/candidates-push-for-a-nh-recount/">Kucinich and Howard asked for recounts.</a>semmelweisnoreply@blogger.com1tag:blogger.com,1999:blog-4918582430341367895.post-10147131675353798822008-01-11T04:41:00.000-08:002008-01-11T04:43:14.208-08:00Request for New Hampshire sociodemographic dataTo check for sociologically significant variables that might be correlated to voting method, we need sociodemographic data on New Hampshire by voting precinct. Unfortunately it seems that the US Census Bureau won't give these for free. Does anyone have such data?semmelweisnoreply@blogger.com4tag:blogger.com,1999:blog-4918582430341367895.post-33772095151395299682008-01-10T23:39:00.000-08:002008-01-10T23:40:40.375-08:00SummaryIn precincts where Diebold machines are used, Hillary gets a 7 point advantage over Obama.<br /><br />According to a best-fit linear model of the effect of precinct size and voting method, voting method accounts for about 4.6 points with high statistical confidence.<br /><br />That's 4.6 points not explained by precinct size, which is included in the model.<br /><br />Including variables such as number of Republican voters or other candidates does not significantly alter this result.<br /><br />Hence the debunking that "Diebold use correlated with large cities correlated with Hillary supporters, thus no conspiracy" is insufficient and further analysis is warranted.<br /><br />Especially given the wild poll discrepancies.semmelweisnoreply@blogger.com0tag:blogger.com,1999:blog-4918582430341367895.post-71188321162498992622008-01-10T12:41:00.000-08:002008-01-10T14:38:43.009-08:00Statistical exploration of New Hampshire Democratic primary resultsA number of people have been surprised by the unexpectedly high score of Hillary Clinton in New Hampshire. Some people noticed that there was a strong correlation between precincts using Diebold equipment and Hillary's score. Other noticed notable discrepancies between polls and the results. Yet others have pointed to some exit polls that do not match with the official results.<br /><br />Some people <a href="http://dhinmi.dailykos.com/storyonly/2008/1/10/02623/2264/85/434176">offered the explanation</a> that smaller precincts tend not to use Diebold machines and also tend to favor Obama, for whatever sociological reasons. As someone put the election data in computer-readable format on the web, and as I am slightly versed in statistical analysis using the R package, I decided to run some tests.<br /><br />First, the data. The data has been posted as a Google spreadsheet on the web <a href="http://politics.reddit.com/info/6512f/comments/c02uut9">by Reddit user brfox</a>.<br /><br />It is missing some data in Dummer Hand, Franconia, Greenfield, Groton Hand, Harts Location, Manchester, Temple Hand, Waterville, Wenworth's Location and Windsor Hand. It has a total of 286139 Democratic voters.<br /><br />Hillary Clinton wins with 39.1%. Obama gets 36.3%. Of all the Democratic votes, 57837 were hand-counted, 207251 (72%) votes were Diebold-counted.<br /><br />So far, so good.<br /><br />In hand-counted precincts, which make up 20.2% of the votes, Obama gets 38.6% and Clinton gets 34.9%. In Diebold-counted ones, Clinton makes 39.6% and Obama gets 36.3%. This is the basis for the initial claims of vote rigging.<br /><br />Claims which are countered by the observation that precincts where the votes are hand-counted are small, non-urban precincts. Urbanity is, of course, a well-known factor affecting political choices.<br /><br />Indeed, the mean precinct size, counted by number of Democratic votes, for hand-counted precincts is 431 (0 to 2602, median 323), against 2159 (269 to 17160, median 1320) for Diebold-counted ones.<br /><br />Actually there is a very significant correlation at p < 0.002 between Clinton's score and the precinct size, and an even better correlation between Clinton's score and voting method, and yet a better correlation between precinct size and voting method.<br /><br />We cannot say much more without going to multivariate statistics. Fortunately, thanks to GNU R, mere mortals can benefit from multi-variate statistical modeling.<br /><br />So, we have three variables: voting method, Clinton's score and the precinct size. We ask R to compute the best linear model that links them, and then run an analysis of variance test on the model to see how well it fits the data.<br /><br /><pre><br />> l <- lm(cliv ~ d$dem_size + hand)<br />> l<br /><br />Call:<br />lm(formula = cliv ~ d$dem_size + hand)<br /><br />Coefficients:<br />(Intercept) d$dem_size hand <br /> 3.859e-01 2.598e-06 -4.644e-02 <br /></pre><br /><br />These cryptic lines mean that Hillary's score can be computed by 38.59% plus the Democratic size divided by 384911.5 (which is 1/2.598e-6) minus 4.64 percentage points whenever the voting method is by hand.<br /><br />So it is estimated that voting method accounts for 4.64 percentage points of Hillary's score.<br /><br />How much variability does this linear formula remove from the data? The standard deviation (on a precinct by precinct basis) of Hillary's score is about 7.8 percentage points.<br /><br /><pre><br />> summary(l)<br /><br />Call:<br />lm(formula = cliv ~ d$dem_size + hand)<br /><br />Residuals:<br /> Min 1Q Median 3Q Max <br />-0.339495 -0.042209 -0.001204 0.046007 0.327182 <br /><br />Coefficients:<br /> Estimate Std. Error t value Pr(>|t|) <br />(Intercept) 3.859e-01 1.009e-02 38.247 < 2e-16 ***<br />d$dem_size 2.598e-06 3.115e-06 0.834 0.405 <br />hand -4.644e-02 1.126e-02 -4.123 5.28e-05 ***<br />---<br />Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 <br /><br />Residual standard error: 0.07371 on 223 degrees of freedom<br />Multiple R-Squared: 0.1081, Adjusted R-squared: 0.1001 <br />F-statistic: 13.51 on 2 and 223 DF, p-value: 2.894e-06 <br /></pre><br /><br />Look at the t value! As you can see, voting method explains a lot better than precinct size.<br /><br />And if you care about ANOVA:<br /><pre><br />> anova(l)<br />Analysis of Variance Table<br /><br />Response: cliv<br /> Df Sum Sq Mean Sq F value Pr(>F)<br />d$dem_size 1 0.05446 0.05446 10.024 0.001761 **<br />hand 1 0.09235 0.09235 16.998 5.28e-05 ***<br />Residuals 223 1.21158 0.00543 <br />---<br />Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1<br /></pre><br /><br />Now let's think a little bit. There could very well be a politically meaningful parameter correlated with voting method besides precinct size. As Diebold has connections with Republicans, it could be that Republicans favor Diebold. Could it be that the Republican to Democrat size ratio explains the voting method?<br /><br />I'll spare you the R screen dump: the p-value of the correlation coefficient being 0.69, the R to D size ratio doesn't seem to explain anything.<br /><br />Hence voting method explains Hillary Clinton's score accross precincts better than precinct size or I fail Statistics 101.<br /><br />All of this is of course armchair politology. I would like the opinion of an independent expert sociologist. However I would like to finish this post with the following quote:<br /><blockquote><p>Bilderberg guests from previous years include Senator Clinton and a former governor of Virginia, Mark Warner, both of whom who are considering running for president in 2008. President Clinton also hunkered down with the club one year. One of the most famous rumors associated with the Bilderberg is that it "anointed" Mr. Clinton in the spring of 1992.<br /></p><p><a href="http://www.nysun.com/article/34231?page_no=1">http://www.nysun.com/article/34231?page_no=1</a></p><p><a href="http://www.nysun.com/article/34231?page_no=1"><br /></a></p> </blockquote>semmelweisnoreply@blogger.com10