{"id":127,"date":"2007-04-27T20:41:53","date_gmt":"2007-04-27T20:41:53","guid":{"rendered":"http:\/\/skyeome.net\/wordpress\/?p=127"},"modified":"2007-06-16T03:42:10","modified_gmt":"2007-06-16T03:42:10","slug":"prez-candidate-pca","status":"publish","type":"post","link":"https:\/\/skyeome.net\/wordpress\/?p=127","title":{"rendered":"Prez Candidate PCA"},"content":{"rendered":"<p>I&#8217;ve been thinking for a while about using a methodology called Principal Component Analysis (PCA) to create visual comparisons between various political candidates.  Finally stole a few minutes to give it a shot using industry sector contributions to the current presidential races.  <\/p>\n<p><a href=\"http:\/\/skyeome.net\/wordpress\/wp-content\/uploads\/2007\/04\/influencepcaplot.jpg\" ><img decoding=\"async\" id=\"image129\" class=\"alignright\" src=\"http:\/\/skyeome.net\/wordpress\/wp-content\/uploads\/2007\/04\/influencepcaplotsmall.jpg\" alt=\"smallPCAscreenshot\" \/><\/a><\/p>\n<p><!--more--><br \/>\nThe basic idea is that givin a list of values for each candidate (in this  case the totals raised in contributions from various industry sectors) a PCA will produce a plot where the most similar individuals are placed close together.  It is a way of collapsing lots of dimensions into a few.  In this plot the dimensions are labeled in red, and candidates landing close to a label are receiving more from that source than their competitors are.  The This is still a draft of course, but notice how Rudy lands down with &#8220;Oil &#038; Gas&#8221; and &#8220;Casinos, Gambling&#8221;.  Makes Obama look practically saintly, up there with Lawyers, Education, and the entertainment industry.    Also note that this does not produce a strict break between the Dems and Repubs, tho one could draw an approximate dividing line.  <\/p>\n<h3>Methods <\/h3>\n<p>I don&#8217;t know a great deal about PCA, so I&#8217;m very open to suggestions on how to do this better.  I used data from The Center for Responsive Politics&#8217;<a href=\"http:\/\/www.opensecrets.org\/\"> opensecrets.org<\/a> site.  They take the funding reports filed by each candidate to date (April 2007) and provide a breakdown of contribution totals by industry sector.<\/p>\n<p><a href=\"http:\/\/www.opensecrets.org\/pres08\/select.asp?Ind=H01rious industry sectors0\"><img decoding=\"async\" id=\"image126\" src=\"http:\/\/skyeome.net\/wordpress\/wp-content\/uploads\/2007\/04\/industrycontrib.jpg\" alt=\"IndustryContributionsPage\" \/><\/a><\/p>\n<p>Since I don&#8217;t have access to their DB (&#8216;tho the underlying FEC data is available online for free) I copied and pasted until I had a vector for each candidate, giving contributions from each sector<\/p>\n<p><strong>Candidates   Lobbyists\tCasinos\/Gambling..<\/strong><br \/>\nHillary Clinton (D)\t168050\t39650<br \/>\nJohn McCain (R)\t147850\t20650<br \/>\nMitt Romney (R)\t93874\t2100<br \/>\nRudolph W. Giuliani (R)\t82650\t94900<br \/>\nChristopher J. Dodd (D)\t59750\t47800<br \/>\nJoseph R. Biden Jr. (D)\t48750\t0<br \/>\nBarack Obama (D)\t29079\t0<br \/>\nBill Richardson (D)\t23400\t21600<br \/>\nDuncan Hunter (R)\t15250\t0<br \/>\nJohn Edwards (D)\t12950\t0<\/p>\n<p>(etc.)<\/p>\n<p>I loaded this data into <a href=\"http:\/\/cran.r-project.org\/\">R<\/a> and used the prcomp() and biplot() commands.   The main feature that was immediately apparent is that many of the candidates just had much less cash.  I zoomed the plot in on the main candidates so they could be seen more clearly.  But really there should be some kind of normalization strategy, or a better measure of comparison between the candidate&#8217;s vectors ( I believe prcomp PCA is using SVD correlation matrix?  I&#8217;m always a bit confused between PCA, Classic MDS ,etc)<\/p>\n<p>Anyway, the result seemed reasonable enough that it is worth pursuing, finding out more about the methods, deciding what attribute are worth including in the vectors.  And especially tracking over time&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been thinking for a while about using a methodology called Principal Component Analysis (PCA) to create visual comparisons between various political candidates. Finally stole a few minutes to give it a shot using industry sector contributions to the current presidential races.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,22],"tags":[],"_links":{"self":[{"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/127"}],"collection":[{"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":0,"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skyeome.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}