tag:blogger.com,1999:blog-82169300378897096432024-03-13T01:09:43.994-07:00You Infinite SnakeBrighten Godfrey's blog.Unknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8216930037889709643.post-30981485168844812022011-10-20T17:09:00.000-07:002011-11-14T20:43:03.653-08:00The other BarackAccording to <a href="http://www.barackobama.com/one-million-info">this data</a>, exactly two people named Barack have donated to the Obama campaign.
So, who's the other one?Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8216930037889709643.post-2631848648291970082010-10-23T22:05:00.000-07:002010-10-24T00:47:16.990-07:00Google Frequency Plotter<script src="http://www.google.com/uds/api?file=uds.js&v=1.0" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function trim(s) {
return s.replace(/\s+$/, '').replace(/^\s+/, '');
}
// This function scales the submitted values so that
// maxVal becomes the highest value.
var EXTENDED_MAP=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.';
var EXTENDED_MAP_LENGTH = EXTENDED_MAP.length;
function extendedEncode(arrVals, maxVal) {
var chartData = 'e:';
for(i = 0, len = arrVals.length; i < len; i++) {
// In case the array vals were translated to strings.
var numericVal = new Number(arrVals[i]);
// Scale the value to maxVal.
var scaledVal = Math.floor(EXTENDED_MAP_LENGTH *
EXTENDED_MAP_LENGTH * numericVal / maxVal);
if(scaledVal > (EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH) - 1) {
chartData += "..";
} else if (scaledVal < 0) {
chartData += '__';
} else {
// Calculate first and second digits and add them to the output.
var quotient = Math.floor(scaledVal / EXTENDED_MAP_LENGTH);
var remainder = scaledVal - EXTENDED_MAP_LENGTH * quotient;
chartData += EXTENDED_MAP.charAt(quotient) + EXTENDED_MAP.charAt(remainder);
}
}
return chartData;
}
var app;
var searchControl = new GSearchControl();
var counts = new Array();
var pendingQueries = new Array();
pendingQueries[0]="new york";
pendingQueries[1]="champaign";
var currentQuery;
var isRangeQuery = false;
var maxPoints = 51;
var template;
var domain;
var underscores = /_+/g;
function OnLoad() {
app = new App();
}
function App() {
// tell the search control to call be on start/stop
searchControl.setSearchCompleteCallback(app, App.prototype.OnSearchComplete);
var searcher = new GwebSearch();
var options = new GsearcherOptions();
searchControl.addSearcher(searcher, options);
searchControl.draw(document.getElementById("searchcontrol"));
}
App.prototype.OnSearchComplete = function(sc, searcher) {
if (searcher.cursor === undefined) {
counts[currentQuery] = 0;
appendStatus("!");
}
else {
counts[currentQuery] = parseInt(searcher.cursor.estimatedResultCount);
appendStatus(".");
}
executePending();
}
App.prototype.OnSearchStarting = function(sc, searcher, query) {}
App.prototype.OnKeep = function(result) {}
function method_closure(object, method, opt_argArray) {
return function() {
return method.apply(object, opt_argArray);
}
}
GSearch.setOnLoadCallback(OnLoad);
function executePending() {
while (pendingQueries.length > 0 && counts[pendingQueries[pendingQueries.length - 1]]) {
// Skip over the ones we've done
pendingQueries.pop();
appendStatus(".");
}
if (pendingQueries.length > 0) {
q = pendingQueries.pop();
currentQuery = q;
searchControl.cancelSearch();
searchControl.execute(q);
}
else {
allDone();
}
}
function message(m) {
document.getElementById('messages').innerHTML += m + "<br>";
}
function alertMsg(m) {
document.getElementById('alertBox').innerHTML += "<font color=red>[!]</font> " + m;
}
function clearAlert() {
document.getElementById('alertBox').innerHTML = "";
}
function appendStatus(m) {
document.getElementById('statusBox').innerHTML += m;
}
function setStatus(m) {
document.getElementById('statusBox').innerHTML = m;
}
function formatQuery(x) {
return template.replace(underscores, x);
}
function execute() {
pendingQueries = new Array();
template = document.getElementById("inputTemplate").value;
clearAlert();
if (template.indexOf("_") < 0) {
alertMsg("You didn't enter a _ in the first text field.");
}
setStatus("Getting data");
document.getElementById('loadingImg').innerHTML = '<img src="http://brighten.bigw.org/youinfinitesnake/loading_indicator.gif" border=0>';
domainString = document.getElementById("inputDomain").value;
if (domainString.match(/^([0-9]+)-([0-9]+)$/)) {
isRangeQuery = true;
var endpoints = domainString.match(/[0-9]+/g);
var start = parseInt(endpoints[0]);
var end = parseInt(endpoints[1]);
var stepSize = Math.max(1, Math.ceil((end - start + 1) / maxPoints));
if (stepSize > 1) {
alertMsg("Exceeded limit of " + maxPoints + " data points; I'll plot " + start + ", " + (start + stepSize) + ", " + (start + 2*stepSize) + ", ...");
}
domain = new Array();
var j = 0;
for (i = start; i <= end; i += stepSize) {
domain[j] = i;
pendingQueries[j] = formatQuery(i);
j++;
}
}
else {
isRangeQuery = false;
domainString = domainString.replace(/,\s*$/, '');
domain = domainString.split(",");
for (i = 0; i < domain.length; i++) {
domain[i] = trim(domain[i]);
q = formatQuery(domain[i]);
pendingQueries[i] = q;
}
}
pendingQueries.reverse();
executePending();
}
function allDone() {
appendStatus("done.");
document.getElementById('loadingImg').innerHTML = '';
max_y = 0;
var y_values = new Array();
for (i = 0; i < domain.length; i++) {
y_values[i] = counts[formatQuery(domain[i])];
if (y_values[i] > max_y) {
max_y = y_values[i];
}
}
var imgURL;
if (isRangeQuery) {
imgURL = "http://chart.apis.google.com/chart?chxr=0,0," + max_y + "|1," + domain[0] + "," + domain[domain.length - 1] + "&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=" + extendedEncode(y_values,max_y) + "&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=" + escape("Google results for " + template);
}
else {
var xlabels = "";
var maxLen = Math.max(1, Math.floor(70 / domain.length));
for (i = 0; i < domain.length; i++) {
if (domain[i].length > maxLen) {
xlabels += "|" + domain[i].substring(0,maxLen-1);
}
else {
xlabels += "|" + escape(domain[i]);
}
}
imgURL = "http://chart.apis.google.com/chart?chxr=1,0," + max_y + "&chxt=x,y&chxl=0:" + xlabels + "&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=" + extendedEncode(y_values,max_y) + "&chtt=" + escape("Google results for " + template);
}
document.getElementById("resultPlot").src = imgURL;
document.getElementById("plotPermalink").href = imgURL;
}
function checkEnter(e){
var characterCode;
if (e && e.which) { characterCode = e.which }
else { e = event; characterCode = e.keyCode }
if (characterCode == 13) { execute(); }
return (characterCode != 13)
}
//]]>
</script>
<p>Here's an app version of <a href="http://xkcd.com/715/">this xkcd comic</a> that lets you plot the frequency of phrases according to Google searches.</p>
<center>
<table border=0 cellspacing=1 cellpadding=0 width=400 bgcolor=#C6C6C6>
<tr><td align=center bgcolor=#E0E0E0>
<table border=0 width=400>
<tr>
<td align=right valign=middle>Plot</td>
<td align=left valign=middle><input type=text value=""my favorite number is _"" size="40" maxlength="80" id="inputTemplate" onKeyPress="return checkEnter()"></td>
</tr><tr>
<td align=right valign=top>for _ in</td>
<td align=left>
<textarea rows=2 cols=40 onKeyPress="return checkEnter()" id="inputDomain">0-30</textarea><br>
<font color="#555555" size="-1">Enter a range like 1-10 or<br>a list like monday,tuesday,wednesday</font>
</td>
</tr><tr>
<td colspan=2 align=center><input type=button onclick="execute();" value="Execute"></td>
</tr>
</table>
</td></tr>
<tr><td bgcolor=#E0E0E0>
<table border=0 width=400><tr><td width=30>
<div id="loadingImg" style="background-color:#E0E0E0; width:30px; height:30px;"></div>
</td><td>
<div id="statusBox" style="background-color:#E0E0E0;"></div>
</td></tr>
<tr><td></td><td><div id="alertBox" style="background-color:#E0E0E0;"></div></td></tr>
</table>
</td></tr>
<tr><td align=center>
<img id="resultPlot" src="http://chart.apis.google.com/chart?chxr=0,0,151|1,0,30&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:CHPrOaqYXvYKdq8L..dPLBPrQGoQIeMtHoLcGWEqC9KLIeYKhDHoDZGWEqBsBs&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22my%20favorite%20number%20is%20_%22" width=400 height=300>
<br><a href="http://chart.apis.google.com/chart?chxr=0,0,151|1,0,30&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:CHPrOaqYXvYKdq8L..dPLBPrQGoQIeMtHoLcGWEqC9KLIeYKhDHoDZGWEqBsBs&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22my%20favorite%20number%20is%20_%22" id="plotPermalink">Permalink to this chart</a>
</td></tr>
</table>
</center>
<p>Some examples below the fold.</p>
<a name='more'></a>
<h4>Sanity checks</h4>
<center><p><img src="http://chart.apis.google.com/chart?chxr=0,0,512|1,1,15&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:__IgFoGQ..DgCgHwCwlAEAFYAoAQAI&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22i%20have%20_%20fingers%22"></p>
<p><a href="http://www.youtube.com/watch?v=x4o-TeMHys0"><img border=0 src="http://chart.apis.google.com/chart?chxr=1,0,167000&chxt=x,y&chxl=0:|heat|price|cost|tuition|rent&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:AAAAAAAA..&chtt=Google%20results%20for%20%22the%20_%20is%20too%20damn%20high%22"></a></p></center>
<h4>How convenient.</h4>
<center><img src="http://chart.apis.google.com/chart?chxr=1,0,81&chxt=x,y&chxl=0:|sunday|monday|tuesday|wednesday|thursday|friday|saturday&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:h-..W6fmeBxxgZ&chtt=Google%20results%20for%20%22I%20was%20sick%20on%20_%22"></center>
<h4>Politics</h4>
<center>
<p><img src="http://chart.apis.google.com/chart?chxr=1,0,123&chxt=x,y&chxl=0:|obama|mccain|palin|toomey|sestak&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:..LcBC__CF&chtt=Google%20results%20for%20%22i%20donated%20to%20_%22">
<p><img src="http://chart.apis.google.com/chart?chxr=1,0,134&chxt=x,y&chxl=0:|republican|democrat|conservati|liberal|independent|tea%20party&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:..xMKgCYBbA9&chtt=Google%20results%20for%20%22i%20will%20vote%20for%20a%20_%22"><br>[Thanks: Bryan]</p>
</center>
<h4>Most frequent birth year: 1982</h4>
<center><img src="http://chart.apis.google.com/chart?chxr=0,0,2100|1,1880,2010&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:AjAfAnAVATAXANA0AdAdBAAdBIAbAyBfBhA0AwBVBnCaBnBfBbBrBtBzCGBfD5DBCMCxD.DSCxDaD.EYGGE.PiFuFbG6GEGyH1HfKJHEIeJLUgLJJyLTOUOQQRPaRXUUQDSjbRa6YQaoh1aifsZYgnbljqcdcSdYoOeHgnauiIfYbricfslLu7gnjqexj9o1g6rRkRnA2Po1..oOlyqqhhoidKcvmGcSYnSxSlQhNOIiFhDgCSBvBdA4A0BABEAqBKAbA0&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22I%20was%20born%20in%20___%22"></center>
<h4>What you've got</h4>
<center><img src="http://chart.apis.google.com/chart?chxr=1,0,15000&chxt=x,y&chxl=0:|normal|beautiful|thin|smart|stupid|fat&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:A3BiGGNLVa..&chtt=Google%20results%20for%20%22I%27m%20too%20_%22"></center>
<h4>Mind your phone</h4>
<center><img src="http://chart.apis.google.com/chart?chxr=1,0,48500&chxt=x,y&chxl=0:|nerve|house|job|keys|money|phone|wife|husband|mind|wallet&chbh=a,0,2&chs=400x300&cht=bvg&chco=A2C180&chd=e:CICz..DYEAoPF-HvZNII&chtt=Google%20results%20for%20%22i%20lost%20my%20_%22"></center>
<h4>Procreation</h4>
<center><img src="http://chart.apis.google.com/chart?chxr=0,0,17400|1,0,15&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:AGAQ..79fHPqFsC.ByBFBAAjAgARAKAM&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22I%20have%20_%20children%22"></center>
<center><img src="http://chart.apis.google.com/chart?chxr=0,0,498|1,0,15&chxt=y,x&chs=400x300&cht=lc&chco=3D7930&chd=e:____00..8h9Ct4aFeMRmW4RmOpKaHtIG&chg=-1,-1,1,1&chls=3,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Google%20results%20for%20%22I%20have%20_%20grandchildren%22"></center>
<p>Post permalinks to your favorites in the comments below.</p>
<p>Disclaimers: The number of search results reported by Google's search API is known to be occasionally bogus and is not a reliable indicator of anything in particular. Also, there's some bug here if you do a range query with only a single value. Finally, an exclamation point in the status message indicates an error in one query or the lack of any results.</p>
<div id="searchcontrol" style="display:none;"></div>Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-8216930037889709643.post-84721259143249133642010-07-27T02:11:00.001-07:002010-07-29T01:18:42.016-07:00Political divisiveness at an all-time high, quantitatively speaking<p>There's a lot of talk about politics becoming more divisive across parties, with less and less common ground, and Republicans being called and <a href="http://politicalwire.com/archives/2010/07/26/republicans_embrace_party_of_no_strategy.html">embracing</a> the "party of no" label. But is it true? No need to speculate; we can find out with the help of <a href="http://www.senate.gov/pagelayout/legislative/a_three_sections_with_teasers/votes.htm">the raw data</a> in the form of Senate roll call votes (the last ~21.5 years of which are conveniently available), plus some perl scripts.</p>
<h4>Number of votes over time</h4>
<p>Let's start with something simple. Here's the number of yea/nay votes over time in the Senate. (By yea/nay votes, I mean I'm excluding some exceptional votes such as when the vote is Guilty/Not Guilty.) As the plot below shows, the number of votes has remained fairly steady across time, except that odd-numbered years get more votes and there was an unprecedented spike in 1995. And of course, 2010 is at a disadvantage for obvious reasons.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn4LlQYgtYefioSGux9tAxPWGSVRWl_aCogf9FKdSzxWIeLTWcD2Zc7kYuzThdpNj61Z4Tc1dDQje2JtqBLRUpLUK-iQ14Pcq3owWLH4K4TFwWIpDcGs-p_IupOJRiOPRboy26G14ipHIB/s1600/num_votes.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn4LlQYgtYefioSGux9tAxPWGSVRWl_aCogf9FKdSzxWIeLTWcD2Zc7kYuzThdpNj61Z4Tc1dDQje2JtqBLRUpLUK-iQ14Pcq3owWLH4K4TFwWIpDcGs-p_IupOJRiOPRboy26G14ipHIB/s400/num_votes.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498511745109701234" /></a>
<h4>The Party of No</h4>
<p>Does one party vote "no" more often? Below is the fraction of Yea votes cast by each party across time. There is some signal in this data, such as the Republican takeover in the mid-90s. And 2010 is so far at very low fraction of Yea votes by Republicans (49%), beat only by 1993 (43%). But this data clearly requires some more interpretation as to what a Yea or Nay vote actually means. One has to question, for example, why Republicans voted Yea more often in 2009 than Democrats.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCRR7h-rfrkq1uNeAjX0YEE1vnZnywm43g09Q8RPeX56TBYDiGDF3d8zfL0PNIkxj5v6ElLt0dhyEZLA9wL-Lrs_r4OlzIxVeFI5u743MCPkIsM5GRmTM5D0c4Ks1HMtNrb0YtCWJTgw4L/s1600/fraction_yea.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCRR7h-rfrkq1uNeAjX0YEE1vnZnywm43g09Q8RPeX56TBYDiGDF3d8zfL0PNIkxj5v6ElLt0dhyEZLA9wL-Lrs_r4OlzIxVeFI5u743MCPkIsM5GRmTM5D0c4Ks1HMtNrb0YtCWJTgw4L/s400/fraction_yea.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498511749778202818" /></a>
<h4>The naysayingest senator</h4>
<p>Moving to individual member stats, aggregated over the 21.5 years of the data, most members vote no about 30-40% of the time, but there are outliers who are quite agreeable and quite disagreeable:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_CE4Ej4itDF44c7NSEaOiRUrKXlSFzxn1Xy2pBo-ZxAtBxxISo4sWu_a-SUALjBb2Ssfp3j-BRnP0GXBPtrx2-FTb5EC3on6E_jQlImcsBs9wwa4KNRoJL-iL6f6QNd4Im_z7GTBtkoHP/s1600/naysayingness_cdf.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_CE4Ej4itDF44c7NSEaOiRUrKXlSFzxn1Xy2pBo-ZxAtBxxISo4sWu_a-SUALjBb2Ssfp3j-BRnP0GXBPtrx2-FTb5EC3on6E_jQlImcsBs9wwa4KNRoJL-iL6f6QNd4Im_z7GTBtkoHP/s400/naysayingness_cdf.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498511754507090162" /></a>
<p>Here are the top 20 outliers on either end. Current sitting senators, none of whom are in the Yeasayingest column, are linked to their Wikipedia pages.</p>
<center>
<table>
<tr><th colspan=2>Yeasayingest</th><th colspan=2>Naysayingest</th></tr>
<tr><th>Member</th><th>% Nay</th><th>Member</th><th>% Nay</th></tr>
<tr><td>Barkley (I-MN)*</td><td>14.3</td> <td>Wallop (R-WY)</td><td>49.9</td></tr>
<tr><td>Carnahan (D-MO)</td><td>21.5</td> <td><a href="http://en.wikipedia.org/wiki/Jim_DeMint">DeMint (R-SC)</a></td><td>47.9</td></tr>
<tr><td>Burdick (D-ND)</td><td>23.7</td> <td><a href="http://en.wikipedia.org/wiki/Tom_Coburn">Coburn (R-OK)</a></td><td>47.8</td></tr>
<tr><td>Matsunaga (D-HI)</td><td>24.0</td> <td><a href="http://en.wikipedia.org/wiki/George_LeMieux">LeMieux (R-FL)</a></td><td>45.5</td></tr>
<tr><td>Krueger (D-TX)</td><td>24.3</td> <td><a href="http://en.wikipedia.org/wiki/Carte_Goodwin">Goodwin (D-WV)</a>*</td><td>45.5</td></tr>
<tr><td>Burdick, Quentin S (D-ND)</td><td>24.8</td> <td>Symms (R-ID)</td><td>45.1</td></tr>
<tr><td>Mathews (D-TN)</td><td>25.6</td> <td>Armstrong (R-CO)</td><td>45.0</td></tr>
<tr><td>Riegle (D-MI)</td><td>26.1</td> <td>Humphrey (R-NH)</td><td>44.9</td></tr>
<tr><td>Bentsen (D-TX)</td><td>26.2</td> <td><a href="http://en.wikipedia.org/wiki/David_Vitter">Vitter (R-LA)</a></td><td>43.5</td></tr>
<tr><td>Sanford (D-NC)</td><td>26.8</td> <td><a href="http://en.wikipedia.org/wiki/John_Barrasso">Barrasso (R-WY)</a></td><td>43.4</td></tr>
</table>
</center>
<p><a href="http://en.wikipedia.org/wiki/Jim_DeMint">Jim DeMint</a> takes the prize as the naysayingest sitting senator, but he's <a href="http://en.wikipedia.org/wiki/Malcolm_Wallop">Walloped</a> by the naysayingest of all time who voted no on almost half his votes. Malcolm Wallop very nearly maximized the entropy of his votes. Again, this data should be taken with a grain of salt, since how often one votes Nay depends on who currently controls congress.</p>
<p>*Barkley and Goodwin don't really count; Barkley was briefly appointed to replace Paul Wellstone and only cast 14 votes, 12 of them Yea. Goodwin <a href="http://politicalwire.com/archives/2010/07/20/new_senator_to_be_sworn_in_just_before_vote.html">was appointed</a> less than two weeks ago to replace Robert Byrd and has only cast 11 votes, 6 of them Yea.</p>
<h4>General disagreement</h4>
<p>Yea or Nay votes could mean almost anything, depending what question is being voted upon. Here's a more robust metric: the <b>agreement</b> of a vote is 1 if everyone voted the same way, 0 if the vote was split 50/50, and linearly interpolated in between. We're currently at an all-time low of 34.4% (where "all-time" = the last 21.5 years), as you can see below.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHL6_GdSp52y9C1u_dg5dTYlX3_SxVDNbzTAxgWCUheaplzEozgwA1vnsnn1U6RGuHPDomIqtMpC-pQInLBX3o2dUVIhUnT56m3MGz7mhrJ0Ij9dCFSMZt7x70EHLEkRYbIa8EGrZoLN48/s1600/agreement.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHL6_GdSp52y9C1u_dg5dTYlX3_SxVDNbzTAxgWCUheaplzEozgwA1vnsnn1U6RGuHPDomIqtMpC-pQInLBX3o2dUVIhUnT56m3MGz7mhrJ0Ij9dCFSMZt7x70EHLEkRYbIa8EGrZoLN48/s400/agreement.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498511760612707570" /></a>
<p>But this doesn't expose the divisiveness between parties.</p>
<h4>Political divisiveness</h4>
<p>Here's what we really want to see: the average distance between Republicans and Democrats. On some particular vote, we can represent the average Democrat position as the fraction of Dems voting Yea; same for Republicans. <b>Divisiveness</b> is the distance between these two average positions. For example, if 50% of Dems and 50% of Reps vote yes, then divisiveness is 0. If 10% of Dems and 90% of Reps vote yes (or vice versa), then divisiveness is 0.8.</p>
<p>The data shows a striking difference. Politics were more centrist in the late 80s. Divisiveness didn't move much for about 18 years, but then divisiveness dramatically spiked since the beginning of the Obama administration, setting a record in 2009 and another record so far in 2010. The difference here is really quite dramatic: 29% divisiveness in 1989, vs. 70% today.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAEkw5TlANJpL0Mjww1ocfdxikIt86SsCqOPqf8tKMSvWnnIqVDKZVUaLINvPoECTF69VbD5XZvhXrqw-zotrl42sES4v9bXTDCcmXBDgb4zcIzJKdT0JPMAPyaMJQzqrQYkTy5x3q0Iwo/s1600/divisiveness.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAEkw5TlANJpL0Mjww1ocfdxikIt86SsCqOPqf8tKMSvWnnIqVDKZVUaLINvPoECTF69VbD5XZvhXrqw-zotrl42sES4v9bXTDCcmXBDgb4zcIzJKdT0JPMAPyaMJQzqrQYkTy5x3q0Iwo/s400/divisiveness.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498511767896501778" /></a>
<h4>Party unity</h4>
<p>Party unity is closely related to divisiveness. I'm defining unity as the fraction of members who take the majority position in their party, so 0.5 is the minimum score and 1 is the maximum. Party unity appears to have increased over time, though with some wild shifts particularly on the Republican side. Interestingly, Democrats seem to be just as unified as Republicans on the mean vote.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY8JKqYTl0_60HZzIEKUvxd6khGwav_7CMRVAi62SCKRGy_2BBes87-SpwHPtHhIsEuE0BRdmBcDK0pSpwRw4noxNswYSLkUH53KxvKlrVArCcOUQvW1gS1PQNk970oQx3F7LSZleWky6B/s1600/unity.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY8JKqYTl0_60HZzIEKUvxd6khGwav_7CMRVAi62SCKRGy_2BBes87-SpwHPtHhIsEuE0BRdmBcDK0pSpwRw4noxNswYSLkUH53KxvKlrVArCcOUQvW1gS1PQNk970oQx3F7LSZleWky6B/s400/unity.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5498512126959184242" /></a>
<p>Anyone know where to get data going back earlier than 1989?</p>
<h4>Update (July 29, 2010):</h4>
<p>A few important points to emphasize:</p>
<ul>
<li>One shouldn't read too much into this data. Divisiveness, as defined above, has increased---but this says nothing about <i>why</i> it has increased. As commenter GoldenBoy pointed out <a href="http://politicalwire.com/archives/2010/07/27/political_divisiveness_at_an_all_time_high.html">at politicalwire.com</a>, we should naturally expect divisiveness to increase when one party has control of congress and the White House, since they have less need to work with the other party in order to pass legislation. The analysis here really says nothing about to what extent this or other factors caused the increased divisiveness.</li>
<li>Political scientists have performed much more extensive analysis than the simple graphs I've plotted in this post. <a href="http://www.umich.edu/~bnyhan/">Brendan Nyhan</a> pointed me to <a href="http://voteview.com/">Voteview.com</a> which has <a href="http://voteview.com/polarizedamerica.asp#POLITICALPOLARIZATION">great plots of polarization, party unity, and more</a> back to 1879. As a commenter below noted, they also have <a href="http://voteview.com/downloads.asp#PARTYSPLITSDWNL">complete historical roll call data</a> back to the first Congress.</li>
<li>It's important to put the recent increase in divisiveness in the context of a longer-term trend of <a href="http://voteview.com/polarizedamerica.asp#POLITICALPOLARIZATION">increasing polarization</a>. There does seem to be a divisiveness spike in the last couple years, but in general an increase is not surprising.</li>
</ul>Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-8216930037889709643.post-23986843631479882008-11-01T22:32:00.000-07:002010-08-06T21:44:11.847-07:00Progress<p>Gallup <a href="http://www.pollingreport.com/politics.htm">has asked</a>, "If your party nominated a generally well-qualified person for president who happened to be X, would you vote for that person?" for X = {Catholic, black, Jewish, female, hispanic, Mormon, homosexual, atheist}. Below I have plotted their results over time.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZTShHA64LUjiyUDhMtn3TbKydSbLC9bgyiS5FXEw0fgYU8RraJHHOmtdBwNbOAROdj36t2XxQHUsPuyyxTGydrGK4cm-6Y6t3rVzjnLsQ569hKMz7HaUMuTREc7-2lInsfmQXlyTa-mNM/s1600-h/opinions.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZTShHA64LUjiyUDhMtn3TbKydSbLC9bgyiS5FXEw0fgYU8RraJHHOmtdBwNbOAROdj36t2XxQHUsPuyyxTGydrGK4cm-6Y6t3rVzjnLsQ569hKMz7HaUMuTREc7-2lInsfmQXlyTa-mNM/s400/opinions.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5263930365379287138" /></a>
<p><b>Update August 6, 2010:</b> The link to the raw data above no longer has it. But you may be able to get it through some combination of <a href="http://www.gallup.com/poll/3979/americans-today-much-more-accepting-woman-black-catholic.aspx">here</a> and <a href="http://www.gallup.com/poll/26611/some-americans-reluctant-vote-mormon-72yearold-presidential-candidates.aspx#1">here</a> (on the latter link, click through to the second page).Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-8216930037889709643.post-39478323749254861132008-09-25T18:20:00.000-07:002010-08-04T13:21:38.815-07:00An arbitrage opportunityNate Silver <a href="http://www.fivethirtyeight.com/2008/09/intrade-betting-is-suspcious.html">noted a discrepancy</a> between the market prices for bets on who will win the presidential election at <a href="http://www.intrade.com/">Intrade</a> vs. other markets like the <a href="http://www.biz.uiowa.edu/iem/">Iowa Electronic Market</a>, with strange bidding patterns at Intrade. More discussion over at <a href="http://weblog.fortnow.com/2008/09/markets-and-polls.html">Computational Complexity</a>. To help visualize it, here is a graph of the closing prices of <a href="http://data.intrade.com/graphing/jsp/downloadClosingPrice.jsp?contractId=173055">PRESIDENT.DEM2008</a> at Intrade and <a href="http://iemweb.biz.uiowa.edu/pricehistory/PriceHistory_GetData.cfm">PRES08_WTA</a> at IEM.
<b>Update:</b> CQpolitics: <a href="http://www.cqpolitics.com/wmspage.cfm?docID=news-000002976265">Trader Drove Up Price of McCain ‘Stock’ in Online Market</a>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZqSPGcjgKrrRal0MBWCHoPuQ_B7xj7uiz1tjWhuyAhnuZ_KoNBHIt_0AxEgUjGWxB_DUuYkVOfMouCLPgGEPoBo8kkDlqP7aEIZ_aNM21Dr29rb-0J9IN996c7hbV1jMvgPxidWiaq-sN/s1600-h/arbitrage.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZqSPGcjgKrrRal0MBWCHoPuQ_B7xj7uiz1tjWhuyAhnuZ_KoNBHIt_0AxEgUjGWxB_DUuYkVOfMouCLPgGEPoBo8kkDlqP7aEIZ_aNM21Dr29rb-0J9IN996c7hbV1jMvgPxidWiaq-sN/s400/arbitrage.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5250136925615259458" /></a>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguw7bXJnd_Wr_29kHGF6xDqY6-piMCrm6XYNEdv0CpT9-7i11bjUs7_lYwwZvsm2F_waR71b1p3eS9BJdZMLHIsXnc8_m-3CBpL2gBez0nplMrvHQLiePYcR6M7gEifH5jaK6AtVly8NIo/s1600-h/arbitrage_diff.gif"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguw7bXJnd_Wr_29kHGF6xDqY6-piMCrm6XYNEdv0CpT9-7i11bjUs7_lYwwZvsm2F_waR71b1p3eS9BJdZMLHIsXnc8_m-3CBpL2gBez0nplMrvHQLiePYcR6M7gEifH5jaK6AtVly8NIo/s400/arbitrage_diff.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5250136924945040130" /></a>
It certainly looks as though there's been an unusually large difference in prices lately.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-8216930037889709643.post-43312009797650071082008-08-15T15:24:00.000-07:002010-08-04T13:22:41.213-07:00Judicial Linguistics<blockquote><p>There is nothing inherently argumentative or prejudicial about transitive verbs [.]</p><p>— Sacramento County Superior Court Judge <a href="http://www.mercurynews.com/breakingnews/ci_10140389">Timothy M. Frawley</a></p></blockquote>
Turns out it's <a href="http://www.sacbar.org/members/saclawyer/sept_oct2002/frawley.html">not his first</a> foray into judicial linguistics.
<blockquote>During a recent trial, both attorneys handling a case before Judge Timothy M. Frawley misused the word "acclimated" while questioning a witness. Frawley ... waited for a break in the proceedings and, outside the presence of the jury and witness, alerted the attorneys to the correct use of the word.</blockquote>Unknownnoreply@blogger.com0