Blog Archives

JAGS 2.0

April 29, 2010
By

Is out. On sourceforge. Along with a new rjags. Thanks Martyn. I’m looking forward to working my way through some of the improvements, which include block-updating of parameters in GLMs more use of R’s d/p/q family of functions for den...

Read more »

Health Care Reform vote

March 21, 2010
By
Health Care Reform vote

A little bit of churn relative to the House’s 1st shot at this but otherwise a remarkably similar vote, with an estimated cutpoint almost at the same place; see some raw R output, below the fold, after the thumbnail… y is the vote to take up the Senate amendments; yEarly is the previous go at

Read more »

Senators’ ideal points against Obama vote

March 18, 2010
By
Senators’ ideal points against Obama vote

I added another plot to the output generated by my overnight ideal point scripts: a scatterplot of estimated Senate ideal points against Obama vote share in their state (color coded by party, local linear regression overlays by party, labels for some big residuals). I suppose I’m surprised by the way that the loess curve for

Read more »

Stata Fail

March 10, 2010
By
Stata Fail

From a recent mailing from Stata (highlighting by me): Funnily enough, there is a Daniel Rubin, a bio-informatics person here at Stanford.

Read more »

principal components and image reconstruction

March 9, 2010
By
principal components and image reconstruction

Jeff Lewis at UCLA told me he teaches principal components with an image reconstruction example. This got me inspired to try it myself. A snapshot appears below, showing how the image quality improves quickly with a relatively small number of principal components. A full, Sweaved write up is here, making use of the biOps package

Read more »

sequential ideal point estimates

January 9, 2010
By
sequential ideal point estimates

Out of curiosity, I produced a “sequential” set of ideal point estimate for the (current) 111th U.S. Senate, plotting the results in the graph attached below (click on the thumbnail); as is conventional, red is Republican and blue is Democratic. The analysis uses all 373 non-unanimous roll calls in the 111th Senate thus far. Each

Read more »

subsetting a matrix/array in R

January 7, 2010
By

From the R-devel svn log. Nice addition… r50896 | falcon | 2010-01-05 12:05:31 -0800 (Tue, 05 Jan 2010) | 7 lines Changed paths: M /trunk/NEWS M /trunk/src/include/Defn.h M /trunk/src/library/base/man/Extract.Rd M /trunk/src/main/subassign.c M /trunk/src/main/subscript.c M /trunk/src/main/subset.c M /trunk/tests/Makefile.common A /trunk/tests/array-subset.R Allow n-dim arrays to be subsetted by an n-column character matrix The character matrix is converted

Read more »

tooltips in R graphics; nytR package

December 28, 2009
By

At Doug Rivers’ suggestion, I started investigating tooltips as a way to label points in R graphs. An example appears at the top of my blog, where I plot the ideal points (revealed preferences) of the (current) 111th U.S. House of Representatives against Obama vote share in their district in 2008 (SVG). I’m using the

Read more »

malapportionment in the U.S. Senate

December 23, 2009
By
malapportionment in the U.S. Senate

The 40 Republican senators currently in the U.S. senate represent 36% of the U.S population. See the graph below (click on the thumbnail for PDF). This is something I’ve been meaning to compute for a while now, mapping the cumulative distribution of senators’ ideal points onto the cumulative distribution of state population (each state counts

Read more »