To get the data and R code for the red state, blue-state example, go here: http://www.qjps.com/prod.aspx?product=QJPS&doi=100.00006026 and click on Replication Data.